예제 #1
0
        /// <summary>
        ///新增仓库货位
        /// </summary>
        public void addWarehouses()
        {
            bool addWarehouses = true;

            Cao.WMS.BLL.caowms.Warehouses bllWarehouses = new Cao.WMS.BLL.caowms.Warehouses();
            addWarehouses = bllWarehouses.Exists(this.txtRWID.Text);
            if (!addWarehouses)
            {
                Cao.WMS.Model.caowms.Warehouses modelWarehouses = new Cao.WMS.Model.caowms.Warehouses();
                modelWarehouses.WID       = this.txtRWID.Text;
                modelWarehouses.WName     = "";
                modelWarehouses.WArea     = 0;
                modelWarehouses.WAddress  = "";
                modelWarehouses.WDescribe = "入库新增货位";
                bllWarehouses.Add(modelWarehouses);
            }
        }
예제 #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            //if(!PageValidate.IsNumber(txtWID.Text))
            //{
            //    strErr+="仓库编号格式错误!\\n";
            //}
            if (this.txtWName.Text.Trim().Length == 0)
            {
                strErr += "仓库名称不能为空!\\n";
            }
            if (!PageValidate.IsDecimal(txtWArea.Text))
            {
                strErr += "仓库容积格式错误!\\n";
            }
            if (this.txtWAddress.Text.Trim().Length == 0)
            {
                strErr += "仓库地址不能为空!\\n";
            }
            if (this.txtWDescribe.Text.Trim().Length == 0)
            {
                strErr += "简单描述不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }

            bool addWarehouses = true;

            Cao.WMS.BLL.caowms.Warehouses bllWarehouses = new Cao.WMS.BLL.caowms.Warehouses();
            addWarehouses = bllWarehouses.Exists(this.txtWID.Text.Trim());
            if (!addWarehouses)
            {
                strErr += "编码重复\\n";
                MessageBox.Show(this, strErr);
                return;
            }
            bool addWarehousesWName = true;

            addWarehousesWName = bllWarehouses.ExistsWName(this.txtWName.Text.Trim());
            if (!addWarehouses)
            {
                strErr += "仓库名称重复\\n";
                MessageBox.Show(this, strErr);
                return;
            }


            //int WID=int.Parse(this.txtWID.Text);
            string  WID       = this.txtWID.Text;
            string  WName     = this.txtWName.Text;
            decimal WArea     = decimal.Parse(this.txtWArea.Text);
            string  WAddress  = this.txtWAddress.Text;
            string  WDescribe = this.txtWDescribe.Text;

            Cao.WMS.Model.caowms.Warehouses model = new Cao.WMS.Model.caowms.Warehouses();
            model.WID       = WID;
            model.WName     = WName;
            model.WArea     = WArea;
            model.WAddress  = WAddress;
            model.WDescribe = WDescribe;

            Cao.WMS.BLL.caowms.Warehouses bll = new Cao.WMS.BLL.caowms.Warehouses();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }