Exemple #1
0
        private void save_Click(object sender, EventArgs e)
        {
            // 得到详细的销售信息
            ArrayList dataList = getMaterielOutOrderDetailsValue();

            if (dataList.Count > 0)
            {
                // 销售订单表头和表尾信息
                MaterielOutOrderTable record = getMaterielOutOrderValue();
                if (orderInfoIsFull(record) && orderDetailsIsFull(dataList))
                {
                    MaterielOutOrder.getInctance().insert(record, false);
                    MaterielOutOrderDetails.getInctance().insert(dataList);
                    BillNumber.getInctance().inserBillNumber(BillTypeNumber, this.labelTradingDate.Text, this.labelBillNumber.Text.ToString());

                    if (m_billNumber.Length == 0)
                    {
                        MessageBoxExtend.messageOK("数据保存成功");
                    }

                    this.Close();
                }
            }
            else
            {
                MessageBoxExtend.messageWarning("此单据不包含任何交易信息,单据保存失败.");
            }
        }
Exemple #2
0
        private SortedDictionary <int, ArrayList> getStorageMaterielOutData(out double sumTotleMoney)
        {
            SortedDictionary <int, ArrayList> sortedDictionaryList    = new SortedDictionary <int, ArrayList>();
            SortedDictionary <int, MaterielOutOrderDetailsTable> list = new SortedDictionary <int, MaterielOutOrderDetailsTable>();

            list = MaterielOutOrderDetails.getInctance().getMaterielOutOrderCountInfo2(m_countStartDate, m_countEndDate, m_isCountAllBill);

            m_dataGridRecordCount = list.Count;
            sumTotleMoney         = getSumTotleMoney(list);

            for (int index = 0; index < list.Count; index++)
            {
                MaterielOutOrderDetailsTable record = new MaterielOutOrderDetailsTable();
                record = (MaterielOutOrderDetailsTable)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.sumMoney);
                temp.Add(getPercentValue(record.sumMoney, sumTotleMoney));

                sortedDictionaryList.Add(index, temp);
            }

            return(sortedDictionaryList);
        }
Exemple #3
0
        private void writeBillDetailsInfoFromBillNumber(string billNumber)
        {
            // DataGridView 赋值
            SortedDictionary <int, MaterielOutOrderDetailsTable> orderDetails =
                MaterielOutOrderDetails.getInctance().getMaterielOutInfoFromBillNumber(billNumber);

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

                int           rowIndex     = Convert.ToInt32(record.rowNumber.ToString()) - 1;
                MaterielTable materielInfo = Materiel.getInctance().getMaterielInfoFromPkey(record.materielID);

                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                 = materielInfo.brand;
                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.CZ].Value                    = materielInfo.CZ;
                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.Note].Value                  = record.note;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.xxMatetielTableRowNum].Value = record.xxMatetielTableRowNum;
            }
        }
        private void toolStripButtonRefresh_Click(object sender, EventArgs e)
        {
            // 刷新按钮逻辑
            if (m_orderType == OrderType.SaleQuotation)
            {
                // 销售管理-销售报价单序时簿
                SaleQuotationOrder.getInctance().refreshRecord();
            }
            else if (m_orderType == OrderType.SaleOrder)
            {
                // 销售管理-销售订单序时簿
                SaleOrder.getInctance().refreshRecord();
                SaleOrderDetails.getInctance().refreshRecord();
            }
            else if (m_orderType == OrderType.SaleOut)
            {
                // 销售管理-销售出库单序时簿
                SaleOutOrder.getInctance().refreshRecord();
                SaleOutOrderDetails.getInctance().refreshRecord();
            }
            else if (m_orderType == OrderType.SaleInvoice)
            {
                // 销售管理-销售发票序时簿(暂时为空就可以)
            }
            else if (m_orderType == OrderType.SaleOrderExcute)
            {
                // 销售管理-销售订单执行情况
                SaleOrder.getInctance().refreshRecord();
                SaleOrderDetails.getInctance().refreshRecord();
            }
            else if (m_orderType == OrderType.SaleOutOrderExcute)
            {
                // 销售管理-销售出库单收款情况
                SaleOutOrder.getInctance().refreshRecord();
                SaleOutOrderDetails.getInctance().refreshRecord();
            }
            else if (m_orderType == OrderType.StorageMaterielOut)
            {
                // 仓存管理-生产领料
                MaterielOutOrder.getInctance().refreshRecord();
                MaterielOutOrderDetails.getInctance().refreshRecord();
            }
            else if (m_orderType == OrderType.StorageOutCheck)
            {
                // 仓存管理-盘亏亏损
                MaterielOutEarningsOrder.getInctance().refreshRecord();
                MaterielOutEarningsOrderDetails.getInctance().refreshRecord();
            }
            else if (m_orderType == OrderType.StorageOutOther)
            {
                // 仓存管理-其他出库
                MaterielOutOtherOrder.getInctance().refreshRecord();
                MaterielOutOtherOrderDetails.getInctance().refreshRecord();
            }

            updateDataGridView();
        }
