Exemplo n.º 1
0
 private void ShowInfo(int Id)
 {
     Eva.BLL.Authority bll=new Eva.BLL.Authority();
     Eva.Model.Authority model=bll.GetModel(Id);
     this.lblId.Text=model.Id.ToString();
     this.txtName.Text=model.Name;
 }
Exemplo n.º 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(this.txtName.Text.Trim().Length==0)
            {
                strErr+="Name不能为空!\\n";
            }

            if(strErr!="")
            {
                MessageBox.Show(this,strErr);
                return;
            }
            string Name=this.txtName.Text;

            Eva.Model.Authority model=new Eva.Model.Authority();
            model.Name=Name;

            Eva.BLL.Authority bll=new Eva.BLL.Authority();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","add.aspx");
        }
Exemplo n.º 3
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(this.txtName.Text.Trim().Length==0)
            {
                strErr+="Name不能为空!\\n";
            }

            if(strErr!="")
            {
                MessageBox.Show(this,strErr);
                return;
            }
            int Id=int.Parse(this.lblId.Text);
            string Name=this.txtName.Text;

            Eva.Model.Authority model=new Eva.Model.Authority();
            model.Id=Id;
            model.Name=Name;

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