private void FormProjectMaterielOrder_Load(object sender, EventArgs e)
        {
            // DataGridView初始化
            dataGridViewInit();

            if (m_billNumber.Length == 0)
            {
                // 单据号
                this.labelBillNumber.Text = BillNumber.getInctance().getNewBillNumber(BillTypeNumber, DateTime.Now.ToString("yyyy-MM-dd"));

                // 制单人初始化
                this.labelMakeBillStaff.Visible = true;
                this.labelMakeBillStaff.Text = DbPublic.getInctance().getCurrentLoginUserName();

                // 制单日期初始化
                this.labelMakeDate.Visible = true;
                this.labelMakeDate.Text = DateTime.Now.ToString("yyyy-MM-dd");

                FormProjectMaterielTable tmp = FormProject.getInctance().getProjectInfoFromBillNumber(this.labelSrcOrderBillNum.Text);
                this.labelProjectName.Text = tmp.projectName;
                this.labelProjectNo.Text = tmp.projectNum;
                this.labelMakeNo.Text = tmp.makeNum;
                this.labelDevMode.Text = tmp.deviceMode;
            }
            else
            {
                readBillInfoToUI();
            }

            // 权限判断
            setPageActionEnable();
        }
Пример #2
0
        private void updateDataGridView()
        {
            m_projectInfoList.Clear();

            if (m_proInfo.billNumber.Length > 0)
            {
                FormProjectMaterielTable record = FormProject.getInctance().getProjectInfoFromBillNumber(m_proInfo.billNumber);
                getInfoListFromBillNumber(record);
            }
            else
            {
                SortedDictionary <int, FormProjectMaterielTable> list = new SortedDictionary <int, FormProjectMaterielTable>();
                list = FormProject.getInctance().getAllPurchaseOrderInfo(m_proInfo.projectNum, m_proInfo.allReview, m_orderType);

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

                    getInfoListFromBillNumber(record);
                }
            }

            initDataGridViewData(m_projectInfoList, 3);

            m_dataGridRecordCount = m_projectInfoList.Count;
        }
Пример #3
0
        private void checkAccountBillDetaile()
        {
            int orderType = FormProject.getInctance().getOrderTypeFromBillNumber(m_billNumber);

            FormProjectMaterielOrder fpmo = new FormProjectMaterielOrder(orderType, m_billNumber);

            fpmo.ShowDialog();
        }
Пример #4
0
        private void FormMaterielDetailed_Load(object sender, EventArgs e)
        {
            // 物料基本信息
            this.labelMaterielID.Text = Convert.ToString(m_materielID);
            MaterielTable record = Materiel.getInctance().getMaterielInfoFromPkey(m_materielID);

            this.labelMaterielName.Text = record.name;

            // 实际库存+预占
            InitMaterielTable MaterielCountdata = InitMateriel.getInctance().getMaterielInfoFromMaterielID(m_materielID);

            this.labelCount.Text    = Convert.ToString(MaterielCountdata.value);
            this.labelProCount.Text = Convert.ToString(MaterielProOccupiedOrderDetails.getInctance().getMaterielProCountInfoFromProject(m_materielID));

            // 材料表情况
            if (m_xxMaterielTablebillNubmber.Length > 0)
            {
                this.labelxxMaterielTableNum.Text = m_xxMaterielTablebillNubmber;

                FormProjectMaterielTable projectInfo = FormProject.getInctance().getProjectInfoFromBillNumber(m_xxMaterielTablebillNubmber);
                this.labelProjectNum.Text = projectInfo.projectNum;
                this.labelProName.Text    = projectInfo.projectName;
                this.labelDevMode.Text    = projectInfo.deviceMode;

                SortedDictionary <int, ProjectManagerDetailsTable> list =
                    ProjectManagerDetails.getInctance().getPurchaseInfoFromBillNumber(m_xxMaterielTablebillNubmber);


                foreach (KeyValuePair <int, ProjectManagerDetailsTable> index in list)
                {
                    if (index.Value.materielID == m_materielID)
                    {
                        this.labelSub.Text = index.Value.deviceName;

                        this.labelNum.Text     = index.Value.no;
                        this.labelSquence.Text = index.Value.sequence;

                        this.label1Value.Text  = Convert.ToString(index.Value.value);
                        this.labelUseDate.Text = index.Value.useDate;

                        break;
                    }
                }
            }
            else
            {
                this.labelxxMaterielTableNum.Text = "     ";
                this.labelProjectNum.Text         = "     ";
                this.labelProName.Text            = "     ";
                this.labelDevMode.Text            = "     ";
                this.labelSub.Text     = "     ";
                this.label1Value.Text  = "     ";
                this.labelUseDate.Text = "     ";
                this.labelNum.Text     = "     ";
                this.labelSquence.Text = "     ";
                this.labelUseDate.Text = "     ";
            }
        }
