Exemplo n.º 1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(this.txtEmployeeName.Text.Trim().Length==0)
            {
                strErr+="EmployeeName不能为空!\\n";
            }
            if(this.txtEmployeeNo.Text.Trim().Length==0)
            {
                strErr+="EmployeeNo不能为空!\\n";
            }
            if(!PageValidate.IsNumber(txtEmployeeID.Text))
            {
                strErr+="EmployeeID格式错误!\\n";
            }

            if(strErr!="")
            {
                MessageBox.Show(this,strErr);
                return;
            }
            string EmployeeName=this.txtEmployeeName.Text;
            string EmployeeNo=this.txtEmployeeNo.Text;
            int EmployeeID=int.Parse(this.txtEmployeeID.Text);

            RuRo.Model.EmployeeInfo model=new RuRo.Model.EmployeeInfo();
            model.EmployeeName=EmployeeName;
            model.EmployeeNo=EmployeeNo;
            model.EmployeeID=EmployeeID;

            RuRo.BLL.EmployeeInfo bll=new RuRo.BLL.EmployeeInfo();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","add.aspx");
        }
Exemplo n.º 2
0
 private void ShowInfo(int id)
 {
     RuRo.BLL.EmployeeInfo bll=new RuRo.BLL.EmployeeInfo();
     RuRo.Model.EmployeeInfo model=bll.GetModel(id);
     this.lblid.Text=model.id.ToString();
     this.lblEmployeeName.Text=model.EmployeeName;
     this.lblEmployeeNo.Text=model.EmployeeNo;
     this.lblEmployeeID.Text=model.EmployeeID.ToString();
 }