public FormProjectMaterielChangeOrder(string billNumber) { InitializeComponent(); //注:页面因素中数据表类型(1:设备总材料表;2:电器总材料表;3:工程总材料表) m_currentOrderInfo = FormProjectInfoChange.getInctance().getProjectInfoFromBillNumber(billNumber); m_tablesType = m_currentOrderInfo.dataType; if (m_tablesType == 1) { this.labelName.Text = "设备总材料变更申请表"; this.Text = "设备总材料变更申请表"; } else if (m_tablesType == 2) { this.labelName.Text = "电器总材料变更申请表"; this.Text = "电器总材料变更申请表"; } else if (m_tablesType == 3) { this.labelName.Text = "工程总材料变更申请表"; this.Text = "工程总材料变更申请表"; } else { m_tablesType = 1; this.labelName.Text = "设备总材料变更申请表"; this.Text = "设备总材料变更申请表"; } m_billNumber = billNumber; }
private bool purchaseOrderIsFull(FormProjectMaterielChangeTable record) { //if (record.changeReason.Length <= 0) //{ // MessageBoxExtend.messageWarning("变更原因不得为空,请重新输入"); // return false; //} if (this.textBoxBusinessPeople.Text.Length <= 0) { MessageBoxExtend.messageWarning("设计人员信息不完整,单据保存失败"); return false; } return true; }
private void exportProjectInfoChangeData() { int startRowIndex1 = 8; int startRowIndex2 = 22; // 总材料表套打 FormProjectMaterielChangeTable projectInfoChange = FormProjectInfoChange.getInctance().getProjectInfoFromBillNumber(m_billNubmber); FormProjectMaterielTable projectInfo = FormProject.getInctance().getProjectInfoFromBillNumber(projectInfoChange.srcBillNumber); int dataType = FormProject.getInctance().getOrderTypeFromBillNumber(projectInfoChange.srcBillNumber); string type = "设备"; if (dataType == 1) { type = "设备"; } else if (dataType == 2) { type = "电器"; } else if (dataType == 3) { type = "工程"; } stringReplace(type, "[1]"); stringReplace(projectInfo.billNumber, "[2]"); stringReplace(projectInfoChange.billNumber, "[3]"); stringReplace(projectInfo.projectName, "[4]"); stringReplace(projectInfo.projectNum, "[5]"); stringReplace(projectInfo.makeNum, "[6]"); stringReplace(projectInfo.deviceMode, "[7]"); stringReplace(projectInfoChange.makeOrderDate, "[8]"); stringReplace(projectInfoChange.makeOrderStaffName, "[9]"); stringReplace(projectInfo.subName, "[10]"); // 变更后数据 for (int row2 = 0; row2 < m_dataGridView.RowCount; row2++) { if (m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.MatetielNumber].Value.ToString().Length == 0) { break; } m_excelApp.Cells[row2 + startRowIndex2, 1] = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Num].Value.ToString().Trim(); m_excelApp.Cells[row2 + startRowIndex2, 2] = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Sequence].Value.ToString().Trim(); m_excelApp.Cells[row2 + startRowIndex2, 3] = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.DeviceName].Value.ToString().Trim(); m_excelApp.Cells[row2 + startRowIndex2, 4] = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.MatetielName].Value.ToString().Trim(); m_excelApp.Cells[row2 + startRowIndex2, 5] = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.CL].Value.ToString().Trim(); m_excelApp.Cells[row2 + startRowIndex2, 6] = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Model].Value.ToString().Trim(); m_excelApp.Cells[row2 + startRowIndex2, 7] = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Size].Value.ToString().Trim(); m_excelApp.Cells[row2 + startRowIndex2, 8] = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Parameter].Value.ToString().Trim(); m_excelApp.Cells[row2 + startRowIndex2, 9] = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Unit].Value.ToString().Trim(); m_excelApp.Cells[row2 + startRowIndex2, 10] = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Value].Value.ToString().Trim(); m_excelApp.Cells[row2 + startRowIndex2, 11] = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Brand].Value.ToString().Trim(); m_excelApp.Cells[row2 + startRowIndex2, 12] = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Note].Value.ToString().Trim(); } // 变更前数据 if (m_dataGridViewOfter == null) { return; } for (int row = 0; row < m_dataGridViewOfter.RowCount; row++) { if (m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.MatetielNumber].Value.ToString().Length == 0) { break; } m_excelApp.Cells[row + startRowIndex1, 1] = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Num].Value.ToString().Trim(); m_excelApp.Cells[row + startRowIndex1, 2] = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Sequence].Value.ToString().Trim(); m_excelApp.Cells[row + startRowIndex1, 3] = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.DeviceName].Value.ToString().Trim(); m_excelApp.Cells[row + startRowIndex1, 4] = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.MatetielName].Value.ToString().Trim(); m_excelApp.Cells[row + startRowIndex1, 5] = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.CL].Value.ToString().Trim(); m_excelApp.Cells[row + startRowIndex1, 6] = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Model].Value.ToString().Trim(); m_excelApp.Cells[row + startRowIndex1, 7] = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Size].Value.ToString().Trim(); m_excelApp.Cells[row + startRowIndex1, 8] = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Parameter].Value.ToString().Trim(); m_excelApp.Cells[row + startRowIndex1, 9] = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Unit].Value.ToString().Trim(); m_excelApp.Cells[row + startRowIndex1, 10] = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Value].Value.ToString().Trim(); m_excelApp.Cells[row + startRowIndex1, 11] = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Brand].Value.ToString().Trim(); m_excelApp.Cells[row + startRowIndex1, 12] = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Note].Value.ToString().Trim(); } }
private void updateDataGridView() { SortedDictionary <int, ArrayList> sortedDictionaryList = new SortedDictionary <int, ArrayList>(); if (m_orderType == OrderType.PurchaseApplyOrder) { SortedDictionary <int, PurchaseApplyOrderTable> list = new SortedDictionary <int, PurchaseApplyOrderTable>(); SortedDictionary <int, PurchaseApplyOrderTable> listOrderList = new SortedDictionary <int, PurchaseApplyOrderTable>(); listOrderList = PurchaseApplyOrder.getInctance().getAllPurchaseOrderInfoFromProjectNum(m_xxMaterielTableNum); for (int indexOrderList = 0; indexOrderList < listOrderList.Count; indexOrderList++) { PurchaseApplyOrderTable recordOrder = new PurchaseApplyOrderTable(); recordOrder = (PurchaseApplyOrderTable)listOrderList[indexOrderList]; if (PurchaseApplyOrderDetails.getInctance().getPurchaseValueFromMaterielID(recordOrder.billNumber, m_materielID) > 0) { list.Add(list.Count, recordOrder); } } m_dataGridRecordCount = list.Count; for (int index = 0; index < list.Count; index++) { PurchaseApplyOrderTable record = new PurchaseApplyOrderTable(); record = (PurchaseApplyOrderTable)list[index]; ArrayList temp = new ArrayList(); temp.Add(record.pkey); temp.Add(record.applyName); temp.Add(record.tradingDate); temp.Add(record.billNumber); temp.Add(record.srcOrderNum); temp.Add(record.paymentDate); temp.Add(record.totalMoney); temp.Add(record.makeOrderStaffName); if (record.isReview == "0") { temp.Add("否"); } else { temp.Add("是"); } temp.Add(record.orderrReviewName); temp.Add(record.reviewDate); sortedDictionaryList.Add(sortedDictionaryList.Count, temp); } m_dateGridViewExtend.initDataGridViewData(sortedDictionaryList, 3); } else if (m_orderType == OrderType.PurchaseOrder) { SortedDictionary <int, PurchaseOrderTable> list = new SortedDictionary <int, PurchaseOrderTable>(); SortedDictionary <int, PurchaseOrderTable> listOrderList = new SortedDictionary <int, PurchaseOrderTable>(); listOrderList = PurchaseOrder.getInctance().getAllPurchaseOrderInfoFromProjectNum(m_xxMaterielTableNum); for (int indexOrderList = 0; indexOrderList < listOrderList.Count; indexOrderList++) { PurchaseOrderTable recordOrder = new PurchaseOrderTable(); recordOrder = (PurchaseOrderTable)listOrderList[indexOrderList]; if (PurchaseOrderDetails.getInctance().getPurchaseValueFromBillNumber(recordOrder.billNumber, m_materielID) > 0) { list.Add(list.Count, recordOrder); } } m_dataGridRecordCount = list.Count; for (int index = 0; index < list.Count; index++) { PurchaseOrderTable record = new PurchaseOrderTable(); record = (PurchaseOrderTable)list[index]; ArrayList temp = new ArrayList(); temp.Add(record.pkey); temp.Add(record.supplierName); temp.Add(record.tradingDate); temp.Add(record.billNumber); temp.Add(record.xxMaterielTableNum); temp.Add(record.deliveryDate); temp.Add(record.paymentDate); temp.Add(record.sumMoney); temp.Add(record.sumTransportationCost); temp.Add(record.sumOtherCost); temp.Add(record.totalMoney); temp.Add(record.businessPeopleName); temp.Add(record.makeOrderStaffName); if (record.isReview == "0") { temp.Add("否"); } else { temp.Add("是"); } temp.Add(record.orderrReviewName); temp.Add(record.reviewDate); sortedDictionaryList.Add(sortedDictionaryList.Count, temp); } m_dateGridViewExtend.initDataGridViewData(sortedDictionaryList, 3); } else if (m_orderType == OrderType.PurchaseIn) { SortedDictionary <int, PurchaseInOrderTable> list = new SortedDictionary <int, PurchaseInOrderTable>(); SortedDictionary <int, PurchaseInOrderTable> listOrderList = new SortedDictionary <int, PurchaseInOrderTable>(); listOrderList = PurchaseInOrder.getInctance().getAllPurchaseOrderInfoFromProjectNum(m_xxMaterielTableNum); for (int indexOrderList = 0; indexOrderList < listOrderList.Count; indexOrderList++) { PurchaseInOrderTable recordOrder = new PurchaseInOrderTable(); recordOrder = (PurchaseInOrderTable)listOrderList[indexOrderList]; if (PurchaseInOrderDetails.getInctance().getPurchaseValueFromBillNumber(recordOrder.billNumber, m_materielID) > 0) { list.Add(list.Count, recordOrder); } } m_dataGridRecordCount = list.Count; for (int index = 0; index < list.Count; index++) { PurchaseInOrderTable record = new PurchaseInOrderTable(); record = (PurchaseInOrderTable)list[index]; ArrayList temp = new ArrayList(); temp.Add(record.pkey); temp.Add(record.supplierName); temp.Add(record.tradingDate); temp.Add(record.billNumber); temp.Add(record.purchaseType); temp.Add(record.srcOrderNum); temp.Add(record.paymentDate); temp.Add(record.sourceBillNumber); temp.Add(record.sumMoney); temp.Add(record.sumTransportationCost); temp.Add(record.sumOtherCost); temp.Add(record.totalMoney); temp.Add(record.staffSaveName); temp.Add(record.staffCheckName); temp.Add(record.businessPeopleName); temp.Add(record.makeOrderStaffName); temp.Add(record.orderrReviewName); temp.Add(record.reviewDate); temp.Add(record.orderInLedgerName); temp.Add(record.inLedgerDate); sortedDictionaryList.Add(sortedDictionaryList.Count, temp); } m_dateGridViewExtend.initDataGridViewData(sortedDictionaryList, 3); } else if (m_orderType == OrderType.StorageMaterielOut) { SortedDictionary <int, MaterielOutOrderTable> list = new SortedDictionary <int, MaterielOutOrderTable>(); SortedDictionary <int, MaterielOutOrderTable> listOrderList = new SortedDictionary <int, MaterielOutOrderTable>(); listOrderList = MaterielOutOrder.getInctance().getAllPurchaseOrderInfoFromProjectNum(m_xxMaterielTableNum); for (int indexOrderList = 0; indexOrderList < listOrderList.Count; indexOrderList++) { MaterielOutOrderTable recordOrder = new MaterielOutOrderTable(); recordOrder = (MaterielOutOrderTable)listOrderList[indexOrderList]; if (MaterielOutOrderDetails.getInctance().getPurchaseValueFromMaterielID(recordOrder.billNumber, m_materielID) > 0) { list.Add(list.Count, recordOrder); } } m_dataGridRecordCount = list.Count; for (int index = 0; index < list.Count; index++) { MaterielOutOrderTable record = new MaterielOutOrderTable(); record = (MaterielOutOrderTable)list[index]; ArrayList temp = new ArrayList(); temp.Add(record.pkey); temp.Add(record.departmentName); temp.Add(record.tradingDate); temp.Add(record.billNumber); temp.Add(record.srcOrderNum); temp.Add(record.makeNo); temp.Add(record.sumValue); temp.Add(record.sumMoney); temp.Add(record.materielOutStaffName); temp.Add(record.makeOrderStaffName); temp.Add(record.orderrReviewName); temp.Add(record.reviewDate); sortedDictionaryList.Add(sortedDictionaryList.Count, temp); } m_dateGridViewExtend.initDataGridViewData(sortedDictionaryList, 3); } else if (m_orderType == OrderType.ChangeApply) { //m_dateGridViewExtend.addDataGridViewColumn("ID", 30); //m_dateGridViewExtend.addDataGridViewColumn("源单据号", 150); //m_dateGridViewExtend.addDataGridViewColumn("设计人", 80); //m_dateGridViewExtend.addDataGridViewColumn("单据号", 150); //m_dateGridViewExtend.addDataGridViewColumn("变更原因", 300); //m_dateGridViewExtend.addDataGridViewColumn("制单员", 80); //m_dateGridViewExtend.addDataGridViewColumn("审核员", 80); //m_dateGridViewExtend.addDataGridViewColumn("审核日期", 80); // 根据源单据号,得到订单详细单据 if (m_srcChangeOrderBillNumber.Length > 0) { SortedDictionary <int, FormProjectMaterielChangeTable> changtList = FormProjectInfoChange.getInctance().getChangeListFromSrcBillNumber(m_srcChangeOrderBillNumber); m_dataGridRecordCount = changtList.Count; for (int index = 0; index < changtList.Count; index++) { FormProjectMaterielChangeTable record = new FormProjectMaterielChangeTable(); record = (FormProjectMaterielChangeTable)changtList[index]; ArrayList temp = new ArrayList(); temp.Add(record.pkey); temp.Add(record.srcBillNumber); temp.Add(record.designStaffName); temp.Add(record.billNumber); temp.Add(record.changeReason); temp.Add(record.makeOrderStaffName); temp.Add(record.orderrReviewName); temp.Add(record.reviewDate); sortedDictionaryList.Add(sortedDictionaryList.Count, temp); } m_dateGridViewExtend.initDataGridViewData(sortedDictionaryList, 3); } } }