录播教室预约系统(十)-客户端部门管理员重置本单位其他人员密码
,
客户端代码:
<>之前,//发出的数据类型为int类型,,ItemID为用户对应的ID ,,,,,,,,,,,ResMessage ResMessage =, tcpConnnection.SendReceiveObject
服务器端代码:
<>之前,,,,,,,,,,,,//客户端管理员修改用户的密码 ,,,,,,,,,,,NetworkComms.AppendGlobalIncomingPacketHandler处理方法:
<>之前,,,,,,,,//根据管理员提供的用户ID修改相应用户的密码 ,,,,,,,private void HandleResetPassword (PacketHeader 头,Connection 连接,,int , itemID) ,,,,,,,{ ,,,,,,,,,Users 使用=,DoUsers.GetUsers (itemID); ,,,,,,,,,//把密码恢复成123456 ,,,,,,,,,theUser.Password =,“123456”; ,,,,,,,,,DoUsers.Save(使用); ,,,,,,,,,ResMessage theMessage =, new ResMessage (); ,,,,,,,,,theMessage.Message =,“操作成功”; ,,,,,,,,,connection.SendObject (“ResResetPsw”,对方); ,,,,,,,}
操作类:
,
用户类:
[ProtoContract],,, public class 用户 ,,,{,,,,,,,# region Constructors ,,,,,,, public 用户() ,,,,,,,{,},,,,,,,,# endregion ,,,,,,,# region Private Properties ,,,,,,, Private int id =, 1,,,,,,,,, Private string userID =, string.Empty;,,,,,,,, Private string name =, string.Empty;,,,,,,,, Private string password =, string.Empty;,,,,,,,, Private string declaring =, string.Empty;,,,,,,,, Private int status =, 1,,,,,,,,, Private bool isMale =,假的,,,,,,,,,Private int userLevel =, 1,,,,,,,,, Private bool enabled =,假的,,,,,,,,,Private DateTime registerTime =, DateTime.UtcNow;,,,,,,,, Private DateTime lastLoginTime =, DateTime.UtcNow;,,,,,,,, Private int depID =, 1,,,,,,,,, Private string department =, string.Empty;,,,,,,,, # endregion ,,,,,,,# region Public 属性 null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null录播教室预约系统(十)-客户端部门管理员重置本单位其他人员密码