Пример #5
0
        private void readProInfoListToUI()
        {
            for (int index = 0; index < m_proInfoList.Count; index++)
            {
                ArrayList record = new ArrayList();
                record = m_proInfoList[index];

                if (index == 0)
                {
                    this.labelTradingDate.Visible = true;
                    this.labelTradingDate.Text    = DateTime.Now.ToString("yyyy-MM-dd");

                    // 单据号
                    this.labelBillNumber.Text = BillNumber.getInctance().getNewBillNumber(BillTypeNumber, DateTime.Now.ToString("yyyy-MM-dd"));

                    // 制单人初始化
                    this.labelMakeBillStaff.Visible = true;
                    this.labelMakeBillStaff.Text    = DbPublic.getInctance().getCurrentLoginUserName();

                    // 项目编号初始
                    this.textBoxProjectNo.Visible  = false;
                    this.textBoxProjectNo.ReadOnly = true;

                    this.labelProjectNo.Visible = true;
                    this.labelProjectNo.Text    = record[0].ToString();
                    this.labelProjectNo.Visible = true;

                    // 生产编号初始化
                    FormProjectMaterielTable proInfo = FormProject.getInctance().getProjectInfoFromBillNumber(record[0].ToString());
                    this.textBoxMakeNo.Visible = false;
                    //this.textBoxMakeNo.ReadOnly = true;

                    this.labelMakeNo.Visible = true;
                    this.labelMakeNo.Text    = proInfo.makeNum;
                    this.labelMakeNo.Visible = true;

                    m_materieOutOrder.isReview = "1";
                }

                setMatetielInfoToDataGridView(Convert.ToString(record[1]), index);
                dataGridViewDataList.Rows[index].Cells[(int)DataGridColumnName.Value].Value = Convert.ToDouble(record[2]) - Convert.ToDouble(record[3]);


                string xxMatetielTableRowNum = Convert.ToString(record[7]);
                if (xxMatetielTableRowNum.Length > 0)
                {
                    ProjectManagerDetailsTable tmp = ProjectManagerDetails.getInctance().getMaterielInfoFromRowNum(record[0].ToString(), Convert.ToInt32(record[7]));
                    if (tmp.materielSize != null && tmp.materielSize.Length > 0)
                    {
                        dataGridViewDataList.Rows[index].Cells[(int)DataGridColumnName.Note].Value = "尺寸:" + tmp.materielSize;
                    }
                }

                dataGridViewDataList.Rows[index].Cells[(int)DataGridColumnName.xxMatetielTableRowNum].Value = Convert.ToString(record[7]);

                setTurnoverInfoDataGridView(index);
            }
        }
        private void save_Click(object sender, EventArgs e)
        {
            m_isSaveSuccess = false;

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

            this.ActiveControl = this.toolStrip1;

            // 得到详细的采购信息
            ArrayList dataList = getOrderDetailsValue();

            if (dataList.Count > 0)
            {
                // 采购订单表头和表尾信息
                geTableHadeAndEndValue();

                if (purchaseOrderIsFull(m_currentOrderInfo) && purchaseOrderDetailsIsFull(dataList))
                {
                    FormProject.getInctance().insert(m_currentOrderInfo, false);
                    ProjectManagerDetails.getInctance().insert(dataList);
                    BillNumber.getInctance().inserBillNumber(BillTypeNumber + m_tablesType, this.labelTradingDate.Text, this.labelBillNumber.Text.ToString());

                    m_isSaveSuccess = true;

                    if (m_billNumber.Length == 0)
                    {
                        MessageBoxExtend.messageOK("数据保存成功");
                    }

                    // 自动形成库存占用
                    AutoGenerateMaterielPro(dataList);

                    this.Close();
                }
            }
            else
            {
                MessageBoxExtend.messageWarning("此单据不包含任何交易信息,单据保存失败.");
            }
        }
Пример #7
0
        private void readProInfoListToUI()
        {
            for (int index = 0; index < m_proInfoList.Count; index++)
            {
                ArrayList record = new ArrayList();

                record = m_proInfoList[index];

                if (index == 0)
                {
                    this.labelTradingDate.Visible = true;
                    this.labelTradingDate.Text    = DateTime.Now.ToString("yyyy-MM-dd");

                    // 单据号
                    this.labelBillNumber.Text = BillNumber.getInctance().getNewBillNumber(BillTypeNumber, DateTime.Now.ToString("yyyy-MM-dd"));

                    // 制单人初始化
                    this.labelMakeBillStaff.Visible = true;
                    this.labelMakeBillStaff.Text    = DbPublic.getInctance().getCurrentLoginUserName();

                    this.panelDeliveryDate.Visible          = true;
                    this.labelDeliveryDate.Visible          = true;
                    this.dateTimePickerDeliveryDate.Visible = false;
                    this.labelDeliveryDate.Text             = this.dateTimePickerDeliveryDate.Value.ToString("yyyy-MM-dd");

                    // xx总材料表编号初始化
                    this.labelProject.Visible    = true;
                    this.labelProject.Text       = record[0].ToString();
                    this.panelProjectNum.Visible = false;
                    this.textBoxProject.Visible  = false;
                    this.textBoxProject.ReadOnly = true;

                    // 生产编号初始化
                    FormProjectMaterielTable proInfo = FormProject.getInctance().getProjectInfoFromBillNumber(record[0].ToString());
                    this.labelProject.Text += "(" + proInfo.makeNum + ")";

                    m_purchaseOrder.isReview = "1";
                }

                setMatetielInfoToDataGridView(Convert.ToString(record[1]), index);
                dataGridViewDataList.Rows[index].Cells[(int)DataGridColumnName.Value].Value = Convert.ToDouble(record[2]) - Convert.ToDouble(record[3]);
                dataGridViewDataList.Rows[index].Cells[(int)DataGridColumnName.xxMatetielTableRowNum].Value = Convert.ToString(record[7]);
                setTurnoverInfoDataGridView(index);
            }
        }
