Exemplo n.º 1
0
        private void writeBillDetailsInfoFromBillNumber(string billNumber)
        {
            // DataGridView 赋值
            SortedDictionary <int, SaleOrderDetailsTable> saleOrderDetails =
                SaleOrderDetails.getInctance().getSaleInfoFromBillNumber(billNumber);

            foreach (KeyValuePair <int, SaleOrderDetailsTable> index in saleOrderDetails)
            {
                SaleOrderDetailsTable record = new SaleOrderDetailsTable();
                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.materielUnitSale;
                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 = record.transportationCost;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.OtherCost].Value          = record.otherCost;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.SumTurnover].Value        = record.totalMoney;
            }
        }
Exemplo n.º 2
0
        private bool purchaseOrderDetailsIsFull(ArrayList list)
        {
            bool isRet = true;

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

                //string price = Convert.ToString(record.price);
                //string value = Convert.ToString(record.value);

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

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

            return(isRet);
        }
Exemplo n.º 3
0
        private ArrayList getSaleOrderDetailsValue()
        {
            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
                {
                    SaleOrderDetailsTable record = new SaleOrderDetailsTable();

                    record.rowNumber          = dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.RowNum].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.transportationCost = Convert.ToDouble(dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.TransportationCost].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);
        }
Exemplo n.º 4
0
        private void readBillInfoToUI()
        {
            // 单据表头表尾信息
            m_purchaseOrder = SaleOrder.getInctance().getSaleInfoFromBillNumber(m_billNumber);

            m_customerPkey = m_purchaseOrder.customerId;

            this.labelSaleName.Visible        = true;
            this.labelTradingDate.Visible     = true;
            this.labelBillNumber.Visible      = true;
            this.labelSaleType.Visible        = true;
            this.labelDeliveryDate.Visible    = true;
            this.labelPaymentDate.Visible     = true;
            this.labelSummary.Visible         = true;
            this.labelBusinessPeople.Visible  = true;
            this.labelMakeBillStaff.Visible   = true;
            this.labelReviewBillStaff.Visible = true;
            this.labelReviewDate.Visible      = true;

            this.labelSaleName.Text     = m_purchaseOrder.customerName;
            this.labelTradingDate.Text  = m_purchaseOrder.tradingDate;
            this.labelBillNumber.Text   = m_purchaseOrder.billNumber;
            this.labelSaleType.Text     = m_purchaseOrder.saleType;
            this.labelDeliveryDate.Text = m_purchaseOrder.deliveryDate;
            this.labelPaymentDate.Text  = m_purchaseOrder.paymentDate;
            this.labelSummary.Text      = m_purchaseOrder.exchangesUnit;

            m_staffPkey = m_purchaseOrder.businessPeopleId;
            this.labelBusinessPeople.Text = m_purchaseOrder.businessPeopleName;
            this.labelMakeBillStaff.Text  = m_purchaseOrder.makeOrderStaffName;

            // DataGridView 赋值
            SortedDictionary <int, SaleOrderDetailsTable> purchaseOrderDetails =
                SaleOrderDetails.getInctance().getSaleInfoFromBillNumber(m_billNumber);

            foreach (KeyValuePair <int, SaleOrderDetailsTable> index in purchaseOrderDetails)
            {
                SaleOrderDetailsTable record = new SaleOrderDetailsTable();
                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.materielUnitSale;
                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 = record.transportationCost;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.OtherCost].Value          = record.otherCost;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.SumTurnover].Value        = record.totalMoney;
            }

            // 如果单据已审核,则禁用页面所有控件
            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.panelSaleName.Visible     = false;
                this.panelTradingDate.Visible  = false;
                this.panelSaleType.Visible     = false;
                this.panelDeliveryDate.Visible = false;
                this.panelPaymentDate.Visible  = false;
                this.panelSummary.Visible      = false;

                this.textBoxSaleName.Visible            = false;
                this.dateTimePickerTradingDate.Visible  = false;
                this.comboBoxSaleType.Visible           = false;
                this.dateTimePickerDeliveryDate.Visible = false;
                this.dateTimePickerPaymentDate.Visible  = false;
                this.textBoxSummary.Visible             = false;

                this.panelBusinessPeople.Visible = false;
            }
            else
            {
                this.labelReviewBillStaff.Visible = false;
                this.labelReviewDate.Visible      = false;
            }
        }