예제 #1
0
 protected void ImageLogin_Click(object sender, ImageClickEventArgs e)
 {
     if (string.IsNullOrEmpty(this.txtUserName.Text.Trim()))
     {
         this.lblErrorInfo.Text = "用户名不能为空!";
         return;
     }
     if (string.IsNullOrEmpty(this.txtUserPwd.Text.Trim()))
     {
         this.lblErrorInfo.Text = "用户密码不能为空!";
         return;
     }
     if (string.IsNullOrEmpty(this.txtValidCode.Text.Trim()))
     {
         this.lblErrorInfo.Text = "验证码不能为空!";
         return;
     }
     PersonController pControl = new PersonController();
     string userName = this.txtUserName.Text.Trim();
     string passWord = WhfEncryption.DESEnCrypt(this.txtUserPwd.Text.Trim());
     PersonEntity pe = pControl.GetPersonInfo(userName, passWord);
     if (pe==null)
     {
         this.lblErrorInfo.Text = "用户名或密码不正确,请重新输入!";
         return;
     }
     if (Session["ValidationCode"] != null && Session["ValidationCode"].ToString() != this.txtValidCode.Text.Trim())
     {
         this.lblErrorInfo.Text = "验证码不正确,请重新输入!";
         return;
     }
     base.PersonEntity = pe;
     Response.Redirect("Portal/index.html");
 }
예제 #2
0
 private void BindGrid(int pageIndex)
 {
     PersonController controller = new PersonController();
     int rowCount = 0;
     DataSet dst = controller.QueryPersons(pageIndex, 10, out rowCount,this.txtEmpNO.Text.Trim(),this.txtEmpName.Text.Trim(),drpPersonType.SelectedValue);
     this.Navigator.TotalCount = rowCount;
     this.gvPerson.DataSource = dst.Tables[0];
     this.gvPerson.DataBind();
 }
예제 #3
0
 private void BindControls()
 {
     PersonEntity person = new PersonController().GetPersonInfo(this.hdfPersonID.Value);
     if (person != null)
     {
         txtEmail.Text = person.PERSONEMAIL;
         txtMobilPhone.Text = person.PERSONMOBILEPHONE;
         txtOfficePhone.Text = person.PERSONOFFICEPHONE;
         txtPersonAccount.Text = person.PERSONACCOUNT;
         txtPersonMemo.Text = person.PERSONMEMO;
         txtPersonName.Text = person.PERSONNAME;
         drpPersonSex.SelectedValue = person.PERSONSEX.ToString();
         drpPersonStatus.SelectedValue = person.PERSONSTATUS.ToString();
         drpPersonType.SelectedValue = person.PERSONTYPE.ToString();
     }
 }
예제 #4
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (CheckSave())
     {
         PersonEntity per = new PersonEntity();
         per.OID = hdfPersonID.Value;
         per.CUSER = AppCenter.CurrentPersonAccount;
         per.MUSER = AppCenter.CurrentPersonAccount;
         per.PERSONACCOUNT = txtPersonAccount.Text.Trim();
         per.PERSONCODE = txtPersonAccount.Text.Trim();
         per.PERSONDESC = txtPersonMemo.Text.Trim();
         per.PERSONEMAIL = txtEmail.Text.Trim();
         per.PERSONMEMO = txtPersonMemo.Text.Trim();
         per.PERSONMOBILEPHONE = txtMobilPhone.Text.Trim();
         per.PERSONNAME = txtPersonName.Text.Trim();
         per.PERSONOFFICEPHONE = txtOfficePhone.Text.Trim();
         per.PERSONSEX = Convert.ToInt32(drpPersonSex.SelectedValue);
         per.PERSONSTATUS = Convert.ToInt32(drpPersonStatus.SelectedValue);
         per.PERSONTYPE = Convert.ToInt32(drpPersonType.SelectedValue);
         bool retValue = true;
         if (string.IsNullOrEmpty(per.OID))
         {
             per.OID = Guid.NewGuid().ToString();
             retValue = new PersonController().InsertPerson(per);
         }
         else
         {
             retValue = new PersonController().UpdatePersonAdmin(per);
         }
         if (retValue)
         {
             hdfFlag.Value = "1";
             base.ShowMessage(CommonMessage.SaveSuccess);
         }
         else
         {
             base.ShowMessage(CommonMessage.SaveFailed);
         }
     }
 }