Пример #1
0
        private void writeBillDetailsInfoFromBillNumber(string billNumber)
        {
            // DataGridView 赋值
            SortedDictionary <int, MaterielInOtherOrderDetailsTable> orderDetails =
                MaterielInOtherOrderDetails.getInctance().getMaterielInOtherInfoFromBillNumber(billNumber);

            foreach (KeyValuePair <int, MaterielInOtherOrderDetailsTable> index in orderDetails)
            {
                MaterielInOtherOrderDetailsTable record = new MaterielInOtherOrderDetailsTable();
                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.Model].Value     = record.materielModel;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Parameter].Value = materielInfo.materielParameter;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Brand].Value     = materielInfo.brand;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Unit].Value      =
                    AuxiliaryMaterial.getInctance().getAuxiliaryMaterialNameFromPkey("BASE_UNIT_LIST", materielInfo.unitSale);
                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;
            }
        }
Пример #2
0
        private void save_Click(object sender, EventArgs e)
        {
            // 得到详细的销售信息
            ArrayList dataList = getMaterielInOtherOrderDetailsValue();

            if (dataList.Count > 0)
            {
                // 销售订单表头和表尾信息
                MaterielInOtherOrderTable record = getMaterielInOtherOrderValue();
                if (orderInfoIsFull(record) && orderDetailsIsFull(dataList))
                {
                    MaterielInOtherOrder.getInctance().insert(record, false);
                    MaterielInOtherOrderDetails.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 save_Click(object sender, EventArgs e)
        {
            m_isSaveSuccess = false;

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

            this.ActiveControl = this.toolStrip1;

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

            if (dataList.Count > 0)
            {
                // 销售订单表头和表尾信息
                MaterielInOtherOrderTable record = getMaterielInOtherOrderValue();
                if (orderInfoIsFull(record) && orderDetailsIsFull(dataList))
                {
                    MaterielInOtherOrder.getInctance().insert(record, false);
                    MaterielInOtherOrderDetails.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("此单据不包含任何交易信息,单据保存失败.");
            }
        }
Пример #4
0
        private void writeBillDetailsInfoFromBillNumber(string billNumber)
        {
            // DataGridView 赋值
            SortedDictionary <int, MaterielInOtherOrderDetailsTable> orderDetails =
                MaterielInOtherOrderDetails.getInctance().getMaterielInOtherInfoFromBillNumber(billNumber);

            foreach (KeyValuePair <int, MaterielInOtherOrderDetailsTable> index in orderDetails)
            {
                MaterielInOtherOrderDetailsTable record = new MaterielInOtherOrderDetailsTable();
                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.Note].Value           = record.note;
            }
        }