コード例 #1
0
ファイル: FormSaleOutOrder.cs プロジェクト: EnoWillian/erp-1
        private bool saleOrderIsFull(SaleOutOrderTable record)
        {
            if (record.customerId == -1)
            {
                MessageBoxExtend.messageWarning("客户信息不完整,单据保存失败");
                return(false);
            }

            if (record.tradingDate.Length == 0)
            {
                MessageBoxExtend.messageWarning("日期不完整,单据保存失败");
                return(false);
            }

            if (record.billNumber.Length == 0)
            {
                MessageBoxExtend.messageWarning("单据号信息不完整,单据保存失败");
                return(false);
            }

            if (record.saleType.Length == 0)
            {
                MessageBoxExtend.messageWarning("销售信息不完整,单据保存失败");
                return(false);
            }

            if (record.businessPeopleId == -1)
            {
                MessageBoxExtend.messageWarning("业务员信息不完整,单据保存失败");
                return(false);
            }

            return(true);
        }
コード例 #2
0
ファイル: FormSaleOutOrder.cs プロジェクト: EnoWillian/erp-1
        private void save_Click(object sender, EventArgs e)
        {
            // 得到详细的销售信息
            ArrayList dataList = getSaleOutOrderDetailsValue();

            if (dataList.Count > 0)
            {
                // 销售订单表头和表尾信息
                SaleOutOrderTable record = getSaleOutOrderValue();
                if (saleOrderIsFull(record) && saleOrderDetailsIsFull(dataList))
                {
                    SaleOutOrder.getInctance().insert(record, false);
                    SaleOutOrderDetails.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("此单据不包含任何交易信息,单据保存失败.");
            }
        }
コード例 #3
0
        private void exportproductOutData()
        {
            int startRowIndex = 6;
            // 销售出库单单数据导出
            SaleOutOrderTable table = new SaleOutOrderTable();

            table = SaleOutOrder.getInctance().getSaleInfoFromBillNumber(m_billNubmber);

            stringReplace(table.billNumber, "[1]");
            stringReplace(table.exchangesUnit, "[2]");
            stringReplace(table.tradingDate, "[3]");
            stringReplace(table.makeOrderStaffName, "[5]");

            double sum = 0.0;

            for (int row = 0; row < m_dataGridView.RowCount; row++)
            {
                if (m_dataGridView.Rows[row].Cells[(int)FormSaleOutOrder.DataGridColumnName.MatetielNumber].Value.ToString().Length == 0)
                {
                    break;
                }

                m_excelApp.Cells[row + startRowIndex, 2] = m_dataGridView.Rows[row].Cells[(int)FormSaleOutOrder.DataGridColumnName.MatetielName].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 3] = m_dataGridView.Rows[row].Cells[(int)FormSaleOutOrder.DataGridColumnName.Model].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 4] = m_dataGridView.Rows[row].Cells[(int)FormSaleOutOrder.DataGridColumnName.Unit].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 5] = m_dataGridView.Rows[row].Cells[(int)FormSaleOutOrder.DataGridColumnName.Value].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 6] = m_dataGridView.Rows[row].Cells[(int)FormSaleOutOrder.DataGridColumnName.MakeNum].Value.ToString().Trim();

                sum += Convert.ToDouble(m_dataGridView.Rows[row].Cells[(int)FormSaleOutOrder.DataGridColumnName.Value].Value.ToString().Trim());
            }

            stringReplace(Convert.ToString(sum), "[4]");
        }
コード例 #4
0
        private SortedDictionary <int, ArrayList> getSaleHistoryPriceData()
        {
            SortedDictionary <int, ArrayList>         sortedDictionaryList = new SortedDictionary <int, ArrayList>();
            SortedDictionary <int, SaleOutOrderTable> list = new SortedDictionary <int, SaleOutOrderTable>();

            list = SaleOutOrderDetails.getInctance().getSalePriceCountInfo(m_materielID, m_countStartDate, m_countEndDate);

            m_dataGridRecordCount = list.Count;

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

                ArrayList temp = new ArrayList();

                temp.Add(index + 1);
                temp.Add(record.billNumber);
                temp.Add(record.customerId);
                temp.Add(record.customerName);
                temp.Add(record.tradingDate);
                temp.Add(record.totalMoney);
                temp.Add(record.sumValue);

                sortedDictionaryList.Add(index, temp);
            }

            return(sortedDictionaryList);
        }
