private bool saleOrderDetailsIsFull(ArrayList list) { bool isRet = true; for (int rowIndex = 0; rowIndex < list.Count; rowIndex++) { SaleOutOrderDetailsTable record = new SaleOutOrderDetailsTable(); record = (SaleOutOrderDetailsTable)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); }
private SortedDictionary <int, ArrayList> getSaleMaterielData(out double sumTotleMoney) { SortedDictionary <int, ArrayList> sortedDictionaryList = new SortedDictionary <int, ArrayList>(); SortedDictionary <int, SaleOutOrderDetailsTable> list = new SortedDictionary <int, SaleOutOrderDetailsTable>(); list = SaleOutOrderDetails.getInctance().getSaleOutOrderCountInfo(m_countStartDate, m_countEndDate, m_isCountAllBill); m_dataGridRecordCount = list.Count; sumTotleMoney = getSumTotleMoney(list); for (int index = 0; index < list.Count; index++) { SaleOutOrderDetailsTable record = new SaleOutOrderDetailsTable(); record = (SaleOutOrderDetailsTable)list[index]; ArrayList temp = new ArrayList(); temp.Add(index + 1); temp.Add(record.materielID); temp.Add(record.materielName); temp.Add(record.materielModel); temp.Add(record.totalMoney); temp.Add(getPercentValue(record.totalMoney, sumTotleMoney)); sortedDictionaryList.Add(index, temp); } return(sortedDictionaryList); }
private ArrayList getSaleOutOrderDetailsValue() { 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 { SaleOutOrderDetailsTable record = new SaleOutOrderDetailsTable(); 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.costApportionments = Convert.ToDouble(dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.TransportationCost].Value.ToString()); record.noCostApportionments = Convert.ToDouble(dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.OtherCost].Value.ToString()); record.billNumber = this.labelBillNumber.Text; list.Add(record); } } return(list); }
private double getSumTotleMoney(SortedDictionary <int, SaleOutOrderDetailsTable> list) { double sumTotleMoney = 0.0; for (int index = 0; index < list.Count; index++) { SaleOutOrderDetailsTable record = new SaleOutOrderDetailsTable(); record = (SaleOutOrderDetailsTable)list[index]; sumTotleMoney += record.totalMoney; } return(sumTotleMoney); }
private void readBillInfoToUI() { // 单据表头表尾信息 m_saleOutOrder = SaleOutOrder.getInctance().getSaleInfoFromBillNumber(m_billNumber); m_customerPkey = m_saleOutOrder.customerId; m_staffSavePkey = m_saleOutOrder.staffSaveId; m_staffCheckPkey = m_saleOutOrder.staffCheckId; this.labelSaleName.Visible = true; this.labelTradingDate.Visible = true; this.labelBillNumber.Visible = true; this.labelSaleType.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.labelSourceOrderType.Visible = true; this.labelSourceOrderNumber.Visible = true; this.labelSave.Visible = true; this.labelVerify.Visible = true; this.labelSaleName.Text = m_saleOutOrder.customerName; this.labelTradingDate.Text = m_saleOutOrder.tradingDate; this.labelBillNumber.Text = m_saleOutOrder.billNumber; this.labelSaleType.Text = m_saleOutOrder.saleType; this.labelPaymentDate.Text = m_saleOutOrder.paymentDate; this.labelSummary.Text = m_saleOutOrder.exchangesUnit; m_staffPkey = m_saleOutOrder.businessPeopleId; this.labelBusinessPeople.Text = m_saleOutOrder.businessPeopleName; this.labelMakeBillStaff.Text = m_saleOutOrder.makeOrderStaffName; this.labelSourceOrderType.Text = m_saleOutOrder.sourceBillType; this.labelSourceOrderNumber.Text = m_saleOutOrder.sourceBillNumber; this.labelSave.Text = m_saleOutOrder.staffSaveName; this.labelVerify.Text = m_saleOutOrder.staffCheckName; // DataGridView 赋值 SortedDictionary <int, SaleOutOrderDetailsTable> saleOrderDetails = SaleOutOrderDetails.getInctance().getSaleOutInfoFromBillNumber(m_billNumber); foreach (KeyValuePair <int, SaleOutOrderDetailsTable> index in saleOrderDetails) { SaleOutOrderDetailsTable record = new SaleOutOrderDetailsTable(); 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.costApportionments; dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.OtherCost].Value = record.noCostApportionments; dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.SumTurnover].Value = record.totalMoney; } // 如果单据已审核,则禁用页面所有控件 if (m_saleOutOrder.isReview == "1") { this.labelReviewBillStaff.Text = m_saleOutOrder.orderrReviewName; this.labelReviewDate.Text = m_saleOutOrder.reviewDate; this.panelIsReview.Visible = true; this.save.Enabled = false; this.toolStripButtonReview.Enabled = false; this.panelSaleName.Visible = false; this.panelTradingDate.Visible = false; this.panelSaleType.Visible = false; this.panelPaymentDate.Visible = false; this.panelSummary.Visible = false; this.textBoxSaleName.Visible = false; this.dateTimePickerTradingDate.Visible = false; this.comboBoxSaleType.Visible = false; this.dateTimePickerPaymentDate.Visible = false; this.textBoxSummary.Visible = false; this.panelBusinessPeople.Visible = false; // 如果单据已经审核则入账按钮是好用的 this.registerInLedger.Enabled = true; } else { this.labelReviewBillStaff.Visible = false; this.labelReviewDate.Visible = false; this.registerInLedger.Enabled = false; } // 如果单据已经记账,则出来红字已记账提示 if (m_saleOutOrder.isInLedger == 1) { this.panelInLedger.Visible = true; this.registerInLedger.Enabled = false; this.dataGridViewDataList.Enabled = false; this.dataGridViewDataCount.Enabled = false; } else { this.dataGridViewDataList.Enabled = true; this.dataGridViewDataCount.Enabled = true; } if (m_saleOutOrder.isRedBill == 1) { m_isRedBill = true; this.panelRed.Visible = true; } }