/// <summary> /// 填充实体信息 /// </summary> protected override void FillModelInfo() { XVUsersInfo info = this.m_CurrentModel as XVUsersInfo; if (this.m_EditStatus == XEditStatus.AddNew) { info.RID = this.GetNewId(); info.ID = info.RID; } info.UserType = this.txtUserType.ValueMember; info.UserTypeName = this.txtUserType.DisplayMember; info.UserName = this.txtUserName.Text; info.RealName = this.txtRealName.Text; info.NameNum = XHelper.GetInt(this.nebNameNum.Value); if (this.m_EditStatus == XEditStatus.AddNew) { if (this.m_EditStatus == XEditStatus.AddNew) { XEncodeAndDecodeBase encodeTool = XEncodeAndDecodeContext.GetEncodeAndDecodeTool(EncodeType.Md5); info.PassWord = encodeTool.Encode(this.txtPassWord.Text); } } info.UserState = this.txtUserState.Text; info.IsAdmin = this.chkIsAdmin.Checked; info.IsUsed = this.chkIsUsed.Checked; info.AuditTel = this.txtAuditTel.Text; info.IsDownPower = this.chkIsDownPower.Checked; info.OrderIndex = XHelper.GetInt(this.nebOrderIndex.Value); info.Remark = this.txtRemark.Text; base.FillModelInfo(); }
/// <summary> /// 设置修改时的默认值 /// </summary> protected override void SetDefaultValue() { XVUsersInfo info = this.m_CurrentModel as XVUsersInfo; if (info.UserType != string.Empty) { this.txtUserType.Text = info.UserTypeName; this.txtUserType.ValueMember = info.UserType; this.txtUserType.DisplayMember = info.UserTypeName; } this.txtUserName.Text = info.UserName; this.txtRealName.Text = info.RealName; this.nebNameNum.Value = info.NameNum; this.txtPassWord.Text = info.PassWord; this.txtRepass.Text = info.PassWord; this.txtUserState.Text = info.UserState; this.chkIsAdmin.Checked = info.IsAdmin; this.chkIsUsed.Checked = info.IsUsed; this.txtAuditTel.Text = info.AuditTel; this.chkIsDownPower.Checked = info.IsDownPower; this.nebOrderIndex.Value = info.OrderIndex; this.txtRemark.Text = info.Remark; this.m_OldUserName = this.txtUserName.Text.Trim(); this.m_OldRealName = this.txtRealName.Text.Trim(); this.txtPassWord.Enabled = false; this.txtRepass.Enabled = false; }
/// <summary> /// 获取登录信息 /// </summary> /// <returns></returns> private XVUsersInfo GetLoginUsersInfo() { XVUsersInfo usersInfo = null; XUsersBusiness usersBusiness = new XUsersBusiness(); string where = " and UserName='******' and Password='******'"; XEncodeAndDecodeBase tool = XEncodeAndDecodeContext.GetEncodeAndDecodeTool(EncodeType.Md5); string password = tool.Encode(this.txtPassWord.Text.Trim()); string userId = this.txtUserName.Text.Trim(); where = string.Format(where, userId, password); IList <XModelBase> models = usersBusiness.QueryViewByWhere(where); if (models.Count > 0) { usersInfo = models[0] as XVUsersInfo; return(usersInfo); } return(usersInfo); }
protected override void FillRowViewInfos(Model.XModelBase model, System.Data.DataRow modelRow) { XVUsersInfo info = model as XVUsersInfo; info.UserTypeName = XHelper.GetString(modelRow["UserTypeName"]); }