コード例 #1
0
ファイル: frmUsersEdit.cs プロジェクト: TIWTESOFT/MMIS
        /// <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();
        }
コード例 #2
0
        protected override bool SaveAdd()
        {
            XEncodeAndDecodeBase encodeTool = XEncodeAndDecodeContext.GetEncodeAndDecodeTool(EncodeType.Md5);
            string password = encodeTool.Encode(this.txtPassword.Text);

            XUsersBusiness business = this.m_Business as XUsersBusiness;

            return(business.UpdatePassword(this.UserId, password));
        }
コード例 #3
0
ファイル: frmLogin.cs プロジェクト: TIWTESOFT/MMIS
        /// <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);
        }