Пример #8
0
        private void exportPurchaseApplyData()
        {
            int startRowIndex = 4;
            // 采购入库单数据导出
            PurchaseApplyOrderTable table = new PurchaseApplyOrderTable();

            table = PurchaseApplyOrder.getInctance().getPurchaseInfoFromBillNumber(m_billNubmber);

            FormProjectMaterielTable projectInfo = FormProject.getInctance().getProjectInfoFromBillNumber(table.srcOrderNum);

            stringReplace(table.billNumber, "[1]");
            stringReplace(table.srcOrderNum, "[2]");
            stringReplace(table.exchangesUnit, "[3]");

            double sum = 0.0;

            for (int row = 0; row < m_dataGridView.RowCount; row++)
            {
                if (m_dataGridView.Rows[row].Cells[(int)FormPurchaseApply.DataGridColumnName.MatetielNumber].Value.ToString().Length == 0)
                {
                    break;
                }

                int           materielID = Convert.ToInt32(m_dataGridView.Rows[row].Cells[(int)FormPurchaseApply.DataGridColumnName.MatetielNumber].Value.ToString());
                MaterielTable tmp        = Materiel.getInctance().getMaterielInfoFromPkey(materielID);

                m_excelApp.Cells[row + startRowIndex, 2]  = m_dataGridView.Rows[row].Cells[(int)FormPurchaseApply.DataGridColumnName.MatetielNumber].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 3]  = projectInfo.projectName;
                m_excelApp.Cells[row + startRowIndex, 4]  = m_dataGridView.Rows[row].Cells[(int)FormPurchaseApply.DataGridColumnName.Brand].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 5]  = m_dataGridView.Rows[row].Cells[(int)FormPurchaseApply.DataGridColumnName.MatetielName].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 6]  = "";
                m_excelApp.Cells[row + startRowIndex, 7]  = m_dataGridView.Rows[row].Cells[(int)FormPurchaseApply.DataGridColumnName.Model].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 8]  = tmp.CZ;
                m_excelApp.Cells[row + startRowIndex, 9]  = m_dataGridView.Rows[row].Cells[(int)FormPurchaseApply.DataGridColumnName.Parameter].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 10] = m_dataGridView.Rows[row].Cells[(int)FormPurchaseApply.DataGridColumnName.Unit].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 11] = m_dataGridView.Rows[row].Cells[(int)FormPurchaseApply.DataGridColumnName.Value].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 12] = table.paymentDate;
                m_excelApp.Cells[row + startRowIndex, 13] = "";
                m_excelApp.Cells[row + startRowIndex, 14] = "";

                sum += Convert.ToDouble(m_dataGridView.Rows[row].Cells[(int)FormPurchaseApply.DataGridColumnName.Value].Value.ToString().Trim());
            }

            stringReplace(Convert.ToString(sum), "[4]");
        }
        private void textBoxProjectNum_TextChanged(object sender, EventArgs e)
        {
            if (this.textBoxProjectNum.Text.Length <= 0)
            {
                this.listViewProList.Visible = false;
                return;
            }

            this.listViewProList.Visible = true;
            this.listViewProList.Items.Clear();

            ArrayList list = FormProject.getInctance().getProjectNumList(this.textBoxProjectNum.Text);

            for (int i = 0; i < list.Count; i++)
            {
                ArrayList record = new ArrayList();
                record.Add(list[i].ToString());

                ListViewExtend.insertDataToListView(this.listViewProList, record);
            }

            m_isAciveProjectNum = true;
        }
        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());
            }
        }
