示例#1
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtgid.Text.Trim().Length == 0)
            {
                strErr += "gid不能为空!\\n";
            }
            if (this.txtimei.Text.Trim().Length == 0)
            {
                strErr += "imei不能为空!\\n";
            }
            if (!PageValidate.IsDateTime(txtouttime.Text))
            {
                strErr += "outtime格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            long     id      = long.Parse(this.lblid.Text);
            string   gid     = this.txtgid.Text;
            string   imei    = this.txtimei.Text;
            DateTime outtime = DateTime.Parse(this.txtouttime.Text);


            ManagePhones.Model.out_warehouse model = new ManagePhones.Model.out_warehouse();
            model.id      = id;
            model.gid     = gid;
            model.imei    = imei;
            model.outtime = outtime;

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