Example #1
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtGUID.Text.Trim().Length == 0)
            {
                strErr += "GUID不能为空!\\n";
            }
            if (this.txtUserName.Text.Trim().Length == 0)
            {
                strErr += "UserName不能为空!\\n";
            }
            if (this.txtUserAccount.Text.Trim().Length == 0)
            {
                strErr += "UserAccount不能为空!\\n";
            }
            if (this.txtUserPassWord.Text.Trim().Length == 0)
            {
                strErr += "UserPassWord不能为空!\\n";
            }
            if (this.txtUserMail.Text.Trim().Length == 0)
            {
                strErr += "UserMail不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int    ID           = int.Parse(this.lblID.Text);
            string GUID         = this.txtGUID.Text;
            string UserName     = this.txtUserName.Text;
            string UserAccount  = this.txtUserAccount.Text;
            string UserPassWord = this.txtUserPassWord.Text;
            string UserMail     = this.txtUserMail.Text;


            Maticsoft.Model.User model = new Maticsoft.Model.User();
            model.ID           = ID;
            model.GUID         = GUID;
            model.UserName     = UserName;
            model.UserAccount  = UserAccount;
            model.UserPassWord = UserPassWord;
            model.UserMail     = UserMail;

            Maticsoft.BLL.User bll = new Maticsoft.BLL.User();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
Example #2
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtUserName.Text.Trim().Length == 0)
            {
                strErr += "UserName不能为空!\\n";
            }
            if (this.txtShowName.Text.Trim().Length == 0)
            {
                strErr += "ShowName不能为空!\\n";
            }
            if (this.txtPassWord.Text.Trim().Length == 0)
            {
                strErr += "PassWord不能为空!\\n";
            }
            if (this.txtPhoneNum.Text.Trim().Length == 0)
            {
                strErr += "PhoneNum不能为空!\\n";
            }
            if (this.txtEmail.Text.Trim().Length == 0)
            {
                strErr += "Email不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtAge.Text))
            {
                strErr += "Age格式错误!\\n";
            }
            if (this.txtImgUrl.Text.Trim().Length == 0)
            {
                strErr += "ImgUrl不能为空!\\n";
            }
            if (!PageValidate.IsDateTime(txtCreateTime.Text))
            {
                strErr += "CreateTime格式错误!\\n";
            }
            if (!PageValidate.IsDateTime(txtUpdateTime.Text))
            {
                strErr += "UpdateTime格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int      Id         = int.Parse(this.lblId.Text);
            string   UserName   = this.txtUserName.Text;
            string   ShowName   = this.txtShowName.Text;
            string   PassWord   = this.txtPassWord.Text;
            bool     Sex        = this.chkSex.Checked;
            string   PhoneNum   = this.txtPhoneNum.Text;
            string   Email      = this.txtEmail.Text;
            int      Age        = int.Parse(this.txtAge.Text);
            string   ImgUrl     = this.txtImgUrl.Text;
            bool     IsEnable   = this.chkIsEnable.Checked;
            DateTime CreateTime = DateTime.Parse(this.txtCreateTime.Text);
            DateTime UpdateTime = DateTime.Parse(this.txtUpdateTime.Text);


            Maticsoft.Model.User model = new Maticsoft.Model.User();
            model.Id         = Id;
            model.UserName   = UserName;
            model.ShowName   = ShowName;
            model.PassWord   = PassWord;
            model.Sex        = Sex;
            model.PhoneNum   = PhoneNum;
            model.Email      = Email;
            model.Age        = Age;
            model.ImgUrl     = ImgUrl;
            model.IsEnable   = IsEnable;
            model.CreateTime = CreateTime;
            model.UpdateTime = UpdateTime;

            Maticsoft.BLL.User bll = new Maticsoft.BLL.User();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
Example #3
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(this.txtUserName.Text.Trim().Length==0)
            {
                strErr+="UserName不能为空!\\n";
            }
            if(this.txtShowName.Text.Trim().Length==0)
            {
                strErr+="ShowName不能为空!\\n";
            }
            if(this.txtPassWord.Text.Trim().Length==0)
            {
                strErr+="PassWord不能为空!\\n";
            }
            if(this.txtPhoneNum.Text.Trim().Length==0)
            {
                strErr+="PhoneNum不能为空!\\n";
            }
            if(this.txtEmail.Text.Trim().Length==0)
            {
                strErr+="Email不能为空!\\n";
            }
            if(!PageValidate.IsNumber(txtAge.Text))
            {
                strErr+="Age格式错误!\\n";
            }
            if(this.txtImgUrl.Text.Trim().Length==0)
            {
                strErr+="ImgUrl不能为空!\\n";
            }
            if(!PageValidate.IsDateTime(txtCreateTime.Text))
            {
                strErr+="CreateTime格式错误!\\n";
            }
            if(!PageValidate.IsDateTime(txtUpdateTime.Text))
            {
                strErr+="UpdateTime格式错误!\\n";
            }

            if(strErr!="")
            {
                MessageBox.Show(this,strErr);
                return;
            }
            int Id=int.Parse(this.lblId.Text);
            string UserName=this.txtUserName.Text;
            string ShowName=this.txtShowName.Text;
            string PassWord=this.txtPassWord.Text;
            bool Sex=this.chkSex.Checked;
            string PhoneNum=this.txtPhoneNum.Text;
            string Email=this.txtEmail.Text;
            int Age=int.Parse(this.txtAge.Text);
            string ImgUrl=this.txtImgUrl.Text;
            bool IsEnable=this.chkIsEnable.Checked;
            DateTime CreateTime=DateTime.Parse(this.txtCreateTime.Text);
            DateTime UpdateTime=DateTime.Parse(this.txtUpdateTime.Text);

            Maticsoft.Model.User model=new Maticsoft.Model.User();
            model.Id=Id;
            model.UserName=UserName;
            model.ShowName=ShowName;
            model.PassWord=PassWord;
            model.Sex=Sex;
            model.PhoneNum=PhoneNum;
            model.Email=Email;
            model.Age=Age;
            model.ImgUrl=ImgUrl;
            model.IsEnable=IsEnable;
            model.CreateTime=CreateTime;
            model.UpdateTime=UpdateTime;

            Maticsoft.BLL.User bll=new Maticsoft.BLL.User();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","list.aspx");
        }