Esempio n. 1
0
        private void writeBillDetailsInfoFromBillNumber(string billNumber)
        {
            // DataGridView 赋值
            SortedDictionary <int, MaterielOutOtherOrderDetailsTable> orderDetails =
                MaterielOutOtherOrderDetails.getInctance().getMaterielOutOtherInfoFromBillNumber(billNumber);

            foreach (KeyValuePair <int, MaterielOutOtherOrderDetailsTable> index in orderDetails)
            {
                MaterielOutOtherOrderDetailsTable record = new MaterielOutOtherOrderDetailsTable();
                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.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;
            }
        }
Esempio n. 2
0
        private void save_Click(object sender, EventArgs e)
        {
            // 得到详细的销售信息
            ArrayList dataList = getMaterielOutOtherOrderDetailsValue();

            if (dataList.Count > 0)
            {
                // 销售订单表头和表尾信息
                MaterielOutOtherOrderTable record = getMaterielOutOtherOrderValue();
                if (orderInfoIsFull(record) && orderDetailsIsFull(dataList))
                {
                    MaterielOutOtherOrder.getInctance().insert(record, false);
                    MaterielOutOtherOrderDetails.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("此单据不包含任何交易信息,单据保存失败.");
            }
        }
        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();
        }
Esempio n. 4
0
        private void save_Click(object sender, EventArgs e)
        {
            m_isSaveSuccess = false;

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

            this.ActiveControl = this.toolStrip1;

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

            if (dataList.Count > 0)
            {
                // 销售订单表头和表尾信息
                MaterielOutOtherOrderTable record = getMaterielOutOtherOrderValue();
                if (orderInfoIsFull(record) && orderDetailsIsFull(dataList))
                {
                    MaterielOutOtherOrder.getInctance().insert(record, false);
                    MaterielOutOtherOrderDetails.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("此单据不包含任何交易信息,单据保存失败.");
            }
        }