Пример #11
0
        private void exportProjectInfoChangeData()
        {
            int startRowIndex1 = 8;
            int startRowIndex2 = 22;

            // 总材料表套打
            FormProjectMaterielChangeTable projectInfoChange = FormProjectInfoChange.getInctance().getProjectInfoFromBillNumber(m_billNubmber);
            FormProjectMaterielTable       projectInfo       = FormProject.getInctance().getProjectInfoFromBillNumber(projectInfoChange.srcBillNumber);

            int    dataType = FormProject.getInctance().getOrderTypeFromBillNumber(projectInfoChange.srcBillNumber);
            string type     = "设备";

            if (dataType == 1)
            {
                type = "设备";
            }
            else if (dataType == 2)
            {
                type = "电器";
            }
            else if (dataType == 3)
            {
                type = "工程";
            }

            stringReplace(type, "[1]");
            stringReplace(projectInfo.billNumber, "[2]");
            stringReplace(projectInfoChange.billNumber, "[3]");
            stringReplace(projectInfo.projectName, "[4]");
            stringReplace(projectInfo.projectNum, "[5]");
            stringReplace(projectInfo.makeNum, "[6]");
            stringReplace(projectInfo.deviceMode, "[7]");
            stringReplace(projectInfoChange.makeOrderDate, "[8]");
            stringReplace(projectInfoChange.makeOrderStaffName, "[9]");
            stringReplace(projectInfo.subName, "[10]");

            // 变更后数据
            for (int row2 = 0; row2 < m_dataGridView.RowCount; row2++)
            {
                if (m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.MatetielNumber].Value.ToString().Length == 0)
                {
                    break;
                }

                m_excelApp.Cells[row2 + startRowIndex2, 1]  = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Num].Value.ToString().Trim();
                m_excelApp.Cells[row2 + startRowIndex2, 2]  = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Sequence].Value.ToString().Trim();
                m_excelApp.Cells[row2 + startRowIndex2, 3]  = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.DeviceName].Value.ToString().Trim();
                m_excelApp.Cells[row2 + startRowIndex2, 4]  = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.MatetielName].Value.ToString().Trim();
                m_excelApp.Cells[row2 + startRowIndex2, 5]  = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.CL].Value.ToString().Trim();
                m_excelApp.Cells[row2 + startRowIndex2, 6]  = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Model].Value.ToString().Trim();
                m_excelApp.Cells[row2 + startRowIndex2, 7]  = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Size].Value.ToString().Trim();
                m_excelApp.Cells[row2 + startRowIndex2, 8]  = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Parameter].Value.ToString().Trim();
                m_excelApp.Cells[row2 + startRowIndex2, 9]  = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Unit].Value.ToString().Trim();
                m_excelApp.Cells[row2 + startRowIndex2, 10] = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Value].Value.ToString().Trim();
                m_excelApp.Cells[row2 + startRowIndex2, 11] = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Brand].Value.ToString().Trim();
                m_excelApp.Cells[row2 + startRowIndex2, 12] = m_dataGridView.Rows[row2].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Note].Value.ToString().Trim();
            }

            // 变更前数据
            if (m_dataGridViewOfter == null)
            {
                return;
            }

            for (int row = 0; row < m_dataGridViewOfter.RowCount; row++)
            {
                if (m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.MatetielNumber].Value.ToString().Length == 0)
                {
                    break;
                }

                m_excelApp.Cells[row + startRowIndex1, 1]  = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Num].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex1, 2]  = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Sequence].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex1, 3]  = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.DeviceName].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex1, 4]  = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.MatetielName].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex1, 5]  = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.CL].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex1, 6]  = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Model].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex1, 7]  = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Size].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex1, 8]  = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Parameter].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex1, 9]  = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Unit].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex1, 10] = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Value].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex1, 11] = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Brand].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex1, 12] = m_dataGridViewOfter.Rows[row].Cells[(int)FormProjectMaterielChangeOrder.DataGridColumnName.Note].Value.ToString().Trim();
            }
        }
Пример #12
0
        private void exportProjectInfoData()
        {
            int startRowIndex = 6;
            // 总材料表套打
            FormProjectMaterielTable projectInfo = FormProject.getInctance().getProjectInfoFromBillNumber(m_billNubmber);

            int    dataType = FormProject.getInctance().getOrderTypeFromBillNumber(m_billNubmber);
            string type     = "设备";

            if (dataType == 1)
            {
                type = "设备";
            }
            else if (dataType == 2)
            {
                type = "电器";
            }
            else if (dataType == 3)
            {
                type = "工程";
            }

            stringReplace(type, "[1]");
            stringReplace(projectInfo.billNumber, "[2]");
            stringReplace(projectInfo.deviceMode, "[3]");
            stringReplace(projectInfo.subName, "[4]");
            stringReplace(projectInfo.projectName, "[5]");
            stringReplace(projectInfo.projectNum, "[6]");
            stringReplace(projectInfo.makeNum, "[7]");
            stringReplace(projectInfo.note, "[8]");
            stringReplace(projectInfo.makeOrderStaffName, "[10]");

            double sum = 0.0;

            for (int row = 0; row < m_dataGridView.RowCount; row++)
            {
                if (m_dataGridView.Rows[row].Cells[(int)FormProjectMaterielOrder.DataGridColumnName.MatetielNumber].Value.ToString().Length == 0)
                {
                    break;
                }

                if (row >= 40)
                {
                    Microsoft.Office.Interop.Excel.Range range = m_excelApp.Rows[row + startRowIndex, Type.Missing];

                    range.EntireRow.Insert(Microsoft.Office.Interop.Excel.XlDirection.xlUp,
                                           Microsoft.Office.Interop.Excel.XlInsertFormatOrigin.xlFormatFromLeftOrAbove);
                }

                m_excelApp.Cells[row + startRowIndex, 1]  = m_dataGridView.Rows[row].Cells[(int)FormProjectMaterielOrder.DataGridColumnName.Num].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 2]  = m_dataGridView.Rows[row].Cells[(int)FormProjectMaterielOrder.DataGridColumnName.Sequence].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 3]  = m_dataGridView.Rows[row].Cells[(int)FormProjectMaterielOrder.DataGridColumnName.DeviceName].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 4]  = m_dataGridView.Rows[row].Cells[(int)FormProjectMaterielOrder.DataGridColumnName.Brand].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 5]  = m_dataGridView.Rows[row].Cells[(int)FormProjectMaterielOrder.DataGridColumnName.MatetielName].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 6]  = m_dataGridView.Rows[row].Cells[(int)FormProjectMaterielOrder.DataGridColumnName.Model].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 7]  = m_dataGridView.Rows[row].Cells[(int)FormProjectMaterielOrder.DataGridColumnName.Size].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 8]  = m_dataGridView.Rows[row].Cells[(int)FormProjectMaterielOrder.DataGridColumnName.CL].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 9]  = m_dataGridView.Rows[row].Cells[(int)FormProjectMaterielOrder.DataGridColumnName.Parameter].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 10] = m_dataGridView.Rows[row].Cells[(int)FormProjectMaterielOrder.DataGridColumnName.Unit].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 11] = m_dataGridView.Rows[row].Cells[(int)FormProjectMaterielOrder.DataGridColumnName.Value].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 12] = m_dataGridView.Rows[row].Cells[(int)FormProjectMaterielOrder.DataGridColumnName.MakeType].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 13] = m_dataGridView.Rows[row].Cells[(int)FormProjectMaterielOrder.DataGridColumnName.UseDate].Value.ToString().Trim();
                m_excelApp.Cells[row + startRowIndex, 14] = m_dataGridView.Rows[row].Cells[(int)FormProjectMaterielOrder.DataGridColumnName.Note].Value.ToString().Trim();

                sum += Convert.ToDouble(m_dataGridView.Rows[row].Cells[(int)FormProjectMaterielOrder.DataGridColumnName.Value].Value.ToString().Trim());
            }

            stringReplace(Convert.ToString(sum), "[9]");
        }
