示例#1
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(!PageValidate.IsNumber(txtapplyer_ID.Text))
            {
                strErr+="申请人ID格式错误!\\n";
            }
            if(!PageValidate.IsDateTime(txtapply_time.Text))
            {
                strErr+="申请时间格式错误!\\n";
            }
            if(this.txtapply_state.Text.Trim().Length==0)
            {
                strErr+="匹配状态不能为空!\\n";
            }
            if(this.txtapply_msg.Text.Trim().Length==0)
            {
                strErr+="申请留言不能为空!\\n";
            }

            if(strErr!="")
            {
                MessageBox.Show(this,strErr);
                return;
            }
            int travleapply_ID=int.Parse(this.lbltravleapply_ID.Text);
            int travle_ID=int.Parse(this.lbltravle_ID.Text);
            int applyer_ID=int.Parse(this.txtapplyer_ID.Text);
            DateTime apply_time=DateTime.Parse(this.txtapply_time.Text);
            string apply_state=this.txtapply_state.Text;
            string apply_msg=this.txtapply_msg.Text;

            la.Model.travleapply model=new la.Model.travleapply();
            model.travleapply_ID=travleapply_ID;
            model.travle_ID=travle_ID;
            model.applyer_ID=applyer_ID;
            model.apply_time=apply_time;
            model.apply_state=apply_state;
            model.apply_msg=apply_msg;

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