private void txtSlipTypeCode_Leave(object sender, EventArgs e)
        {
            string slipTypeCode = txtSlipTypeCode.Text.Trim();

            if (slipTypeCode != "")
            {
                BaseMaster baseMaster = bCommon.GetBaseMaster("SLIP_TYPE", slipTypeCode, "");
                if (baseMaster != null)
                {
                    txtSlipTypeCode.Text = baseMaster.Code;
                    txtSlipTypeName.Text = baseMaster.Name;
                }
                else
                {
                    MessageBox.Show("产线不存在.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtSlipTypeCode.Text = "";
                    txtSlipTypeName.Text = "";
                    txtCompositionProductsCode.Focus();
                }
            }
            else
            {
                txtSlipTypeName.Text = "";
            }
        }
示例#2
0
 private void FrmCustomerReportedDialog_Load(object sender, EventArgs e)
 {
     if (_currentCustomerReportedTable != null)
     {
         txtCustomer.Text     = _currentCustomerReportedTable.CUSTOMER_CODE;
         txtCustomerName.Text = bCommon.GetBaseMaster("CUSTOMER", _currentCustomerReportedTable.CUSTOMER_CODE).Name;
         txtReported.Text     = _currentCustomerReportedTable.CUSTOMER_REPORTED_CODE;
         txtReportedName.Text = bCommon.GetBaseMaster("CUSTOMER", _currentCustomerReportedTable.CUSTOMER_REPORTED_CODE).Name;
         ReportedDate.Value   = _currentCustomerReportedTable.REPORTED_DATE;
         EffectiveDate.Value  = _currentCustomerReportedTable.EFFECTIVE_DATE;
     }
     if (_mode == CConstant.MODE_NEW)
     {
         this.Text = "新建";
     }
     else if (_mode == CConstant.MODE_MODIFY)
     {
         this.Text             = "编辑";
         txtCustomer.BackColor = Color.WhiteSmoke;
         txtReported.BackColor = Color.WhiteSmoke;
         txtCustomer.Enabled   = false;
         txtReported.Enabled   = false;
     }
     else if (_mode == CConstant.MODE_COPY)
     {
         this.Text            = "新建";
         txtCustomer.Text     = "";
         txtCustomerName.Text = "";
         txtReported.Text     = "";
         txtReportedName.Text = "";
     }
 }
示例#3
0
        private void txtCompositionProductsCode_Leave(object sender, EventArgs e)
        {
            string compositionCode = txtCompositionProductsCode.Text.Trim();

            if (compositionCode != "")
            {
                BaseMaster baseMaster = bCommon.GetBaseMaster("COMPOSITION_PRODUCTS", compositionCode, "");
                if (baseMaster != null)
                {
                    txtCompositionProductsCode.Text = baseMaster.Code;
                    txtCompositionProductsName.Text = baseMaster.Name;
                }
                else
                {
                    MessageBox.Show("主配件不存在.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtCompositionProductsCode.Text = "";
                    txtCompositionProductsName.Text = "";
                    txtCompositionProductsCode.Focus();
                }
            }
            else
            {
                txtCompositionProductsName.Text = "";
            }
        }
示例#4
0
        private void txtParentCode_Leave(object sender, EventArgs e)
        {
            string parent = txtParentCode.Text.Trim();

            if (!string.IsNullOrEmpty(parent))
            {
                BaseMaster baseMaster = bCommon.GetBaseMaster("PRODUCT_GROUP", parent);
                if (baseMaster != null)
                {
                    txtParentCode.Text = baseMaster.Code;
                    txtParentName.Text = baseMaster.Name;
                }
                else
                {
                    MessageBox.Show("上级商品种类不存在.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtParentCode.Text = "";
                    txtParentName.Text = "";
                    txtParentCode.Focus();
                }
            }
            else
            {
                txtParentName.Text = "";
            }
        }
示例#5
0
        private void txtSupplierCode_Leave(object sender, EventArgs e)
        {
            string supplier = txtSupplierCode.Text.Trim();

            if (!string.IsNullOrEmpty(supplier))
            {
                BaseMaster baseMaster = bCommon.GetBaseMaster("SUPPLIER", supplier);
                if (baseMaster != null)
                {
                    txtSupplierCode.Text = baseMaster.Code;
                    txtSupplierName.Text = baseMaster.Name;
                    txtProductCode.Focus();
                }
                else
                {
                    MessageBox.Show("供应商编号不存在,请重新输入!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtSupplierCode.Text = "";
                    txtSupplierName.Text = "";
                    txtSupplierCode.Focus();
                }
            }
            else
            {
                txtSupplierName.Text = "";
            }
        }
示例#6
0
        private void txtCustomerCode_Leave(object sender, EventArgs e)
        {
            string customer = txtCustomerCode.Text.Trim();

            if (!string.IsNullOrEmpty(customer))
            {
                BaseMaster baseMaster = bCommon.GetBaseMaster("CUSTOMER", customer);
                if (baseMaster != null)
                {
                    txtCustomerCode.Text = baseMaster.Code;
                    txtCustomerName.Text = baseMaster.Name;
                    txtProductCode.Focus();
                }
                else
                {
                    MessageBox.Show("客户编号不存在!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtCustomerCode.Text = "";
                    txtCustomerName.Text = "";
                    txtCustomerCode.Focus();
                }
            }
            else
            {
                txtCustomerName.Text = "";
            }
        }
示例#7
0
        private void txtProductCode_Leave(object sender, EventArgs e)
        {
            string product = txtProductCode.Text.Trim();

            if (!string.IsNullOrEmpty(product))
            {
                BaseMaster baseMaster = bCommon.GetBaseMaster("PRODUCT", product, " PRODUCT_FLAG = " + CConstant.PRODUCT_FLAG_SPEC);
                if (baseMaster != null)
                {
                    txtProductCode.Text = baseMaster.Code;
                    txtProductName.Text = baseMaster.Name;
                    txtPartsCode.Focus();
                }
                else
                {
                    MessageBox.Show("规格型号不存在。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtProductCode.Text = "";
                    txtProductName.Text = "";
                    txtProductCode.Focus();
                }
            }
            else
            {
                txtProductName.Text = "";
            }
        }
示例#8
0
        private void FrmMasterMachineDialog_Load(object sender, EventArgs e)
        {
            #region 维修地点初始化
            try
            {
                cboMaintenanceStations.ValueMember   = "CODE";
                cboMaintenanceStations.DisplayMember = "NAME";
                cboMaintenanceStations.DataSource    = CCacheData.Stations;
            }
            catch { }
            #endregion

            if (_currentMasterMachineTable != null)
            {
                txtMachineCode.Text  = _currentMasterMachineTable.MACHINE_CODE;
                txtMachineName.Text  = _currentMasterMachineTable.MACHINE_NAME;
                txtCustomerCode.Text = _currentMasterMachineTable.CUSTOMER_CODE;
                if (!string.IsNullOrEmpty(_currentMasterMachineTable.CUSTOMER_CODE))
                {
                    txtCustomerName.Text = bCommon.GetBaseMaster("CUSTOMER", _currentMasterMachineTable.CUSTOMER_CODE).Name;
                }
                txtProductCode.Text = _currentMasterMachineTable.PRODUCT_CODE;
                if (!string.IsNullOrEmpty(_currentMasterMachineTable.PRODUCT_CODE))
                {
                    txtProductName.Text = bCommon.GetBaseMaster("PRODUCT", _currentMasterMachineTable.PRODUCT_CODE).Name;
                }
                txtPurchaseOrderSlipNumber.Text      = _currentMasterMachineTable.PURCHASE_ORDER_SLIP_NUMBER;
                txtFSerialNumber.Text                = _currentMasterMachineTable.FANUC_SERIAL_NUMBER;
                txtFSlipNUmber.Text                  = _currentMasterMachineTable.FANUC_SLIP_NUMBER;
                txtReceiptDate.Value                 = _currentMasterMachineTable.RECEIPT_DATE;
                cboMaintenanceStations.SelectedValue = _currentMasterMachineTable.MAINTENANCE_STATIONS;
                txtPurchaseSlipNumber.Text           = _currentMasterMachineTable.PURCHASE_SLIP_NUMBER;
                if (_currentMasterMachineTable.SALE_DATE_TIME != null)
                {
                    txtSaleTime.Checked = true;
                    txtSaleTime.Value   = CConvert.ToDateTime(_currentMasterMachineTable.SALE_DATE_TIME);
                }
                else
                {
                    txtSaleTime.Checked = false;
                }
            }
            if (_mode == CConstant.MODE_NEW)
            {
                this.Text = "新建";
            }
            else if (_mode == CConstant.MODE_MODIFY)
            {
                this.Text = "编辑";
                txtMachineCode.BackColor = Color.WhiteSmoke;
                txtMachineCode.Enabled   = false;
            }
            else if (_mode == CConstant.MODE_COPY)
            {
                this.Text           = "新建";
                txtMachineCode.Text = "";
            }
        }
示例#9
0
 /// <summary>
 /// Load
 /// </summary>
 private void FrmUserDialog_Load(object sender, EventArgs e)
 {
     if (_currentUserTable != null)
     {
         txtCode.Text           = _currentUserTable.CODE.Substring(2);
         txtName.Text           = _currentUserTable.NAME;
         txtPassword.Text       = DESEncrypt.Decrypt(_currentUserTable.PASSWORD);
         txtRePassword.Text     = txtPassword.Text;
         txtPhone.Text          = _currentUserTable.PHONE;
         txtEmail.Text          = _currentUserTable.EMAIL;
         txtDepartmentCode.Text = _currentUserTable.DEPARTMENT_CODE;
         txtDepartmentName.Text = _currentUserTable.DEPARTMENT_NAME;
         txtCompanyCode.Text    = _currentUserTable.COMPANY_CODE;
         txtCompanyName.Text    = _currentUserTable.COMPANY_NAME;
         txtRolesCode.Text      = _currentUserTable.ROLES_CODE;
         txtRolesName.Text      = bCommon.GetBaseMaster("ROLES", _currentUserTable.ROLES_CODE).Name;
         if (_currentUserTable.OUT_COMMUNITY_DATE != null)
         {
             txtOutCommunityDate.Checked = true;
             txtOutCommunityDate.Text    = string.Format("{0:d}", _currentUserTable.OUT_COMMUNITY_DATE);
         }
         else
         {
             txtOutCommunityDate.Checked = false;
         }
         if (_currentUserTable.INT_COMMUNITY_DATE != null)
         {
             txtIntCommunityDate.Checked = true;
             txtIntCommunityDate.Text    = string.Format("{0:d}", _currentUserTable.INT_COMMUNITY_DATE);
         }
         else
         {
             txtIntCommunityDate.Checked = false;
         }
     }
     if (_mode == CConstant.MODE_NEW)
     {
         this.Text = "新建";
     }
     else if (_mode == CConstant.MODE_MODIFY)
     {
         this.Text              = "编辑";
         txtCode.BackColor      = Color.WhiteSmoke;
         txtCode.Enabled        = false;
         txtCompanyCode.Enabled = false;
         btnCompany.Enabled     = false;
     }
     else if (_mode == CConstant.MODE_COPY)
     {
         this.Text          = "新建";
         txtCode.Text       = "";
         txtPassword.Text   = "";
         txtRePassword.Text = "";
     }
 }
示例#10
0
        private void txtProductCode_Leave(object sender, EventArgs e)
        {
            //判断编号是否已存在
            string product = txtProductCode.Text.Trim();

            if (!string.IsNullOrEmpty(product))
            {
                BaseMaster baseMaster = bCommon.GetBaseMaster("PRODUCT", product);
                if (baseMaster != null)
                {
                    txtProductCode.Text = baseMaster.Code;
                    txtProductName.Text = baseMaster.Name;
                    txtWarehouseCode.Focus();
                }
                else
                {
                    MessageBox.Show("商品编号不存在,请重新输入!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtProductCode.Text = "";
                    txtProductName.Text = "";
                    txtProductCode.Focus();
                }
            }
            else
            {
                txtProductName.Text = "";
            }
        }
示例#11
0
 private void FrmDeliveryDialog_Load(object sender, EventArgs e)
 {
     if (_currentDeliveryTable != null)
     {
         txtCustomerCode.Text  = _currentDeliveryTable.CUSTOMER_CODE;
         txtCustomerName.Text  = bCommon.GetBaseMaster("CUSTOMER", _currentDeliveryTable.CUSTOMER_CODE).Name;
         txtDeliveryCode.Text  = _currentDeliveryTable.DELIVERY_CODE;
         txtAddressFirst.Text  = _currentDeliveryTable.ADDRESS_FIRST;
         txtAddressMiddle.Text = _currentDeliveryTable.ADDRESS_MIDDLE;
         txtAddressLast.Text   = _currentDeliveryTable.ADDRESS_LAST;
         txtZipCode.Text       = _currentDeliveryTable.ZIP_CODE;
         txtPhone.Text         = _currentDeliveryTable.PHONE_NUMBER;
         txtFax.Text           = _currentDeliveryTable.FAX_NUMBER;
         txtMobilNumber.Text   = _currentDeliveryTable.MOBIL_NUMBER;
         txtContactName.Text   = _currentDeliveryTable.CONTACT_NAME;
     }
     if (_mode == CConstant.MODE_NEW)
     {
         this.Text = "新建";
     }
     else if (_mode == CConstant.MODE_MODIFY)
     {
         this.Text = "编辑";
         txtCustomerCode.BackColor = Color.WhiteSmoke;
         txtCustomerCode.Enabled   = false;
         txtDeliveryCode.BackColor = Color.WhiteSmoke;
         txtDeliveryCode.Enabled   = false;
     }
     else if (_mode == CConstant.MODE_COPY)
     {
         this.Text            = "新建";
         txtCustomerCode.Text = "";
         txtDeliveryCode.Text = "";
     }
 }
示例#12
0
        private void txtWarehouseCode_Leave(object sender, EventArgs e)
        {
            BCommon bCommon       = new BCommon();
            string  warehouseCode = txtWarehouseCode.Text.Trim();

            if (warehouseCode != "")
            {
                BaseMaster baseMaster = bCommon.GetBaseMaster("WAREHOUSE", warehouseCode);
                if (baseMaster != null)
                {
                    txtWarehouseCode.Text = baseMaster.Code;
                    txtWarehouseName.Text = baseMaster.Name;
                }
                else
                {
                    MessageBox.Show("仓库编号不存在。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtWarehouseCode.Text = "";
                    txtWarehouseName.Text = "";
                    txtWarehouseCode.Focus();
                }
            }
            else
            {
                txtWarehouseName.Text = "";
            }
        }
示例#13
0
        private void txtSupplierCode_Leave(object sender, EventArgs e)
        {
            //判断编号是否已存在
            if (!string.IsNullOrEmpty(this.txtSupplierCode.Text.Trim()) && !string.IsNullOrEmpty(this.txtProductCode.Text.Trim()) && !string.IsNullOrEmpty(this.txtUnitCode.Text.Trim()))
            {
                BaseSupplierPriceTable SupplierPriceCode = new BaseSupplierPriceTable();
                SupplierPriceCode = bSupplierPrice.GetModel(txtSupplierCode.Text, txtProductCode.Text, txtUnitCode.Text, CConstant.EXCHANGE_RMB);
                if (SupplierPriceCode != null)
                {
                    txtSupplierCode.Text = "";
                    txtSupplierName.Text = "";
                    txtProductCode.Text  = "";
                    txtProductName.Text  = "";
                    txtUnitCode.Text     = "";
                    txtUnitName.Text     = "";
                    txtSupplierCode.Focus();
                    MessageBox.Show("供应商编号商品编号单位编号货币编号的组合\r\n已存在,请重新输入!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }

            string supplier = txtSupplierCode.Text.Trim();

            if (!string.IsNullOrEmpty(supplier))
            {
                BaseMaster baseMaster = bCommon.GetBaseMaster("SUPPLIER", supplier);
                if (baseMaster != null)
                {
                    txtSupplierCode.Text = baseMaster.Code;
                    txtSupplierName.Text = baseMaster.Name;
                    txtProductCode.Focus();
                }
                else
                {
                    MessageBox.Show("供应商编号不存在,请重新输入!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtSupplierCode.Text = "";
                    txtSupplierName.Text = "";
                    txtSupplierCode.Focus();
                }
            }
            else
            {
                txtSupplierName.Text = "";
            }
        }
示例#14
0
        private void txtCustomerCode_Leave(object sender, EventArgs e)
        {
            string customer = txtCustomerCode.Text.Trim();

            if (!string.IsNullOrEmpty(customer))
            {
                BaseMaster baseMaster = bCommon.GetBaseMaster("CUSTOMER", customer);
                if (baseMaster != null)
                {
                    txtCustomerCode.Text = baseMaster.Code;
                    txtCustomerName.Text = baseMaster.Name;
                    txtProductCode.Focus();
                }
                else
                {
                    MessageBox.Show("客户编号不存在!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtCustomerCode.Text = "";
                    txtCustomerName.Text = "";
                    txtCustomerCode.Focus();
                }
            }
            else
            {
                txtCustomerName.Text = "";
            }
            //判断编号是否已存在
            if (!string.IsNullOrEmpty(this.txtUnitCode.Text.Trim()) && !string.IsNullOrEmpty(this.txtCustomerCode.Text.Trim()) && !string.IsNullOrEmpty(this.txtProductCode.Text.Trim()))
            {
                BaseCustomerPriceTable CustomerPriceCode = new BaseCustomerPriceTable();
                CustomerPriceCode = bCustomerPrice.GetModel(txtCustomerCode.Text, txtProductCode.Text, txtUnitCode.Text);
                if (CustomerPriceCode != null)
                {
                    txtCustomerCode.Text = "";
                    txtProductCode.Text  = "";
                    txtUnitCode.Text     = "";
                    txtCustomerName.Text = "";
                    txtProductName.Text  = "";
                    txtUnitName.Text     = "";
                    txtCustomerCode.Focus();
                    MessageBox.Show("客户编号商品编号单位编号的组合已存在,请重新输入!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
示例#15
0
        private void txtProductCode_Leave(object sender, EventArgs e)
        {
            //判断编号是否已存在
            if (!string.IsNullOrEmpty(this.txtProductCode.Text.Trim()) && !string.IsNullOrEmpty(this.txtPartsCode.Text.Trim()))
            {
                BaseProductPartsTable ProductPartsCode = new BaseProductPartsTable();
                ProductPartsCode = bProductParts.GetModel(txtProductCode.Text, txtPartsCode.Text);
                if (ProductPartsCode != null)
                {
                    txtProductCode.Text = "";
                    txtProductName.Text = "";
                    txtPartsCode.Text   = "";
                    txtProductCode.Focus();
                    MessageBox.Show("商品编号和材料编号的组合已存在,请重新输入!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }

            string product = txtProductCode.Text.Trim();

            if (!string.IsNullOrEmpty(product))
            {
                BaseMaster baseMaster = bCommon.GetBaseMaster("PRODUCT", product);
                if (baseMaster != null)
                {
                    txtProductCode.Text = baseMaster.Code;
                    txtProductName.Text = baseMaster.Name;
                    txtPartsCode.Focus();
                }
                else
                {
                    MessageBox.Show("商品编号不存在,请重新输入!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtProductCode.Text = "";
                    txtProductName.Text = "";
                    txtProductCode.Focus();
                }
            }
            else
            {
                txtProductName.Text = "";
            }
        }
示例#16
0
        private void txtCurrencyCode_Leave(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtCurrencyCode.Text.Trim()))
            {
                BaseMaster baseMaster = bCommon.GetBaseMaster("CURRENCY", txtCurrencyCode.Text.Trim());
                if (baseMaster != null)
                {
                    txtCurrencyCode.Text = baseMaster.Code;
                    txtCurrencyName.Text = baseMaster.Name;
                }
                else
                {
                    MessageBox.Show("货币不存在.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtCurrencyCode.Text = "";
                    txtCurrencyName.Text = "";
                    txtCurrencyCode.Focus();
                }
            }
            else
            {
                txtCurrencyName.Text = "";
            }

            if (!string.IsNullOrEmpty(this.txtCurrencyCode.Text.Trim()) && ExchangeDate.Value != null)
            {
                BaseExchangeTable exchange = new BaseExchangeTable();
                exchange = bExchange.GetModel(CConvert.ToDateTime(ExchangeDate.Value.ToString("yyyy-MM")), txtCurrencyCode.Text);
                if (exchange != null)
                {
                    ExchangeDate.Value   = DateTime.Now;
                    txtCurrencyCode.Text = "";
                    ExchangeDate.Focus();
                    MessageBox.Show("当月此货币汇率已存在,请重新输入!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
示例#17
0
        private void GetSelectObject()
        {
            try
            {
                string code = dgvData.SelectedRows[0].Cells["CODE"].Value.ToString();
                if (code != "")
                {
                    if ("DELIVERY".Equals(_tableName) && string.IsNullOrEmpty(_strWhere))
                    {
                        string customercode = dgvData.SelectedRows[0].Cells["CUSTOMER_CODE"].Value.ToString();
                        _strWhere = "CUSTOMER_CODE = '" + customercode + "'";
                    }
                    _baseMasterTable = bCommon.GetBaseMaster(_tableName, code, _strWhere);
                }
            }
            catch (Exception ex) { }

            if (_baseMasterTable == null || _baseMasterTable.Code == null || "".Equals(_baseMasterTable.Code))
            {
                _baseMasterTable = null;
            }
        }
示例#18
0
        public void OperateInit(int currentPage)
        {
            BllProductBuildTable PBModel = bProductBuild.GetModel(_slip_number);

            txtWarehouse.Text        = PBModel.WAREHOUSE_CODE;
            txtWarehouseName.Text    = bCommon.GetBaseMaster("WAREHOUSE", PBModel.WAREHOUSE_CODE).Name;
            txtProduct.Text          = PBModel.PRODUCT_CODE;
            txtProductName.Text      = bCommon.GetBaseMaster("PRODUCT", PBModel.PRODUCT_CODE).Name;
            txtQuantity.Text         = CConvert.ToString(PBModel.QUANTITY);
            txtPossibleQuantity.Text = CConvert.ToString(PBModel.QUANTITY);
            txtFormDate.Value        = PBModel.BUILD_DATE;

            dgvData.Rows.Clear();
            //foreach (BllProductBuildLineTable LModel in PBModel.Items)
            //{
            //    int currentRowIndex = dgvData.Rows.Add(1);
            //    DataGridViewRow row = dgvData.Rows[currentRowIndex];
            //    row.Cells[1].Selected = false;
            //    row.Cells["No"].Value = LModel.LINE_NUMBER;
            //    row.Cells["PARTS_CODE"].Value = LModel.PRODUCT_PARTS_CODE;

            //    BaseProductTable product = new BaseProductTable();
            //    BProduct bProduct = new BProduct();
            //    product = bProduct.GetModel(LModel.PRODUCT_PARTS_CODE);
            //    row.Cells["PARTS_NAME"].Value = product.NAME;
            //    row.Cells["SPEC"].Value = product.SPEC;

            //    BAlloation bAlloation = new BAlloation();
            //    decimal alloationQuantity = bAlloation.GetAlloationQuantity(PBModel.WAREHOUSE_CODE, LModel.PRODUCT_PARTS_CODE);
            //    BaseStockTable stock = new BaseStockTable();
            //    stock = bPurchaseOrder.GetStockModel(PBModel.WAREHOUSE_CODE, LModel.PRODUCT_PARTS_CODE);
            //    row.Cells["NO_ALLOATION"].Value = stock.QUANTITY - alloationQuantity;
            //    row.Cells["UNIT_CODE"].Value = PBModel.UNIT_CODE;
            //    row.Cells["UNIT_NAME"].Value = bCommon.GetBaseMaster("UNIT", PBModel.UNIT_CODE).Name;

            //    row.Cells["PURCHASE_QUANTITY"].Value = LModel.PARTS_QUANTITY;

            //    row.Cells["STATUE_FLAG"].Value = "OK";

            //}
            for (int i = (currentPage - 1) * PageSize + 1; i <= PBModel.Items.Count && (i - (currentPage - 1) * PageSize) < PageSize; i++)
            {
                int             currentRowIndex = dgvData.Rows.Add(1);
                DataGridViewRow row             = dgvData.Rows[currentRowIndex];
                row.Cells[1].Selected           = false;
                row.Cells["No"].Value           = PBModel.Items[i - 1].LINE_NUMBER;
                row.Cells["PARTS_CODE"].Value   = PBModel.Items[i - 1].PRODUCT_PARTS_CODE;
                row.Cells["MIN_QUANTITY"].Value = PBModel.Items[i - 1].PARTS_QUANTITY / PBModel.QUANTITY;
                BaseProductTable product  = new BaseProductTable();
                BProduct         bProduct = new BProduct();
                product = bProduct.GetModel(PBModel.Items[i - 1].PRODUCT_PARTS_CODE);
                row.Cells["PARTS_NAME"].Value = product.NAME;
                row.Cells["SPEC"].Value       = product.SPEC;

                BAlloation     bAlloation        = new BAlloation();
                decimal        alloationQuantity = bAlloation.GetAlloationQuantity(PBModel.WAREHOUSE_CODE, PBModel.Items[i - 1].PRODUCT_PARTS_CODE);
                BaseStockTable stock             = new BaseStockTable();
                stock = bPurchaseOrder.GetStockModel(PBModel.WAREHOUSE_CODE, PBModel.Items[i - 1].PRODUCT_PARTS_CODE);
                row.Cells["NO_ALLOATION"].Value = stock.QUANTITY - alloationQuantity;
                row.Cells["UNIT_CODE"].Value    = PBModel.UNIT_CODE;
                row.Cells["UNIT_NAME"].Value    = bCommon.GetBaseMaster("UNIT", PBModel.UNIT_CODE).Name;

                row.Cells["PURCHASE_QUANTITY"].Value = PBModel.Items[i - 1].PARTS_QUANTITY;

                row.Cells["STATUE_FLAG"].Value = "OK";
            }

            if (PBModel.Items.Count < PageSize * currentPage)
            {
                dgvData.Rows.Add(PageSize - PBModel.Items.Count);
            }
        }