Пример #13
0
        private void exportPurchaseInData()
        {
            // 采购入库单数据导出
            PurchaseInOrderTable table = new PurchaseInOrderTable();

            table = PurchaseInOrder.getInctance().getPurchaseInfoFromBillNumber(m_billNubmber);

            FormProjectMaterielTable projectInfo = FormProject.getInctance().getProjectInfoFromBillNumber(table.srcOrderNum);

            stringReplace(table.supplierName, "[1]");
            stringReplace(table.billNumber, "[2]");
            stringReplace(table.srcOrderNum, "[3]");
            stringReplace(projectInfo.projectNum, "[4]");
            stringReplace(table.makeOrderStaffName, "[9]");
            stringReplace(projectInfo.projectName, "[10]");
            stringReplace(table.purchaseNum, "[11]");
            stringReplace(table.exchangesUnit, "[12]");

            double sum1 = 0.0, sum2 = 0.0, sum3 = 0.0, sum4 = 0.0;

            for (int row = 0; row < m_dataGridView.RowCount; row++)
            {
                if (m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.MatetielNumber].Value.ToString().Length == 0 &&
                    m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.MatetielName].Value.ToString().Length == 0)
                {
                    break;
                }
                else
                {
                    if (m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.Value].Value.ToString().Length > 0)
                    {
                        sum1 += Convert.ToDouble(m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.Value].Value.ToString());
                    }

                    if (m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.Turnover].Value.ToString().Length > 0)
                    {
                        sum2 += Convert.ToDouble(m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.Turnover].Value.ToString());
                    }

                    if (m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.TransportationCost].Value.ToString().Length > 0)
                    {
                        sum3 += Convert.ToDouble(m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.TransportationCost].Value.ToString());
                    }

                    if (m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.SumTurnover].Value.ToString().Length > 0)
                    {
                        sum4 += Convert.ToDouble(m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.SumTurnover].Value.ToString());
                    }
                }

                int           materielID = Convert.ToInt32(m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.MatetielNumber].Value.ToString());
                MaterielTable record     = Materiel.getInctance().getMaterielInfoFromPkey(materielID);
                m_excelApp.Cells[row + 6, 1] = m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.MatetielNumber].Value.ToString().Trim();
                m_excelApp.Cells[row + 6, 2] = record.brand;
                m_excelApp.Cells[row + 6, 3] = m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.MatetielName].Value.ToString().Trim();
                m_excelApp.Cells[row + 6, 4] = m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.ContractMatetielName].Value.ToString().Trim();
                m_excelApp.Cells[row + 6, 5] = record.model;
                m_excelApp.Cells[row + 6, 6] = m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.Unit].Value.ToString().Trim();
                m_excelApp.Cells[row + 6, 7] = m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.CZ].Value.ToString().Trim();
                m_excelApp.Cells[row + 6, 8] = m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.Price].Value.ToString().Trim();

                if (table.isRedBill == 1)
                {
                    m_excelApp.Cells[row + 6, 9]  = Convert.ToDouble(m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.Value].Value.ToString().Trim()) * -1;
                    m_excelApp.Cells[row + 6, 10] = Convert.ToDouble(m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.Turnover].Value.ToString().Trim()) * -1;
                    m_excelApp.Cells[row + 6, 11] = Convert.ToDouble(m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.TransportationCost].Value.ToString().Trim()) * -1;
                    m_excelApp.Cells[row + 6, 12] = Convert.ToDouble(m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.SumTurnover].Value.ToString().Trim()) * -1;
                }
                else
                {
                    m_excelApp.Cells[row + 6, 9]  = m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.Value].Value.ToString().Trim();
                    m_excelApp.Cells[row + 6, 10] = m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.Turnover].Value.ToString().Trim();
                    m_excelApp.Cells[row + 6, 11] = m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.TransportationCost].Value.ToString().Trim();
                    m_excelApp.Cells[row + 6, 12] = m_dataGridView.Rows[row].Cells[(int)FormPurchaseInOrder.DataGridColumnName.SumTurnover].Value.ToString().Trim();
                }
            }


            if (table.isRedBill == 1)
            {
                stringReplace(Convert.ToString(sum1 * -1), "[5]");
                stringReplace(Convert.ToString(sum2 * -1), "[6]");
                stringReplace(Convert.ToString(sum3 * -1), "[7]");
                stringReplace(Convert.ToString(sum4 * -1), "[8]");
            }
            else
            {
                stringReplace(Convert.ToString(sum1), "[5]");
                stringReplace(Convert.ToString(sum2), "[6]");
                stringReplace(Convert.ToString(sum3), "[7]");
                stringReplace(Convert.ToString(sum4), "[8]");
            }
        }