Exemple #5
0
        private void toolStripButtonRefreshHS_Click(object sender, EventArgs e)
        {
            if (m_orderType == CountType.PurchaseMateriel)
            {
                PurchaseInOrderDetails.getInctance().refreshRecord();
            }
            else if (m_orderType == CountType.PurchasePeople)
            {
                PurchaseInOrder.getInctance().refreshRecord();
            }
            else if (m_orderType == CountType.PurchaseSupplier)
            {
                PurchaseInOrder.getInctance().refreshRecord();
            }
            else if (m_orderType == CountType.PurchaseHistoryPrice)
            {
                PurchaseInOrderDetails.getInctance().refreshRecord();
            }
            else if (m_orderType == CountType.SaleMateriel)
            {
                SaleOutOrderDetails.getInctance().refreshRecord();
            }
            else if (m_orderType == CountType.SalePeople)
            {
                SaleOutOrder.getInctance().refreshRecord();
            }
            else if (m_orderType == CountType.SaleCustomer)
            {
                SaleOutOrder.getInctance().refreshRecord();
            }
            else if (m_orderType == CountType.SaleHistoryPrice)
            {
                SaleOutOrderDetails.getInctance().refreshRecord();
            }
            else if (m_orderType == CountType.StorageMaterielOut)
            {
                MaterielOutOrderDetails.getInctance().refreshRecord();
            }
            else if (m_orderType == CountType.StorageManagerMaterielCount)
            {
                StorageStockDetail.getInctance().refreshRecord();
            }
            else if (m_orderType == CountType.MaterielInOutCount)
            {
                StorageStockDetail.getInctance().refreshRecord();
            }
            else if (m_orderType == CountType.StorageManagerProduceIn)
            {
                MaterielInOrderDetails.getInctance().refreshRecord();
            }

            updateDataGridView();
        }
Exemple #6
0
        private void save_Click(object sender, EventArgs e)
        {
            m_isSaveSuccess = false;

            if ((sender.ToString() == "保存" || sender.ToString() == "审核") &&
                MaterielOutOrder.getInctance().checkBillIsReview(this.labelBillNumber.Text.ToString()))
            {
                MessageBoxExtend.messageWarning("单据已被审核,所有数据无法进行更改,无法重复保存或审核\r\n请重新登录或手动刷新后查看单据详情");
                return;
            }

            this.ActiveControl = this.toolStrip1;

            bool isReLoad = true;

            if (sender == null && e == null)
            {
                isReLoad = false;
            }

            // 得到详细的销售信息
            ArrayList dataList = getMaterielOutOrderDetailsValue();

            if (dataList.Count > 0)
            {
                // 销售订单表头和表尾信息
                MaterielOutOrderTable record = getMaterielOutOrderValue();
                if (orderInfoIsFull(record) && orderDetailsIsFull(dataList))
                {
                    MaterielOutOrder.getInctance().insert(record, false, isReLoad);
                    MaterielOutOrderDetails.getInctance().insert(dataList);
                    BillNumber.getInctance().inserBillNumber(BillTypeNumber, this.labelTradingDate.Text, this.labelBillNumber.Text.ToString());

                    m_isSaveSuccess = true;

                    if (m_billNumber.Length == 0)
                    {
                        MessageBoxExtend.messageOK("数据保存成功");
                    }

                    this.Close();
                }
            }
            else
            {
                MessageBoxExtend.messageWarning("此单据不包含任何交易信息,单据保存失败.");
            }
        }
