您好,登錄后才能下訂單哦!
設置預約規則的客戶端代碼:
int stopHourInt = (int)stopHour.Value; int stopMinuteInt = (int)stopMinute.Value; //截止的時間 int stopTimeInt = stopHourInt * 100 + stopMinuteInt; //提前的天數 int dayspan = (int)numDay.Value; //聲明一個Cla***oomConfig類 并設定具體的值 Cla***oomConfig cla***oomConfig=new Cla***oomConfig (); cla***oomConfig.DaySpan=dayspan ; cla***oomConfig.StopTime=stopTimeInt; cla***oomConfig.Id = roomConfigID; cla***oomConfig.RoomID=this.itemID ; //發送預約規則個服務器端,并獲取返回結果 ResMessage resMessage=tcpConnnection.SendReceiveObject<ResMessage>("AddRoomConfig","ResRoomConfig",5000, cla***oomConfig); if (resMessage.Message == "操作成功") { GetCurrentRoomConfig(); MessageBox.Show("添加設置完成"); } else { MessageBox.Show("出現錯誤,錯誤為" + resMessage.Message); }
服務器端處理代碼如下:
構造函數中聲明:
//學校管理員添加教室的相關設置 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
數據庫類:
DBCla***oomConfig
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。