Пример #14
0
        private void exportMaterielOutData()
        {
            // 生产领料单数据导出
            MaterielOutOrderTable table = new MaterielOutOrderTable();

            table = MaterielOutOrder.getInctance().getMaterielOutOrderInfoFromBillNumber(m_billNubmber);

            FormProjectMaterielTable projectInfo = FormProject.getInctance().getProjectInfoFromBillNumber(table.srcOrderNum);

            stringReplace(projectInfo.projectName, "[1]");
            stringReplace(table.billNumber, "[2]");
            stringReplace(table.srcOrderNum, "[3]");
            stringReplace(table.makeNo, "[4]");
            stringReplace(table.exchangesUnit, "[5]");
            stringReplace(projectInfo.projectNum, "[6]");
            stringReplace(table.makeOrderStaffName, "[7]");
            stringReplace(projectInfo.deviceMode, "[9]");
            stringReplace(projectInfo.subName, "[10]");

            double sum = 0.0;

            for (int row = 0; row < m_dataGridView.RowCount; row++)
            {
                if (m_dataGridView.Rows[row].Cells[(int)FormMaterielOutOrder.DataGridColumnName.MatetielNumber].Value.ToString().Length == 0)
                {
                    break;
                }

                int           materielID = Convert.ToInt32(m_dataGridView.Rows[row].Cells[(int)FormMaterielOutOrder.DataGridColumnName.MatetielNumber].Value.ToString());
                MaterielTable record     = Materiel.getInctance().getMaterielInfoFromPkey(materielID);

                ProjectManagerDetailsTable tmp = new ProjectManagerDetailsTable();

                string xxMatetielTableRowNum = m_dataGridView.Rows[row].Cells[(int)FormMaterielOutOrder.DataGridColumnName.xxMatetielTableRowNum].Value.ToString();

                if (xxMatetielTableRowNum.Length > 0)
                {
                    tmp = ProjectManagerDetails.getInctance().getMaterielInfoFromRowNum(table.srcOrderNum, Convert.ToInt32(xxMatetielTableRowNum));
                }
                else
                {
                    tmp = ProjectManagerDetails.getInctance().getMaterielInfoFromBillNumber(table.srcOrderNum, materielID);
                }

                m_excelApp.Cells[row + 6, 1] = tmp.no;
                m_excelApp.Cells[row + 6, 2] = tmp.sequence;
                m_excelApp.Cells[row + 6, 3] = record.brand;
                m_excelApp.Cells[row + 6, 4] = record.name;
                m_excelApp.Cells[row + 6, 5] = record.model;

                m_excelApp.Cells[row + 6, 6] = tmp.cl;
                m_excelApp.Cells[row + 6, 7] = m_dataGridView.Rows[row].Cells[(int)FormMaterielOutOrder.DataGridColumnName.Unit].Value.ToString().Trim();

                m_excelApp.Cells[row + 6, 8]  = m_dataGridView.Rows[row].Cells[(int)FormMaterielOutOrder.DataGridColumnName.Value].Value.ToString().Trim();
                m_excelApp.Cells[row + 6, 9]  = AuxiliaryMaterial.getInctance().getAuxiliaryMaterialNameFromPkey("BASE_STORAGE_LIST", record.storage);
                m_excelApp.Cells[row + 6, 10] = m_dataGridView.Rows[row].Cells[(int)FormMaterielOutOrder.DataGridColumnName.Note].Value.ToString().Trim();

                sum += Convert.ToDouble(m_dataGridView.Rows[row].Cells[(int)FormMaterielOutOrder.DataGridColumnName.Value].Value.ToString());
            }

            stringReplace(Convert.ToString(sum), "[8]");
        }
        private void readBillInfoToUI()
        {
            this.labelDeviceMode.Visible    = true;
            this.labelTradingDate.Visible   = true;
            this.labelBillNumber.Visible    = true;
            this.labelContractNum.Visible   = true;
            this.labelMakeNum.Visible       = true;
            this.labelDeviceName.Visible    = true;
            this.labelSummary.Visible       = true;
            this.labelMakeBillStaff.Visible = true;
            this.labelMakeDate.Visible      = true;

            this.labelBusinessPeople.Visible  = true;
            this.labelReviewBillStaff.Visible = true;
            this.labelReviewDate.Visible      = true;

            // 单据表头表尾信息
            m_ProjectInfo = FormProject.getInctance().getProjectInfoFromBillNumber(m_billNumber);

            this.labelDeviceMode.Text      = m_ProjectInfo.deviceMode;
            this.labelTradingDate.Text     = m_ProjectInfo.subName;
            this.labelBillNumber.Text      = m_ProjectInfo.billNumber;
            this.labelContractNum.Text     = m_ProjectInfo.projectNum;
            this.labelMakeNum.Text         = m_ProjectInfo.makeNum;
            this.labelDeviceName.Text      = m_ProjectInfo.projectName;
            this.labelSummary.Text         = m_ProjectInfo.note;
            this.labelMakeBillStaff.Text   = m_ProjectInfo.makeOrderStaffName;
            this.labelMakeDate.Text        = m_ProjectInfo.makeOrderDate;
            this.labelBusinessPeople.Text  = m_ProjectInfo.designStaffName;
            this.labelReviewBillStaff.Text = m_ProjectInfo.orderrReviewName;
            this.labelReviewDate.Text      = m_ProjectInfo.reviewDate;


            // DataGridView 赋值
            SortedDictionary <int, ProjectManagerDetailsTable> purchaseOrderDetails =
                ProjectManagerDetails.getInctance().getPurchaseInfoFromBillNumber(m_billNumber);

            foreach (KeyValuePair <int, ProjectManagerDetailsTable> index in purchaseOrderDetails)
            {
                ProjectManagerDetailsTable record = new ProjectManagerDetailsTable();
                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.Brand].Value          = record.materielBrand;
                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 = record.materielParameter;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Size].Value      = record.materielSize;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Unit].Value      = record.materielUnit;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Value].Value     = record.value;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.MakeType].Value  = record.makeType;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Note].Value      = record.materielNote;


                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Num].Value        = record.no;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.Sequence].Value   = record.sequence;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.UseDate].Value    = record.useDate;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.DeviceName].Value = record.deviceName;
                dataGridViewDataList.Rows[rowIndex].Cells[(int)DataGridColumnName.CL].Value         = record.cl;
            }

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

                this.save.Enabled = false;
                this.toolStripButtonReview.Enabled  = false;
                this.dataGridViewDataList.ReadOnly  = true;
                this.dataGridViewDataCount.ReadOnly = true;

                this.panelSummary.Visible = false;

                this.dateTimePickerTradingDate.Visible = false;

                this.textBoxSummary.Visible = false;

                this.panelBusinessPeople.Visible = false;

                // 变更按钮处于可用状态
                this.toolStripButtonChange.Enabled = true;
            }
            else if (m_ProjectInfo.isReview == "2")
            {
                //this.labelReviewBillStaff.Text = m_ProjectInfo.orderrReviewName;
                //this.labelReviewDate.Text = m_ProjectInfo.reviewDate;
                //this.panelIsReview.Visible = true;

                //this.save.Enabled = false;
                //this.toolStripButtonReview.Enabled = false;
                //this.dataGridViewDataList.ReadOnly = true;
                //this.dataGridViewDataCount.ReadOnly = true;

                //this.panelSummary.Visible = false;

                //this.dateTimePickerTradingDate.Visible = false;

                //this.textBoxSummary.Visible = false;

                //this.panelBusinessPeople.Visible = false;

                //// 变更按钮处于可用状态
                //this.panelIsReview.Visible = false;
                //this.toolStripButtonChange.Enabled = false;
                //this.toolStripButtonChangeReview.Enabled = true;
            }
            else
            {
                this.labelReviewBillStaff.Visible = false;
                this.labelReviewDate.Visible      = false;
            }

            //if (m_ProjectInfo.changeStaffName.Length > 0 || m_ProjectInfo.changeReviewStaffName.Length > 0)
            //{
            //    this.panelChange.Visible = true;
            //}
        }
