Example #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(txtintime.Text))
            {
                strErr += "intime格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string   gid    = this.txtgid.Text;
            string   imei   = this.txtimei.Text;
            DateTime intime = DateTime.Parse(this.txtintime.Text);

            ManagePhones.Model.in_warehouse model = new ManagePhones.Model.in_warehouse();
            model.gid    = gid;
            model.imei   = imei;
            model.intime = intime;

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