/// <summary> /// 修改快开厅员工 /// <param name="tbStaff">快开厅员工</param> /// </summary> public void Edit(TBStaff tbStaff, TSAgentUser tsAgentUser) { TSAgentUserDAO tsAgentUserDAO = new TSAgentUserDAO(); tsAgentUser.userId = tbStaff.staffId; //判断是否帐号重复 List <TSAgentUser> list = tsAgentUserDAO.GetList("userCode", tsAgentUser.userCode); if (list.Count > 0 && !tsAgentUser.userId.Equals(list[0].userId)) { Message.error(context, "帐号重复请重新输入!"); return; } try { tbStaff.status = tbStaff.status == null ? "0" : "1"; tbStaffDAO.EditTrans(tbStaff, tsAgentUser); Message.success(context, "快开厅员工修改成功"); loginSession.Log(tbStaff.staffName + "快开厅员工修改成功"); } catch (Exception e) { Message.error(context, "快开厅员工修改失败"); loginSession.Log(e.Message); } }
/// <summary> /// 重置员工密码 /// </summary> /// <param name="staffId"></param> /// <param name="roleType"></param> public void PawReset(string staffId, string roleType) { TSAgentUser tsAgentUser = new TSAgentUser(); string strSQL = "select * from tsAgentUser where userId=" + staffId + " and roleId!=001"; TSAgentUserDAO tsAgentUserDao = new TSAgentUserDAO(); Param param = new Param(); tsAgentUser = tsAgentUserDao.GetList(strSQL, param)[0]; try { string userPwd = Encrypt.ConvertPwd(tsAgentUser.userId, tsAgentUser.userCode); tsAgentUserDao.ChangePwd(tsAgentUser.userId, userPwd, roleType); Message.success(context, "员工密码重置成功"); loginSession.Log(staffId + "员工密码重置成功"); } catch (Exception e) { Message.error(context, "员工密码重置失败 "); loginSession.Log(e.Message); } }