Пример #16
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);

                        if (record.isRedBill == 1)
                        {
                            temp.Add(Convert.ToDouble(record.sumMoney) * -1);
                            temp.Add(Convert.ToDouble(record.sumTransportationCost) * -1);
                            temp.Add(Convert.ToDouble(record.sumOtherCost) * -1);
                            temp.Add(Convert.ToDouble(record.totalMoney) * -1);
                        }
                        else
                        {
                            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.srcOrderNum);
                        temp.Add(FormProject.getInctance().getProjectNumFromBillNumber(record.srcOrderNum));
                        temp.Add(record.makeNo);

                        if (record.isRedBill == 1)
                        {
                            temp.Add((Convert.ToDouble(record.sumValue) * -1));
                            temp.Add((Convert.ToDouble(record.sumMoney) * -1));
                        }
                        else
                        {
                            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);

                        if (record.isRedBill == 1)
                        {
                            temp.Add((Convert.ToDouble(record.sumValue) * -1));
                            temp.Add((Convert.ToDouble(record.sumMoney) * -1));
                        }
                        else
                        {
                            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.projectNo);
                        temp.Add(record.makeNo);

                        if (record.isRedBill == 1)
                        {
                            temp.Add((Convert.ToDouble(record.sumValue) * -1));
                            temp.Add((Convert.ToDouble(record.sumMoney) * -1));
                        }
                        else
                        {
                            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);
            }
        }
        private void readBillInfoToUI()
        {
            m_projectNum = m_currentOrderInfo.projectNum;

            this.labelSrcOrderBillNum.Visible = true;
            this.labelBillNumber.Visible = true;
            this.labelSummary.Visible = true;

            this.labelMakeBillStaff.Visible = true;
            this.labelMakeDate.Visible = true;
            this.labelBusinessPeople.Visible = true;
            this.labelReviewBillStaff.Visible = true;
            this.labelReviewDate.Visible = true;

            this.labelSrcOrderBillNum.Text = m_currentOrderInfo.srcBillNumber;
            this.labelBillNumber.Text = m_currentOrderInfo.billNumber;

            FormProjectMaterielTable tmp = FormProject.getInctance().getProjectInfoFromBillNumber(m_currentOrderInfo.srcBillNumber);
            this.labelProjectName.Text = tmp.projectName;
            this.labelProjectNo.Text = tmp.projectNum;
            this.labelMakeNo.Text = tmp.makeNum;
            this.labelDevMode.Text = tmp.deviceMode;

            this.labelSummary.Text = m_currentOrderInfo.changeReason;

            this.labelMakeBillStaff.Text = m_currentOrderInfo.makeOrderStaffName;
            this.labelMakeDate.Text = m_currentOrderInfo.makeOrderDate;
            this.labelBusinessPeople.Text = m_currentOrderInfo.designStaffName;
            this.textBoxBusinessPeople.Text = m_currentOrderInfo.designStaffName;
            this.labelReviewBillStaff.Text = m_currentOrderInfo.orderrReviewName;
            this.labelReviewDate.Text = m_currentOrderInfo.reviewDate;

            // 变更前DataGridView 赋值
            string matetiels = m_currentOrderInfo.materielIDs;
            string[] sArray = matetiels.Split('#');
            int rowNum = 0;
            foreach (string index in sArray)
            {
                if (index.ToString().Length > 0)
                {
                    string[] list = index.Split(',');

                    if (list.Length > 1)
                    {
                        setMatetielInfo(rowNum, list[0], list[1], list[2]);
                    }
                    else
                    {
                        setMatetielInfo(rowNum, list[0], "", "");
                    }

                    rowNum++;
                }
            }

            // 变更后DataGridView 赋值
            SortedDictionary<int, ProjectManagerDetailsTable> purchaseOrderDetails =
                ProjectManagerDetails.getInctance().getPurchaseInfoFromBillNumber(m_billNumber);

            foreach (KeyValuePair<int, ProjectManagerDetailsTable> index in purchaseOrderDetails)
            {
                ProjectManagerDetailsTable record = new ProjectManagerDetailsTable();
                record = index.Value;

                int rowIndex = Convert.ToInt32(record.rowNumber.ToString()) - 1;

                dataGridViewDataListChange.Rows[rowIndex].Cells[(int)DataGridColumnName.MatetielNumber].Value = record.materielID;
                dataGridViewDataListChange.Rows[rowIndex].Cells[(int)DataGridColumnName.Brand].Value = record.materielBrand;
                dataGridViewDataListChange.Rows[rowIndex].Cells[(int)DataGridColumnName.MatetielName].Value = record.materielName;

                dataGridViewDataListChange.Rows[rowIndex].Cells[(int)DataGridColumnName.Model].Value = record.materielModel;
                dataGridViewDataListChange.Rows[rowIndex].Cells[(int)DataGridColumnName.Parameter].Value = record.materielParameter;
                dataGridViewDataListChange.Rows[rowIndex].Cells[(int)DataGridColumnName.Size].Value = record.materielSize;
                dataGridViewDataListChange.Rows[rowIndex].Cells[(int)DataGridColumnName.Unit].Value = record.materielUnit;
                dataGridViewDataListChange.Rows[rowIndex].Cells[(int)DataGridColumnName.Value].Value = record.value;
                dataGridViewDataListChange.Rows[rowIndex].Cells[(int)DataGridColumnName.MakeType].Value = record.makeType;
                dataGridViewDataListChange.Rows[rowIndex].Cells[(int)DataGridColumnName.Note].Value = record.materielNote;


                dataGridViewDataListChange.Rows[rowIndex].Cells[(int)DataGridColumnName.Num].Value = record.no;
                dataGridViewDataListChange.Rows[rowIndex].Cells[(int)DataGridColumnName.Sequence].Value = record.sequence;
                dataGridViewDataListChange.Rows[rowIndex].Cells[(int)DataGridColumnName.UseDate].Value = record.useDate;
                dataGridViewDataListChange.Rows[rowIndex].Cells[(int)DataGridColumnName.DeviceName].Value = record.deviceName;
                dataGridViewDataListChange.Rows[rowIndex].Cells[(int)DataGridColumnName.CL].Value = record.cl;
            }

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

                this.save.Enabled = false;
                this.toolStripButtonReview.Enabled = false;
                this.dataGridViewDataListChange.ReadOnly = true;

                this.panelSummary.Visible = false;

                this.textBoxSummary.Visible = false;

                this.panelBusinessPeople.Visible = false;
            }
            else
            {
                this.labelReviewBillStaff.Visible = false;
                this.labelReviewDate.Visible = false;
            }
        }