Exemple #7
0
        private void AutoDelMateriePro(string billNumber)
        {
            string projectNum = this.labelProjectNo.Text;

            SortedDictionary <int, MaterielOutOrderDetailsTable> proInfoList = MaterielOutOrderDetails.getInctance().getMaterielOutInfoFromBillNumber(billNumber);


            TivLog.Logger.Info("projectNum = " + projectNum.ToString() + ", billNumber = " + billNumber.ToString() + ", 需消除预占信息的物料共计" + proInfoList.Count.ToString() + "条.");

            foreach (KeyValuePair <int, MaterielOutOrderDetailsTable> index in proInfoList)
            {
                MaterielOutOrderDetailsTable record = index.Value;

                MaterielProOccupiedOrderDetails.getInctance().cancelMaterielPro(projectNum, record.materielID, record.value);
            }
        }
        private void getInfoListFromBillNumber(FormProjectMaterielTable record)
        {
            SortedDictionary <int, ProjectManagerDetailsTable> listDetails = new SortedDictionary <int, ProjectManagerDetailsTable>();

            listDetails = ProjectManagerDetails.getInctance().getPurchaseInfoFromBillNumber(record.billNumber);

            SortedDictionary <int, ProjectManagerDetailsTable> changeMaterielList = FormProjectInfoChange.getInctance().getMaterielDetailsFromSrcBillNumber(record.billNumber);

            for (int index2 = 0; index2 < listDetails.Count; index2++)
            {
                ProjectManagerDetailsTable tmp = new ProjectManagerDetailsTable();
                tmp = (ProjectManagerDetailsTable)listDetails[index2];

                // 物料数量可能会存在变更,若发生变更,需要使用变更后数量代替原有数量,在一个材料表中,序号是唯一值
                double actualValue = 0.0;
                int    sign        = 0;
                if (tmp.no.Length > 0)
                {
                    sign = Convert.ToInt32(tmp.no);
                }

                if (changeMaterielList.Count > 0 && changeMaterielList.ContainsKey(sign))
                {
                    if (tmp.materielID != changeMaterielList[sign].materielID)
                    {
                        // 相当于变更时,使用使用了另外一种物料替换了现有物料,
                        tmp.materielID        = changeMaterielList[sign].materielID;
                        tmp.materielName      = changeMaterielList[sign].materielName;
                        tmp.num               = changeMaterielList[sign].num;
                        tmp.materielModel     = changeMaterielList[sign].materielModel;
                        tmp.materielParameter = changeMaterielList[sign].materielParameter;
                        tmp.cl           = changeMaterielList[sign].cl;
                        tmp.materielSize = changeMaterielList[sign].materielSize;
                    }

                    actualValue = changeMaterielList[sign].value;
                    changeMaterielList.Remove(sign);
                }
                else
                {
                    actualValue = tmp.value;
                }

                ArrayList temp = new ArrayList();

                temp.Add(record.billNumber);
                temp.Add(record.projectNum);
                temp.Add(record.makeNum);
                temp.Add(record.deviceMode);
                temp.Add(record.subName);

                temp.Add(tmp.materielID);
                temp.Add(tmp.materielName);
                temp.Add(tmp.num);
                temp.Add(tmp.materielModel);
                temp.Add(tmp.materielParameter);
                temp.Add(tmp.cl);
                temp.Add(tmp.materielSize);
                temp.Add(actualValue);

                // 得到实际库存
                InitMaterielTable MaterielCountdata = InitMateriel.getInctance().getMaterielInfoFromMaterielID(tmp.materielID);
                temp.Add(MaterielCountdata.value);

                // 库存预占情况,包含总预占量和本项目预占量
                temp.Add(MaterielProOccupiedOrderDetails.getInctance().getMaterielProCountInfoFromProject(tmp.materielID));
                temp.Add(MaterielProOccupiedOrderDetails.getInctance().getMaterielProCountInfoFromProject(tmp.materielID, record.billNumber));


                // 转采购申请单数量
                double appylyCount = PurchaseApplyOrderDetails.getInctance().getPurchaseValueFromProjectNumber(record.billNumber,
                                                                                                               PublicFuction.getXXMateaielOrderSign(tmp.rowNumber, tmp.sequence, tmp.no));
                temp.Add(appylyCount);

                // 采购订单数量
                SortedDictionary <int, PurchaseOrderTable> listOrderList = new SortedDictionary <int, PurchaseOrderTable>();
                listOrderList = PurchaseOrder.getInctance().getAllPurchaseOrderInfoFromProjectNum(record.billNumber);

                double orderCount = 0;
                for (int indexOrderList = 0; indexOrderList < listOrderList.Count; indexOrderList++)
                {
                    PurchaseOrderTable recordOrder = new PurchaseOrderTable();
                    recordOrder = (PurchaseOrderTable)listOrderList[indexOrderList];

                    orderCount += PurchaseOrderDetails.getInctance().getPurchaseValueFromBillNumber(recordOrder.billNumber, tmp.materielID);
                }
                temp.Add(orderCount);

                // 采购入库数量
                SortedDictionary <int, PurchaseInOrderTable> purchaseInOrderList = new SortedDictionary <int, PurchaseInOrderTable>();
                purchaseInOrderList = PurchaseInOrder.getInctance().getAllPurchaseOrderInfoFromProjectNum(record.billNumber);

                double purchaseInOrderValueCount = 0;
                for (int indexOrderList = 0; indexOrderList < purchaseInOrderList.Count; indexOrderList++)
                {
                    PurchaseInOrderTable recordOrder = new PurchaseInOrderTable();
                    recordOrder = (PurchaseInOrderTable)purchaseInOrderList[indexOrderList];

                    purchaseInOrderValueCount += PurchaseInOrderDetails.getInctance().getPurchaseValueFromBillNumber(recordOrder.billNumber, tmp.materielID);
                }
                temp.Add(purchaseInOrderValueCount);

                // 生产领料数量
                double materielOutOrderValueCount = MaterielOutOrderDetails.getInctance().getMaterielCountInfoFromProject(record.billNumber,
                                                                                                                          PublicFuction.getXXMateaielOrderSign(tmp.rowNumber, tmp.sequence, tmp.no));
                temp.Add(materielOutOrderValueCount);

                m_projectInfoList.Add(m_projectInfoList.Count, temp);
            }

            // 如果changeMaterielList.count大于0 则代表有
            foreach (KeyValuePair <int, ProjectManagerDetailsTable> index3 in changeMaterielList)
            {
                ProjectManagerDetailsTable tmp = new ProjectManagerDetailsTable();
                tmp = index3.Value;

                ArrayList temp = new ArrayList();

                temp.Add(record.billNumber);
                temp.Add(record.projectNum);
                temp.Add(record.makeNum);
                temp.Add(record.deviceMode);
                temp.Add(record.subName);

                temp.Add(tmp.materielID);
                temp.Add(tmp.materielName);
                temp.Add(tmp.num);
                temp.Add(tmp.materielModel);
                temp.Add(tmp.materielParameter);
                temp.Add(tmp.cl);
                temp.Add(tmp.materielSize);
                temp.Add(tmp.value);

                // 得到实际库存
                InitMaterielTable MaterielCountdata = InitMateriel.getInctance().getMaterielInfoFromMaterielID(tmp.materielID);
                temp.Add(MaterielCountdata.value);

                // 库存预占情况,包含总预占量和本项目预占量
                temp.Add(MaterielProOccupiedOrderDetails.getInctance().getMaterielProCountInfoFromProject(tmp.materielID));
                temp.Add(MaterielProOccupiedOrderDetails.getInctance().getMaterielProCountInfoFromProject(tmp.materielID, record.billNumber));


                // 转采购申请单数量
                double appylyCount = PurchaseApplyOrderDetails.getInctance().getPurchaseValueFromProjectNumber(record.billNumber,
                                                                                                               PublicFuction.getXXMateaielOrderSign(tmp.rowNumber, tmp.sequence, tmp.no));
                temp.Add(appylyCount);

                // 采购订单数量
                SortedDictionary <int, PurchaseOrderTable> listOrderList = new SortedDictionary <int, PurchaseOrderTable>();
                listOrderList = PurchaseOrder.getInctance().getAllPurchaseOrderInfoFromProjectNum(record.billNumber);

                double orderCount = 0;
                for (int indexOrderList = 0; indexOrderList < listOrderList.Count; indexOrderList++)
                {
                    PurchaseOrderTable recordOrder = new PurchaseOrderTable();
                    recordOrder = (PurchaseOrderTable)listOrderList[indexOrderList];

                    orderCount += PurchaseOrderDetails.getInctance().getPurchaseValueFromBillNumber(recordOrder.billNumber, tmp.materielID);
                }
                temp.Add(orderCount);

                // 采购入库数量
                SortedDictionary <int, PurchaseInOrderTable> purchaseInOrderList = new SortedDictionary <int, PurchaseInOrderTable>();
                purchaseInOrderList = PurchaseInOrder.getInctance().getAllPurchaseOrderInfoFromProjectNum(record.billNumber);

                double purchaseInOrderValueCount = 0;
                for (int indexOrderList = 0; indexOrderList < purchaseInOrderList.Count; indexOrderList++)
                {
                    PurchaseInOrderTable recordOrder = new PurchaseInOrderTable();
                    recordOrder = (PurchaseInOrderTable)purchaseInOrderList[indexOrderList];

                    purchaseInOrderValueCount += PurchaseInOrderDetails.getInctance().getPurchaseValueFromBillNumber(recordOrder.billNumber, tmp.materielID);
                }
                temp.Add(purchaseInOrderValueCount);

                // 生产领料数量
                double materielOutOrderValueCount = MaterielOutOrderDetails.getInctance().getMaterielCountInfoFromProject(record.billNumber,
                                                                                                                          PublicFuction.getXXMateaielOrderSign(tmp.rowNumber, tmp.sequence, tmp.no));
                temp.Add(materielOutOrderValueCount);

                m_projectInfoList.Add(m_projectInfoList.Count, temp);
            }
        }
        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);
                }
            }
        }
