您好,登錄后才能下訂單哦!
設(shè)置預(yù)約規(guī)則的客戶端代碼:
int stopHourInt = (int)stopHour.Value; int stopMinuteInt = (int)stopMinute.Value; //截止的時(shí)間 int stopTimeInt = stopHourInt * 100 + stopMinuteInt; //提前的天數(shù) int dayspan = (int)numDay.Value; //聲明一個(gè)Cla***oomConfig類 并設(shè)定具體的值 Cla***oomConfig cla***oomConfig=new Cla***oomConfig (); cla***oomConfig.DaySpan=dayspan ; cla***oomConfig.StopTime=stopTimeInt; cla***oomConfig.Id = roomConfigID; cla***oomConfig.RoomID=this.itemID ; //發(fā)送預(yù)約規(guī)則個(gè)服務(wù)器端,并獲取返回結(jié)果 ResMessage resMessage=tcpConnnection.SendReceiveObject<ResMessage>("AddRoomConfig","ResRoomConfig",5000, cla***oomConfig); if (resMessage.Message == "操作成功") { GetCurrentRoomConfig(); MessageBox.Show("添加設(shè)置完成"); } else { MessageBox.Show("出現(xiàn)錯(cuò)誤,錯(cuò)誤為" + resMessage.Message); }
服務(wù)器端處理代碼如下:
構(gòu)造函數(shù)中聲明:
//學(xué)校管理員添加教室的相關(guān)設(shè)置 NetworkComms.AppendGlobalIncomingPacketHandler<Cla***oomConfig>("AddRoomConfig", HandleAddRoomConfig);
處理方法:
private void HandleAddRoomConfig(PacketHeader header, Connection connection, Cla***oomConfig cla***oomConfig) { DoCla***oomConfig.Save(cla***oomConfig); ResMessage theMessage = new ResMessage(); theMessage.Message = "操作成功"; connection.SendObject("ResRoomConfig", theMessage); }
操作類:
DoCla***oomConfig
數(shù)據(jù)庫類:
DBCla***oomConfig
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。