Ejemplo n.º 1
0
        private ArrayList getPurchaseOrderDetailsValue()
        {
            ArrayList list = new ArrayList();

            for (int rowIndex = 0; rowIndex < DateGridVeiwListDataListRowCount; rowIndex++)
            {
                if (this.dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.MatetielNumber].Value.ToString().Length == 0)
                {
                    break;
                }
                else
                {
                    PurchaseApplyOrderDetailsTable record = new PurchaseApplyOrderDetailsTable();

                    record.rowNumber = dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.RowNum].Value.ToString();

                    record.xxMatetielTableRowNum = dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.xxMatetielTableRowNum].Value.ToString();

                    record.materielID = Convert.ToInt32(dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.MatetielNumber].Value.ToString());
                    record.price      = Convert.ToDouble(dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Price].Value.ToString());
                    record.value      = Convert.ToDouble(dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Value].Value.ToString());
                    record.otherCost  = Convert.ToDouble(dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.OtherCost].Value.ToString());
                    record.billNumber = this.labelBillNumber.Text;

                    list.Add(record);
                }
            }

            return(list);
        }
Ejemplo n.º 2
0
        private void writeBillDetailsInfoFromBillNumber(string billNumber)
        {
            // DataGridView 赋值
            SortedDictionary <int, PurchaseApplyOrderDetailsTable> purchaseOrderDetails =
                PurchaseApplyOrderDetails.getInctance().getPurchaseInfoFromBillNumber(billNumber);

            foreach (KeyValuePair <int, PurchaseApplyOrderDetailsTable> index in purchaseOrderDetails)
            {
                PurchaseApplyOrderDetailsTable record = new PurchaseApplyOrderDetailsTable();
                record = index.Value;

                int rowIndex = Convert.ToInt32(record.rowNumber.ToString()) - 1;

                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.MatetielNumber].Value     = record.materielID;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.MatetielName].Value       = record.materielName;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Model].Value              = record.materielModel;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Unit].Value               = record.materielUnitPurchase;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Price].Value              = record.price;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Value].Value              = record.value;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Turnover].Value           = record.sumMoney;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.TransportationCost].Value = 0;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.OtherCost].Value          = record.otherCost;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.SumTurnover].Value        = record.totalMoney;
            }
        }
Ejemplo n.º 3
0
        private bool purchaseOrderDetailsIsFull(ArrayList list)
        {
            bool isRet = true;

            for (int rowIndex = 0; rowIndex < list.Count; rowIndex++)
            {
                PurchaseApplyOrderDetailsTable record = new PurchaseApplyOrderDetailsTable();
                record = (PurchaseApplyOrderDetailsTable)list[rowIndex];

                if (record.value == 0)
                {
                    MessageBoxExtend.messageWarning("第[" + record.rowNumber + "]信息中物料数量不能为空");
                    isRet = false;
                    break;
                }
            }

            return(isRet);
        }
Ejemplo n.º 4
0
        private void readBillInfoToUI()
        {
            // 单据表头表尾信息
            m_purchaseOrder = PurchaseApplyOrder.getInctance().getPurchaseInfoFromBillNumber(m_billNumber);

            m_applyStaffPkey = m_purchaseOrder.applyId;

            this.labelPurchaseName.Visible    = true;
            this.labelTradingDate.Visible     = true;
            this.labelBillNumber.Visible      = true;
            this.labelProject.Visible         = true;
            this.labelDeliveryDate.Visible    = true;
            this.labelSummary.Visible         = true;
            this.labelMakeBillStaff.Visible   = true;
            this.labelReviewBillStaff.Visible = true;
            this.labelReviewDate.Visible      = true;

            this.labelPurchaseName.Text  = m_purchaseOrder.applyName;
            this.labelTradingDate.Text   = m_purchaseOrder.tradingDate;
            this.labelBillNumber.Text    = m_purchaseOrder.billNumber;
            this.labelDeliveryDate.Text  = m_purchaseOrder.paymentDate;
            this.labelProject.Text       = m_purchaseOrder.srcOrderNum;
            this.labelSummary.Text       = m_purchaseOrder.exchangesUnit;
            this.labelMakeBillStaff.Text = m_purchaseOrder.makeOrderStaffName;

            // DataGridView 赋值
            SortedDictionary <int, PurchaseApplyOrderDetailsTable> purchaseOrderDetails =
                PurchaseApplyOrderDetails.getInctance().getPurchaseInfoFromBillNumber(m_billNumber);

            foreach (KeyValuePair <int, PurchaseApplyOrderDetailsTable> index in purchaseOrderDetails)
            {
                PurchaseApplyOrderDetailsTable record = new PurchaseApplyOrderDetailsTable();
                record = index.Value;

                int rowIndex = Convert.ToInt32(record.rowNumber.ToString()) - 1;

                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.MatetielNumber].Value        = record.materielID;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.MatetielName].Value          = record.materielName;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Brand].Value                 = record.brand;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Model].Value                 = record.materielModel;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Parameter].Value             = record.parameter;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Unit].Value                  = record.materielUnitPurchase;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Price].Value                 = record.price;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Value].Value                 = record.value;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Turnover].Value              = record.sumMoney;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.OtherCost].Value             = record.otherCost;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.SumTurnover].Value           = record.totalMoney;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.xxMatetielTableRowNum].Value = record.xxMatetielTableRowNum;
            }

            // 如果单据已审核,则禁用页面所有控件
            if (m_purchaseOrder.isReview == "1")
            {
                this.labelReviewBillStaff.Text = m_purchaseOrder.orderrReviewName;
                this.labelReviewDate.Text      = m_purchaseOrder.reviewDate;
                this.panelIsReview.Visible     = true;

                this.save.Enabled = false;
                this.toolStripButtonReview.Enabled  = false;
                this.dataGridViewDataList.ReadOnly  = true;
                this.dataGridViewDataCount.ReadOnly = true;

                this.panelPurchaseName.Visible = false;
                this.panelTradingDate.Visible  = false;
                this.panelProjectNum.Visible   = false;
                this.panelDeliveryDate.Visible = false;
                this.panelSummary.Visible      = false;

                this.textBoxPApplyName.Visible          = false;
                this.textBoxProject.Visible             = false;
                this.dateTimePickerTradingDate.Visible  = false;
                this.dateTimePickerDeliveryDate.Visible = false;
                this.textBoxSummary.Visible             = false;
            }
            else
            {
                this.labelReviewBillStaff.Visible = false;
                this.labelReviewDate.Visible      = false;
            }
        }