设置预约规则的客户端代码:
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进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。