示例#1
0
        private void save_Click(object sender, EventArgs e)
        {
            SaleQuotationOrderTable saleQuotationOrder = new SaleQuotationOrderTable();


            saleQuotationOrder.customerName = this.labelSaleQuotationName.Text;
            saleQuotationOrder.date         = this.labelTradingDate.Text;
            saleQuotationOrder.billNumber   = this.labelBillNumber.Text;

            saleQuotationOrder.content = this.textBoxContent.Text;
            saleQuotationOrder.note    = this.textBoxNote.Text;

            saleQuotationOrder.salemanName   = this.labelBusinessPeople.Text;
            saleQuotationOrder.makeOrderName = this.labelMakeBillStaff.Text;
            saleQuotationOrder.contact       = this.labelContact.Text;
            saleQuotationOrder.tel           = this.labelTel.Text;


            if (m_billNumber.Length == 0)
            {
                SaleQuotationOrder.getInctance().insert(saleQuotationOrder);
            }
            else
            {
                SaleQuotationOrder.getInctance().update(m_billNumber, saleQuotationOrder);
            }

            this.Close();

            BillNumber.getInctance().inserBillNumber(BillTypeNumber, this.labelTradingDate.Text, this.labelBillNumber.Text.ToString());
        }
示例#2
0
        private void readBillInfoToUI()
        {
            // 单据表头表尾信息
            m_saleQuotationOrder = SaleQuotationOrder.getInctance().getSaleQuotationOrderInfoFromBillNumber(m_billNumber);

            this.labelSaleQuotationName.Visible = true;
            this.labelTradingDate.Visible       = true;
            this.labelBillNumber.Visible        = true;
            this.textBoxContent.Visible         = true;
            this.textBoxNote.Visible            = true;
            this.labelBusinessPeople.Visible    = true;
            this.labelMakeBillStaff.Visible     = true;
            this.labelContact.Visible           = true;
            this.labelTel.Visible = true;

            this.labelSaleQuotationName.Text = m_saleQuotationOrder.customerName;
            this.labelTradingDate.Text       = m_saleQuotationOrder.date;
            this.labelBillNumber.Text        = m_saleQuotationOrder.billNumber;

            this.textBoxContent.Text = m_saleQuotationOrder.content;
            this.textBoxNote.Text    = m_saleQuotationOrder.note;

            this.labelBusinessPeople.Text = m_saleQuotationOrder.salemanName;
            this.labelMakeBillStaff.Text  = m_saleQuotationOrder.makeOrderName;
            this.labelContact.Text        = m_saleQuotationOrder.contact;
            this.labelTel.Text            = m_saleQuotationOrder.tel;
        }
        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();
        }
示例#4
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);
            }
        }