コード例 #5
0
        private SortedDictionary <int, ArrayList> getSaleCustomerData(out double sumTotleMoney)
        {
            SortedDictionary <int, ArrayList>         sortedDictionaryList = new SortedDictionary <int, ArrayList>();
            SortedDictionary <int, SaleOutOrderTable> list = new SortedDictionary <int, SaleOutOrderTable>();

            list = SaleOutOrder.getInctance().getSaleOutOrderCountInfo(m_countStartDate, m_countEndDate, m_isCountAllBill, 1);

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

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

                ArrayList temp = new ArrayList();

                temp.Add(index + 1);
                temp.Add(record.customerId);
                temp.Add(record.customerName);
                temp.Add(record.totalMoney);
                temp.Add(getPercentValue(Convert.ToDouble(record.totalMoney.ToString()), sumTotleMoney));

                sortedDictionaryList.Add(index, temp);
            }

            return(sortedDictionaryList);
        }
コード例 #6
0
        private double getSumTotleMoney(SortedDictionary <int, SaleOutOrderTable> list)
        {
            double sumTotleMoney = 0.0;

            for (int index = 0; index < list.Count; index++)
            {
                SaleOutOrderTable record = new SaleOutOrderTable();
                record         = (SaleOutOrderTable)list[index];
                sumTotleMoney += Convert.ToDouble(record.totalMoney.ToString());
            }

            return(sumTotleMoney);
        }
コード例 #7
0
ファイル: FormSaleOutOrder.cs プロジェクト: EnoWillian/erp-1
        private SaleOutOrderTable getSaleOutOrderValue()
        {
            SaleOutOrderTable record = new SaleOutOrderTable();

            record.customerId       = m_customerPkey;
            record.tradingDate      = this.labelTradingDate.Text;
            record.billNumber       = this.labelBillNumber.Text;
            record.saleType         = this.labelSaleType.Text;
            record.paymentDate      = this.labelPaymentDate.Text;
            record.exchangesUnit    = this.labelSummary.Text;
            record.sourceBillType   = this.labelSourceOrderType.Text;
            record.sourceBillNumber = this.labelSourceOrderNumber.Text;

            record.sumValue = this.dataGridViewDataCount.Rows[0].Cells[(int)DataGridColumnName.Value].Value.ToString();
            record.sumMoney = this.dataGridViewDataCount.Rows[0].Cells[(int)DataGridColumnName.Turnover].Value.ToString();

            record.sumTransportationCost = this.dataGridViewDataCount.Rows[0].Cells[(int)DataGridColumnName.TransportationCost].Value.ToString();
            record.sumOtherCost          = this.dataGridViewDataCount.Rows[0].Cells[(int)DataGridColumnName.OtherCost].Value.ToString();
            record.totalMoney            = this.dataGridViewDataCount.Rows[0].Cells[(int)DataGridColumnName.SumTurnover].Value.ToString();

            record.staffSaveId  = m_staffSavePkey;
            record.staffCheckId = m_staffCheckPkey;

            record.businessPeopleId = m_staffPkey;

            if (m_billNumber.Length == 0)
            {
                record.makeOrderStaff = DbPublic.getInctance().getCurrentLoginUserID();
            }
            else
            {
                record.makeOrderStaff = m_saleOutOrder.makeOrderStaff;
            }

            if (m_isRedBill)
            {
                record.isRedBill = 1;
            }
            else
            {
                record.isRedBill = 0;
            }

            return(record);
        }
