private void save_Click(object sender, EventArgs e)
        {
            // 得到详细的销售信息
            ArrayList dataList = getMaterielProOccupiedDetailsValue();

            if (dataList.Count > 0)
            {
                // 销售订单表头和表尾信息
                MaterielProOccupiedOrderTable record = getMaterielProOccupiedOrderValue();
                if (orderInfoIsFull(record) && orderDetailsIsFull(dataList))
                {
                    MaterielProOccupiedOrder.getInctance().insert(record, false);
                    MaterielProOccupiedOrderDetails.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("此单据不包含任何交易信息,单据保存失败.");
            }
        }
示例#2
0
        private void toolStripButtonRefresh_Click(object sender, EventArgs e)
        {
            MaterielProOccupiedOrder.getInctance().refreshRecord();
            MaterielProOccupiedOrderDetails.getInctance().refreshRecord();

            updateDataGridView();
        }
        private void AutoGenerateMaterielPro(ArrayList purchaseOrderDetailsRecords)
        {
            // 形成物料表头信息
            MaterielProOccupiedOrderTable proOccupiedInfo = new MaterielProOccupiedOrderTable();

            proOccupiedInfo.tradingDate    = this.labelMakeDate.Text;
            proOccupiedInfo.billNumber     = this.labelBillNumber.Text;
            proOccupiedInfo.srcOrderNum    = this.labelBillNumber.Text;
            proOccupiedInfo.sumValue       = "0";
            proOccupiedInfo.sumMoney       = "0";
            proOccupiedInfo.applyStaffId   = DbPublic.getInctance().getCurrentLoginUserID();
            proOccupiedInfo.makeOrderStaff = DbPublic.getInctance().getCurrentLoginUserID();
            MaterielProOccupiedOrder.getInctance().insert(proOccupiedInfo, false);

            // 形成自动转库存详细信息
            ArrayList listDetails = new ArrayList();

            for (int i = 0; i < purchaseOrderDetailsRecords.Count; i++)
            {
                ProjectManagerDetailsTable recordPro = (ProjectManagerDetailsTable)purchaseOrderDetailsRecords[i];

                MaterielProOccupiedOrderDetailsTable record = new MaterielProOccupiedOrderDetailsTable();
                record.billNumber = this.labelBillNumber.Text;
                record.rowNumber  = Convert.ToString(recordPro.rowNumber);
                record.materielID = recordPro.materielID;
                record.price      = 0;
                record.value      = recordPro.value;
                record.note       = "";
                listDetails.Add(record);
            }
            MaterielProOccupiedOrderDetails.getInctance().insert(listDetails);
        }
示例#4
0
        private void updateDataGridView()
        {
            SortedDictionary <int, ArrayList> sortedDictionaryList = new SortedDictionary <int, ArrayList>();

            if (m_orderType == OrderType.MaterielProOccupied)
            {
                SortedDictionary <int, MaterielProOccupiedOrderDetailsTable> list = new SortedDictionary <int, MaterielProOccupiedOrderDetailsTable>();
                list = MaterielProOccupiedOrderDetails.getInctance().getAllMaterielProOccupiedOrderInfo();

                m_dataGridRecordCount = list.Count;

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

                    MaterielProOccupiedOrderTable orderInof = MaterielProOccupiedOrder.getInctance().getMaterielProOccupiedOrderInfoFromBillNumber(record.billNumber);

                    if (orderInof != null)
                    {
                        if (record.isCancel == "1" || record.value <= 0.00)
                        {
                            continue;
                        }

                        ArrayList temp = new ArrayList();

                        temp.Add(record.pkey);
                        temp.Add(record.materielName);
                        temp.Add(record.materielModel);

                        temp.Add(orderInof.applyStaffName);
                        temp.Add(orderInof.tradingDate);
                        temp.Add(record.value);

                        temp.Add(orderInof.billNumber);

                        if (orderInof.isReview.Length > 0)
                        {
                            temp.Add("已审核");
                            temp.Add(orderInof.orderrReviewName);
                            temp.Add(orderInof.reviewDate);
                        }
                        else
                        {
                            temp.Add("未审核");
                            temp.Add("");
                            temp.Add("");
                        }

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

                m_dateGridViewExtend.initDataGridViewData(sortedDictionaryList, 3);
            }
        }
示例#5
0
        private void toolStripButtonRefresh_Click(object sender, EventArgs e)
        {
            MaterielProOccupiedOrder.getInctance().refrensRecord();
            MaterielProOccupiedOrderDetails.getInctance().refrensRecord();
            getMaterielProOccupiedList();

            refreshTreeView();
            Materiel.getInctance().refrensRecord();
            updateDataGridView(Materiel.getInctance().getAllMaterielInfo());
        }
 private void toolStripButtonReview_Click(object sender, EventArgs e)
 {
     try
     {
         save_Click(sender, e);
         MaterielProOccupiedOrder.getInctance().billReview(m_billNumber, m_isRedBill);
     }
     catch (Exception exp)
     {
         MessageBoxExtend.messageError(exp.ToString());
     }
 }
        private void readBillInfoToUI()
        {
            // 单据表头表尾信息
            m_materieOutOrder = MaterielProOccupiedOrder.getInctance().getMaterielProOccupiedOrderInfoFromBillNumber(m_billNumber);

            m_applyStaffPkey = m_materieOutOrder.applyStaffId;

            this.labelTradingDate.Visible     = true;
            this.labelBillNumber.Visible      = true;
            this.labelMakeBillStaff.Visible   = true;
            this.labelReviewBillStaff.Visible = true;
            this.labelReviewDate.Visible      = true;
            this.labelSave.Visible            = true;
            this.labelSummary.Visible         = true;

            this.labelTradingDate.Text   = m_materieOutOrder.tradingDate;
            this.labelBillNumber.Text    = m_materieOutOrder.billNumber;
            this.labelMakeBillStaff.Text = m_materieOutOrder.makeOrderStaffName;
            this.labelSave.Text          = m_materieOutOrder.applyStaffName;
            this.labelSummary.Text       = m_materieOutOrder.exchangesUnit;

            // DataGridView 赋值
            writeBillDetailsInfoFromBillNumber(m_billNumber);

            // 如果单据已审核,则禁用页面所有控件
            if (m_materieOutOrder.isReview == "1")
            {
                this.labelReviewBillStaff.Text = m_materieOutOrder.orderrReviewName;
                this.labelReviewDate.Text      = m_materieOutOrder.reviewDate;
                this.panelIsReview.Visible     = true;

                this.save.Enabled = false;
                this.toolStripButtonReview.Enabled = false;

                this.panelTradingDate.Visible          = false;
                this.dateTimePickerTradingDate.Visible = false;
                this.textBoxSummary.Visible            = false;

                this.dataGridViewDataList.Enabled  = false;
                this.dataGridViewDataCount.Enabled = false;
            }
            else
            {
                this.labelReviewBillStaff.Visible = false;
                this.labelReviewDate.Visible      = false;
            }
        }
        private void save_Click(object sender, EventArgs e)
        {
            m_isSaveSuccess = false;

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

            this.ActiveControl = this.toolStrip1;

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

            if (dataList.Count > 0)
            {
                // 销售订单表头和表尾信息
                MaterielProOccupiedOrderTable record = getMaterielProOccupiedOrderValue();
                if (orderInfoIsFull(record) && orderDetailsIsFull(dataList))
                {
                    MaterielProOccupiedOrder.getInctance().insert(record, false);
                    MaterielProOccupiedOrderDetails.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("此单据不包含任何交易信息,单据保存失败.");
            }
        }
        private void toolStripButtonReview_Click(object sender, EventArgs e)
        {
            try
            {
                if (m_billNumber.Length > 0)
                {
                    save_Click(sender, e);

                    if (m_isSaveSuccess)
                    {
                        FormProject.getInctance().billReview(m_billNumber);

                        // 对应的库存单据审核
                        MaterielProOccupiedOrder.getInctance().billReview(m_billNumber, false, false);

                        MessageBoxExtend.messageOK("单据审核成功");
                    }
                }
            }
            catch (Exception exp)
            {
                MessageBoxExtend.messageError(exp.ToString());
            }
        }