Exemple #10
0
        private void getProInfoList()
        {
            m_proInfoList.Clear();

            // 得到单据变更情况
            SortedDictionary <int, ProjectManagerDetailsTable> changeMaterielList = FormProjectInfoChange.getInctance().getMaterielDetailsFromSrcBillNumber(m_billNumber);

            // 根据单据,得到单据详细信息
            SortedDictionary <int, ProjectManagerDetailsTable> listDetails = new SortedDictionary <int, ProjectManagerDetailsTable>();

            listDetails = ProjectManagerDetails.getInctance().getPurchaseInfoFromBillNumber(m_billNumber);

            for (int index = 0; index < listDetails.Count; index++)
            {
                ArrayList record = new ArrayList();

                ProjectManagerDetailsTable tmp = new ProjectManagerDetailsTable();
                tmp = (ProjectManagerDetailsTable)listDetails[index];

                // 单据所需物料
                double requestValue = 0.0;
                // 已转数量
                double proValue = 0.0;

                // 物料数量可能会存在变更,若发生变更,需要使用变更后数量代替原有数量,在一个材料表中,序号是唯一值
                int sign = 0;
                if (tmp.no.Length > 0)
                {
                    sign = Convert.ToInt32(tmp.no);
                }

                if (changeMaterielList.Count > 0 && changeMaterielList.ContainsKey(sign))
                {
                    if (tmp.materielID != changeMaterielList[sign].materielID)
                    {
                        // 相当于变更时,使用使用了另外一种物料替换了现有物料,
                        tmp.materielID = changeMaterielList[sign].materielID;
                    }

                    requestValue = changeMaterielList[sign].value;
                    changeMaterielList.Remove(sign);
                }
                else
                {
                    requestValue = tmp.value;
                }


                if (m_dataType == 1)
                {
                    proValue = MaterielProOccupiedOrderDetails.getInctance().getMaterielProCountInfoFromProject(tmp.materielID, tmp.billNumber);
                }
                else if (m_dataType == 2)
                {
                    proValue = PurchaseApplyOrderDetails.getInctance().getPurchaseValueFromProjectNumber(tmp.billNumber,
                                                                                                         PublicFuction.getXXMateaielOrderSign(tmp.rowNumber, tmp.sequence, tmp.no));
                }
                else if (m_dataType == 3)
                {
                    proValue = MaterielOutOrderDetails.getInctance().getMaterielCountInfoFromProject(tmp.billNumber,
                                                                                                     PublicFuction.getXXMateaielOrderSign(tmp.rowNumber, tmp.sequence, tmp.no));
                }

                if (requestValue - proValue > 0)
                {
                    record.Add(tmp.billNumber);
                    record.Add(tmp.materielID);
                    record.Add(requestValue);
                    record.Add(proValue);

                    // 库存预占情况,本项目预占量
                    record.Add(MaterielProOccupiedOrderDetails.getInctance().getMaterielProCountInfoFromProject(tmp.materielID));
                    record.Add(MaterielProOccupiedOrderDetails.getInctance().getMaterielProCountInfoFromProject(tmp.materielID, tmp.billNumber));

                    // 得到实际库存
                    InitMaterielTable MaterielCountdata = InitMateriel.getInctance().getMaterielInfoFromMaterielID(tmp.materielID);
                    record.Add(MaterielCountdata.value);

                    // 使用行号+序列号+序号的和作为一行数据的唯一标识
                    record.Add(PublicFuction.getXXMateaielOrderSign(tmp.rowNumber, tmp.sequence, tmp.no));

                    m_proInfoList.Add(m_proInfoList.Count, record);
                }
            }

            foreach (KeyValuePair <int, ProjectManagerDetailsTable> index3 in changeMaterielList)
            {
                ArrayList record1 = new ArrayList();

                ProjectManagerDetailsTable tmp1 = new ProjectManagerDetailsTable();
                tmp1 = index3.Value;

                // 单据需要的数量
                double requestValue1 = tmp1.value;

                // 已转数量
                double proValue1 = 0.0;

                if (m_dataType == 1)
                {
                    proValue1 = MaterielProOccupiedOrderDetails.getInctance().getMaterielProCountInfoFromProject(tmp1.materielID,
                                                                                                                 FormProjectInfoChange.getInctance().getxxMaterielNumberFromBillNumber(tmp1.billNumber));
                }
                else if (m_dataType == 2)
                {
                    proValue1 = PurchaseApplyOrderDetails.getInctance().getPurchaseValueFromProjectNumber(
                        FormProjectInfoChange.getInctance().getxxMaterielNumberFromBillNumber(tmp1.billNumber),
                        PublicFuction.getXXMateaielOrderSign(tmp1.rowNumber, tmp1.sequence, tmp1.no));
                }
                else if (m_dataType == 3)
                {
                    proValue1 = MaterielOutOrderDetails.getInctance().getMaterielCountInfoFromProject(
                        FormProjectInfoChange.getInctance().getxxMaterielNumberFromBillNumber(tmp1.billNumber),
                        PublicFuction.getXXMateaielOrderSign(tmp1.rowNumber, tmp1.sequence, tmp1.no));
                }

                if (requestValue1 - proValue1 > 0)
                {
                    record1.Add(tmp1.billNumber);
                    record1.Add(tmp1.materielID);
                    record1.Add(tmp1.value);
                    record1.Add(proValue1);

                    // 库存预占情况,本项目预占量
                    record1.Add(MaterielProOccupiedOrderDetails.getInctance().getMaterielProCountInfoFromProject(tmp1.materielID));
                    record1.Add(MaterielProOccupiedOrderDetails.getInctance().getMaterielProCountInfoFromProject(tmp1.materielID, tmp1.billNumber));

                    // 得到实际库存
                    InitMaterielTable MaterielCountdata = InitMateriel.getInctance().getMaterielInfoFromMaterielID(tmp1.materielID);
                    record1.Add(MaterielCountdata.value);

                    // 使用行号+序列号+序号的和作为一行数据的唯一标识
                    record1.Add(PublicFuction.getXXMateaielOrderSign(tmp1.rowNumber, tmp1.sequence, tmp1.no));

                    m_proInfoList.Add(m_proInfoList.Count, record1);
                }
            }

            if (m_proInfoList.Count == 0)
            {
                this.button1.Enabled = false;
            }

            this.label1.Text += ", 共有[" + Convert.ToString(m_proInfoList.Count) + "]条数据";
        }