コード例 #8
0
        private void save_Click(object sender, EventArgs e)
        {
            m_isSaveSuccess = false;

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

            this.ActiveControl = this.toolStrip1;

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

            if (dataList.Count > 0)
            {
                // 销售订单表头和表尾信息
                SaleOutOrderTable record = getSaleOutOrderValue();
                if (saleOrderIsFull(record) && saleOrderDetailsIsFull(dataList))
                {
                    SaleOutOrder.getInctance().insert(record, false);
                    SaleOutOrderDetails.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("此单据不包含任何交易信息,单据保存失败.");
            }
        }
コード例 #9
0
        private void updateDataGridView()
        {
            SortedDictionary <int, ArrayList> sortedDictionaryList = new SortedDictionary <int, ArrayList>();

            if (m_orderType == OrderType.SaleOrder)
            {
                SortedDictionary <int, SaleOrderTable> list = new SortedDictionary <int, SaleOrderTable>();
                list = SaleOrder.getInctance().getAllSaleOrderInfo();

                m_dataGridRecordCount = list.Count;

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

                    if (m_filter.startDate == null ||
                        (record.tradingDate.CompareTo(m_filter.startDate) >= 0 &&
                         record.tradingDate.CompareTo(m_filter.endDate) <= 0)
                        )
                    {
                        ArrayList temp = new ArrayList();

                        temp.Add(record.pkey);
                        temp.Add(record.customerName);
                        temp.Add(record.tradingDate);
                        temp.Add(record.billNumber);
                        temp.Add(record.saleType);
                        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.SaleOut)
            {
                SortedDictionary <int, SaleOutOrderTable> list = new SortedDictionary <int, SaleOutOrderTable>();
                list = SaleOutOrder.getInctance().getAllSaleOutOrderInfo();

                m_dataGridRecordCount = list.Count;

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

                    if (m_filter.startDate == null ||
                        (record.tradingDate.CompareTo(m_filter.startDate) >= 0 &&
                         record.tradingDate.CompareTo(m_filter.endDate) <= 0)
                        )
                    {
                        ArrayList temp = new ArrayList();

                        temp.Add(record.pkey);
                        temp.Add(record.customerName);
                        temp.Add(record.tradingDate);
                        temp.Add(record.billNumber);
                        temp.Add(record.saleType);
                        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.SaleInvoice)
            {
            }
            else if (m_orderType == OrderType.SaleOrderExcute)
            {
                SortedDictionary <int, SaleOrderTable> list = new SortedDictionary <int, SaleOrderTable>();
                list = SaleOrder.getInctance().getAllSaleOrderInfo();

                m_dataGridRecordCount = list.Count;

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

                    if (m_filter.startDate == null ||
                        (record.tradingDate.CompareTo(m_filter.startDate) >= 0 &&
                         record.tradingDate.CompareTo(m_filter.endDate) <= 0)
                        )
                    {
                        ArrayList temp = new ArrayList();

                        temp.Add(record.pkey);
                        temp.Add(record.customerName);
                        temp.Add(record.tradingDate);
                        temp.Add(record.billNumber);
                        temp.Add(record.deliveryDate);
                        temp.Add(record.sumValue);

                        if (record.isInStorage == "0")
                        {
                            temp.Add("否");
                        }
                        else
                        {
                            temp.Add("是");
                        }

                        temp.Add(record.actualValue);
                        temp.Add(record.businessPeopleName);

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

                m_dateGridViewExtend.initDataGridViewData(sortedDictionaryList, 3);
            }
            else if (m_orderType == OrderType.SaleOutOrderExcute)
            {
                SortedDictionary <int, SaleOutOrderTable> list = new SortedDictionary <int, SaleOutOrderTable>();
                list = SaleOutOrder.getInctance().getAllSaleOutOrderInfo();

                m_dataGridRecordCount = list.Count;

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

                    if (m_filter.startDate == null ||
                        (record.tradingDate.CompareTo(m_filter.startDate) >= 0 &&
                         record.tradingDate.CompareTo(m_filter.endDate) <= 0)
                        )
                    {
                        ArrayList temp = new ArrayList();

                        temp.Add(record.pkey);
                        temp.Add(record.customerName);
                        temp.Add(record.tradingDate);
                        temp.Add(record.billNumber);
                        temp.Add(record.saleType);
                        temp.Add(record.paymentDate);
                        temp.Add(record.totalMoney);
                        temp.Add(record.paymentOk);
                        temp.Add(record.paymentNoOk);
                        temp.Add(record.businessPeopleName);

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

                m_dateGridViewExtend.initDataGridViewData(sortedDictionaryList, 3);
            }
            else if (m_orderType == OrderType.SaleQuotation)
            {
                SortedDictionary <int, SaleQuotationOrderTable> list = new SortedDictionary <int, SaleQuotationOrderTable>();
                list = SaleQuotationOrder.getInctance().getAllSaleQuotationOrderInfo();

                m_dataGridRecordCount = list.Count;

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

                    if (m_filter.startDate == null ||
                        (record.date.CompareTo(m_filter.startDate) >= 0 &&
                         record.date.CompareTo(m_filter.endDate) <= 0)
                        )
                    {
                        ArrayList temp = new ArrayList();

                        temp.Add(record.pkey);
                        temp.Add(record.customerName);
                        temp.Add(record.date);
                        temp.Add(record.billNumber);
                        temp.Add(record.content);
                        temp.Add(record.note);
                        temp.Add(record.salemanName);
                        temp.Add(record.contact);
                        temp.Add(record.tel);

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

                m_dateGridViewExtend.initDataGridViewData(sortedDictionaryList, 3);
            }
            else if (m_orderType == OrderType.StorageMaterielOut)
            {
                // 生产领料单序时薄
                SortedDictionary <int, MaterielOutOrderTable> list = new SortedDictionary <int, MaterielOutOrderTable>();
                list = MaterielOutOrder.getInctance().getAllMaterielOutOrderInfo();

                m_dataGridRecordCount = list.Count;

                for (int index = 0; index < list.Count; index++)
                {
                    bool isDisplayRecord         = false;
                    MaterielOutOrderTable record = new MaterielOutOrderTable();
                    record = (MaterielOutOrderTable)list[index];

                    if (m_filter.startDate == null ||
                        (record.tradingDate.CompareTo(m_filter.startDate) >= 0 &&
                         record.tradingDate.CompareTo(m_filter.endDate) <= 0)
                        )
                    {
                        // 等于0代表只显示已审核单据
                        if (m_filter.allReview == "0")
                        {
                            if (record.isReview == "1")
                            {
                                if (m_filter.billColor == "0")  // 需要显示蓝字单据
                                {
                                    if (record.isRedBill == 0)
                                    {
                                        isDisplayRecord = true;
                                    }
                                }
                                else if (m_filter.billColor == "1")  // 需要显示红字单据
                                {
                                    if (record.isRedBill == 1)
                                    {
                                        isDisplayRecord = true;
                                    }
                                }
                                else                                // 需要显示全部颜色单据
                                {
                                    isDisplayRecord = true;
                                }
                            }
                        }
                        else
                        {
                            if (m_filter.billColor == "0")  // 需要显示蓝字单据
                            {
                                if (record.isRedBill == 0)
                                {
                                    isDisplayRecord = true;
                                }
                            }
                            else if (m_filter.billColor == "1")  // 需要显示红字单据
                            {
                                if (record.isRedBill == 1)
                                {
                                    isDisplayRecord = true;
                                }
                            }
                            else                                // 需要显示全部颜色单据
                            {
                                isDisplayRecord = true;
                            }
                        }
                    }

                    if (isDisplayRecord)
                    {
                        ArrayList temp = new ArrayList();

                        temp.Add(record.pkey);
                        temp.Add(record.departmentName);
                        temp.Add(record.tradingDate);
                        temp.Add(record.billNumber);
                        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.StorageOutCheck)
            {
                // 盘亏毁损单序时薄
                SortedDictionary <int, MaterielOutEarningsOrderTable> list = new SortedDictionary <int, MaterielOutEarningsOrderTable>();
                list = MaterielOutEarningsOrder.getInctance().getAllMaterielOutEarningsOrderInfo();

                m_dataGridRecordCount = list.Count;

                for (int index = 0; index < list.Count; index++)
                {
                    bool isDisplayRecord = false;
                    MaterielOutEarningsOrderTable record = new MaterielOutEarningsOrderTable();
                    record = (MaterielOutEarningsOrderTable)list[index];

                    if (m_filter.startDate == null ||
                        (record.tradingDate.CompareTo(m_filter.startDate) >= 0 &&
                         record.tradingDate.CompareTo(m_filter.endDate) <= 0)
                        )
                    {
                        // 等于0代表只显示已审核单据
                        if (m_filter.allReview == "0")
                        {
                            if (record.isReview == "1")
                            {
                                if (m_filter.billColor == "0")  // 需要显示蓝字单据
                                {
                                    if (record.isRedBill == 0)
                                    {
                                        isDisplayRecord = true;
                                    }
                                }
                                else if (m_filter.billColor == "1")  // 需要显示红字单据
                                {
                                    if (record.isRedBill == 1)
                                    {
                                        isDisplayRecord = true;
                                    }
                                }
                                else                                // 需要显示全部颜色单据
                                {
                                    isDisplayRecord = true;
                                }
                            }
                        }
                        else
                        {
                            if (m_filter.billColor == "0")  // 需要显示蓝字单据
                            {
                                if (record.isRedBill == 0)
                                {
                                    isDisplayRecord = true;
                                }
                            }
                            else if (m_filter.billColor == "1")  // 需要显示红字单据
                            {
                                if (record.isRedBill == 1)
                                {
                                    isDisplayRecord = true;
                                }
                            }
                            else                                // 需要显示全部颜色单据
                            {
                                isDisplayRecord = true;
                            }
                        }
                    }

                    if (isDisplayRecord)
                    {
                        ArrayList temp = new ArrayList();

                        temp.Add(record.pkey);
                        temp.Add("");
                        temp.Add(record.tradingDate);
                        temp.Add(record.billNumber);
                        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.StorageOutOther)
            {
                // 其他出库单序时薄
                SortedDictionary <int, MaterielOutOtherOrderTable> list = new SortedDictionary <int, MaterielOutOtherOrderTable>();
                list = MaterielOutOtherOrder.getInctance().getAllMaterielOutOtherOrderInfo();

                m_dataGridRecordCount = list.Count;

                for (int index = 0; index < list.Count; index++)
                {
                    bool isDisplayRecord = false;
                    MaterielOutOtherOrderTable record = new MaterielOutOtherOrderTable();
                    record = (MaterielOutOtherOrderTable)list[index];

                    if (m_filter.startDate == null ||
                        (record.tradingDate.CompareTo(m_filter.startDate) >= 0 &&
                         record.tradingDate.CompareTo(m_filter.endDate) <= 0)
                        )
                    {
                        // 等于0代表只显示已审核单据
                        if (m_filter.allReview == "0")
                        {
                            if (record.isReview == "1")
                            {
                                if (m_filter.billColor == "0")  // 需要显示蓝字单据
                                {
                                    if (record.isRedBill == 0)
                                    {
                                        isDisplayRecord = true;
                                    }
                                }
                                else if (m_filter.billColor == "1")  // 需要显示红字单据
                                {
                                    if (record.isRedBill == 1)
                                    {
                                        isDisplayRecord = true;
                                    }
                                }
                                else                                // 需要显示全部颜色单据
                                {
                                    isDisplayRecord = true;
                                }
                            }
                        }
                        else
                        {
                            if (m_filter.billColor == "0")  // 需要显示蓝字单据
                            {
                                if (record.isRedBill == 0)
                                {
                                    isDisplayRecord = true;
                                }
                            }
                            else if (m_filter.billColor == "1")  // 需要显示红字单据
                            {
                                if (record.isRedBill == 1)
                                {
                                    isDisplayRecord = true;
                                }
                            }
                            else                                // 需要显示全部颜色单据
                            {
                                isDisplayRecord = true;
                            }
                        }
                    }

                    if (isDisplayRecord)
                    {
                        ArrayList temp = new ArrayList();

                        temp.Add(record.pkey);
                        temp.Add("");
                        temp.Add(record.tradingDate);
                        temp.Add(record.billNumber);
                        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);
            }
        }
コード例 #10
0
ファイル: FormSaleOutOrder.cs プロジェクト: EnoWillian/erp-1
        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;
            }
        }