示例#1
0
        protected 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;
            }
            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.gid     = gid;
            model.imei    = imei;
            model.outtime = outtime;

            ManagePhones.BLL.out_warehouse bll = new ManagePhones.BLL.out_warehouse();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }
示例#2
0
 private void ShowInfo(long id)
 {
     ManagePhones.BLL.out_warehouse   bll   = new ManagePhones.BLL.out_warehouse();
     ManagePhones.Model.out_warehouse model = bll.GetModel(id);
     this.lblid.Text      = model.id.ToString();
     this.txtgid.Text     = model.gid;
     this.txtimei.Text    = model.imei;
     this.txtouttime.Text = model.outtime.ToString();
 }