Пример #1
0
 private void ShowInfo()
 {
     Bsam.Core.Model.Models.BLL.Sfc_Production   bll   = new Bsam.Core.Model.Models.BLL.Sfc_Production();
     Bsam.Core.Model.Models.Model.Sfc_Production model = bll.GetModel();
     this.lblId.Text               = model.Id.ToString();
     this.lblProductCode.Text      = model.ProductCode;
     this.lblProductName.Text      = model.ProductName;
     this.lblProductDesc.Text      = model.ProductDesc;
     this.lblModelType.Text        = model.ModelType;
     this.lblDateTimeCreated.Text  = model.DateTimeCreated.ToString();
     this.lblUserCreator.Text      = model.UserCreator;
     this.lblDateTimeModified.Text = model.DateTimeModified.ToString();
     this.lblUserModified.Text     = model.UserModified;
     this.lblState.Text            = model.State?"是":"否";
     this.lblOrgId.Text            = model.OrgId;
 }
Пример #2
0
 private void ShowInfo()
 {
     Bsam.Core.Model.Models.BLL.Sfc_Production   bll   = new Bsam.Core.Model.Models.BLL.Sfc_Production();
     Bsam.Core.Model.Models.Model.Sfc_Production model = bll.GetModel();
     this.txtId.Text               = model.Id.ToString();
     this.txtProductCode.Text      = model.ProductCode;
     this.txtProductName.Text      = model.ProductName;
     this.txtProductDesc.Text      = model.ProductDesc;
     this.txtModelType.Text        = model.ModelType;
     this.txtDateTimeCreated.Text  = model.DateTimeCreated.ToString();
     this.txtUserCreator.Text      = model.UserCreator;
     this.txtDateTimeModified.Text = model.DateTimeModified.ToString();
     this.txtUserModified.Text     = model.UserModified;
     this.chkState.Checked         = model.State;
     this.txtOrgId.Text            = model.OrgId;
 }
Пример #3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsNumber(txtId.Text))
            {
                strErr += "Id格式错误!\\n";
            }
            if (this.txtProductCode.Text.Trim().Length == 0)
            {
                strErr += "ProductCode不能为空!\\n";
            }
            if (this.txtProductName.Text.Trim().Length == 0)
            {
                strErr += "ProductName不能为空!\\n";
            }
            if (this.txtProductDesc.Text.Trim().Length == 0)
            {
                strErr += "ProductDesc不能为空!\\n";
            }
            if (this.txtModelType.Text.Trim().Length == 0)
            {
                strErr += "ModelType不能为空!\\n";
            }
            if (!PageValidate.IsDateTime(txtDateTimeCreated.Text))
            {
                strErr += "DateTimeCreated格式错误!\\n";
            }
            if (this.txtUserCreator.Text.Trim().Length == 0)
            {
                strErr += "UserCreator不能为空!\\n";
            }
            if (!PageValidate.IsDateTime(txtDateTimeModified.Text))
            {
                strErr += "DateTimeModified格式错误!\\n";
            }
            if (this.txtUserModified.Text.Trim().Length == 0)
            {
                strErr += "UserModified不能为空!\\n";
            }
            if (this.txtOrgId.Text.Trim().Length == 0)
            {
                strErr += "OrgId不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int      Id               = int.Parse(this.txtId.Text);
            string   ProductCode      = this.txtProductCode.Text;
            string   ProductName      = this.txtProductName.Text;
            string   ProductDesc      = this.txtProductDesc.Text;
            string   ModelType        = this.txtModelType.Text;
            DateTime DateTimeCreated  = DateTime.Parse(this.txtDateTimeCreated.Text);
            string   UserCreator      = this.txtUserCreator.Text;
            DateTime DateTimeModified = DateTime.Parse(this.txtDateTimeModified.Text);
            string   UserModified     = this.txtUserModified.Text;
            bool     State            = this.chkState.Checked;
            string   OrgId            = this.txtOrgId.Text;

            Bsam.Core.Model.Models.Model.Sfc_Production model = new Bsam.Core.Model.Models.Model.Sfc_Production();
            model.Id               = Id;
            model.ProductCode      = ProductCode;
            model.ProductName      = ProductName;
            model.ProductDesc      = ProductDesc;
            model.ModelType        = ModelType;
            model.DateTimeCreated  = DateTimeCreated;
            model.UserCreator      = UserCreator;
            model.DateTimeModified = DateTimeModified;
            model.UserModified     = UserModified;
            model.State            = State;
            model.OrgId            = OrgId;

            Bsam.Core.Model.Models.BLL.Sfc_Production bll = new Bsam.Core.Model.Models.BLL.Sfc_Production();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }