Exemple #1
0
        private SortedDictionary <int, ArrayList> getSaleCostDetailsData(out double sumTotleValue, out double sumTotleMoney)
        {
            SortedDictionary <int, ArrayList> sortedDictionaryList = new SortedDictionary <int, ArrayList>();
            SortedDictionary <int, SaleProfitCounInfoStruct> list  = new SortedDictionary <int, SaleProfitCounInfoStruct>();

            list = SaleOutOrderDetails.getInctance().getSaleOutOrderDetailsInfo(m_countStartDate, m_countEndDate, m_isCountAllBill);

            m_dataGridRecordCount = list.Count;
            sumTotleValue         = 0;
            sumTotleMoney         = 0;

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

                ArrayList temp = new ArrayList();

                temp.Add(index + 1);
                temp.Add(record.materielID);
                temp.Add(record.materielName);
                temp.Add(record.materielUnitSale);
                temp.Add(record.priceCost);
                temp.Add(record.value);
                temp.Add(record.costSum);

                sumTotleValue += record.valueSum;
                sumTotleMoney += record.costSum;

                sortedDictionaryList.Add(index, temp);
            }

            return(sortedDictionaryList);
        }
Exemple #2
0
        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("此单据不包含任何交易信息,单据保存失败.");
            }
        }
Exemple #3
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);
        }
Exemple #4
0
        private SortedDictionary <int, ArrayList> getSaleMaterielData(out double sumTotleMoney)
        {
            SortedDictionary <int, ArrayList> sortedDictionaryList = new SortedDictionary <int, ArrayList>();
            SortedDictionary <int, SaleOutOrderDetailsTable> list  = new SortedDictionary <int, SaleOutOrderDetailsTable>();

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

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

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

                ArrayList temp = new ArrayList();

                temp.Add(index + 1);
                temp.Add(record.materielID);
                temp.Add(record.materielName);
                temp.Add(record.materielModel);
                temp.Add(record.totalMoney);
                temp.Add(getPercentValue(record.totalMoney, sumTotleMoney));

                sortedDictionaryList.Add(index, temp);
            }

            return(sortedDictionaryList);
        }
        private 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 #6
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();
        }
        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("此单据不包含任何交易信息,单据保存失败.");
            }
        }
Exemple #8
0
        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;
            }
        }