Exemplo n.º 1
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(this.txtName.Text.Trim().Length==0)
            {
                strErr+="Name不能为空!\\n";
            }
            if(!PageValidate.IsDecimal(txtValue.Text))
            {
                strErr+="Value格式错误!\\n";
            }

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

            Eva.Model.Item model=new Eva.Model.Item();
            model.Id=Id;
            model.Name=Name;
            model.Value=Value;

            Eva.BLL.Item bll=new Eva.BLL.Item();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","list.aspx");
        }
Exemplo n.º 2
0
 private void ShowInfo(int Id)
 {
     Eva.BLL.Item bll=new Eva.BLL.Item();
     Eva.Model.Item model=bll.GetModel(Id);
     this.lblId.Text=model.Id.ToString();
     this.lblName.Text=model.Name;
     this.lblValue.Text=model.Value.ToString();
 }
Exemplo n.º 3
0
 public static string GetItemName(int itemId)
 {
     var bll = new Eva.BLL.Item();
     return bll.GetModel(itemId).Name;
 }