コード例 #1
0
ファイル: FrmReceiptSearch.cs プロジェクト: zhr008/ERP-1
        private void btnPrint_Click(object sender, EventArgs e)
        {
            _currentDt = bReceipt.GetPrintList(GetConduction()).Tables[0];
            if (_currentDt.Rows.Count > 0 && isSearch)
            {
                //SaveFileDialog sf = new SaveFileDialog();
                //sf.FileName = "LZ_RECEIPT_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
                //sf.Filter = "(文件)|*.xls;*.xlsx";

                //string header = "入库编号\t采购订单编号\t入库行号\t供应商编号\t供应商名称\t入库仓库编号\t入库仓库名称\t" +
                //                "公司编号\t公司名称\t货币编号\t货币名称\t商品编号\t商品名称\t采购数量\t入库预定数量\t入库数量\t" +
                //                "入库日期\t发票编号\t单位编号\t单位名称\t单价\t不含税金额\t税率\t税金\t含税金额\t明细状态\t创建人\t创建时间\t最后更新人\t最后更新时间\t\n";
                //if (sf.ShowDialog(this) == DialogResult.OK)
                //{
                //    if (_currentDt != null)
                //    {
                //        int result = CommonExport.DataTableToCsv(_currentDt, header, sf.FileName);
                //        if (result == 0)
                //        {
                //            MessageBox.Show("成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //        }
                //    }
                //}
                int result = CommonExport.DataTableToExcel(_currentDt, CConstant.RECEIPT_HEADER, CConstant.RECEIPT_COLUMNS, "RECEIPT", "RECEIPT");
                if (result == CConstant.EXPORT_SUCCESS)
                {
                    MessageBox.Show("数据已经成功导出!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else if (result == CConstant.EXPORT_FAILURE)
                {
                    MessageBox.Show("数据导出失败。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
コード例 #2
0
 /// <summary>
 /// 导出
 /// </summary>
 private void MasterToolBar_DoExport_Click(object sender, EventArgs e)
 {
     _currentDt = bHsCode.GetList(GetConduction()).Tables[0];
     if (isSearch && _currentDt != null)
     {
         foreach (DataRow row in _currentDt.Rows)
         {
             try
             {
                 if (row["CREATE_USER"] != null && bCommon.GetBaseMaster("USER", CConvert.ToString(row["CREATE_USER"])) != null)
                 {
                     row["CREATE_USER"] = bCommon.GetBaseMaster("USER", CConvert.ToString(row["CREATE_USER"])).Name;
                 }
                 if (row["LAST_UPDATE_USER"] != null && bCommon.GetBaseMaster("USER", CConvert.ToString(row["LAST_UPDATE_USER"])) != null)
                 {
                     row["LAST_UPDATE_USER"] = bCommon.GetBaseMaster("USER", CConvert.ToString(row["LAST_UPDATE_USER"])).Name;
                 }
             }
             catch { }
         }
         int result = CommonExport.DataTableToExcel(_currentDt, CConstant.HS_CODE_HEADER, CConstant.HS_CODE_COLUMNS, "HS_CODE", "HS_CODE");
         if (result == CConstant.EXPORT_SUCCESS)
         {
             MessageBox.Show("数据已经成功导出!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else if (result == CConstant.EXPORT_FAILURE)
         {
             MessageBox.Show("数据导出失败。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     else
     {
         MessageBox.Show("没有可以导出的数据。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #3
0
ファイル: FrmStockSearch.cs プロジェクト: zhr008/ERP-1
        private void btnPrint_Click(object sender, EventArgs e)
        {
            _currentDt = bStock.GetStockPrintList(oldGetCondition).Tables[0];
            _currentDt.Columns.Add("ALLOATION_QUANTITY", Type.GetType("System.String"));
            _currentDt.Columns.Add("NO_ALLOATION", Type.GetType("System.String"));
            _currentDt.Columns.Add("RECEIPT_PLAN_QUANTITY", Type.GetType("System.String"));
            foreach (DataRow rows in _currentDt.Rows)
            {
                decimal alloationQuantity = bAlloation.GetAlloationQuantity(CConvert.ToString(rows["WAREHOUSE_CODE"]), CConvert.ToString(rows["PRODUCT_CODE"]));
                rows["ALLOATION_QUANTITY"] = Convert.ToString(alloationQuantity);
                rows["NO_ALLOATION"]       = Convert.ToDecimal(rows["QUANTITY"]) - Convert.ToDecimal(rows["ALLOATION_QUANTITY"]);

                rows["RECEIPT_PLAN_QUANTITY"] = bStock.GetPurchaseQuantity(rows["WAREHOUSE_CODE"].ToString(), rows["PRODUCT_CODE"].ToString());
            }
            if (_currentDt.Rows.Count > 0 && isSearch)
            {
                int result = CommonExport.DataTableToExcel(_currentDt, CConstant.STOCK_HEADER, CConstant.STOCK_COLUMNS, "STOCK", "STOCK");
                if (result == CConstant.EXPORT_SUCCESS)
                {
                    MessageBox.Show("数据已经成功导出!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else if (result == CConstant.EXPORT_FAILURE)
                {
                    MessageBox.Show("数据导出失败。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
コード例 #4
0
ファイル: FrmOrdersSearch.cs プロジェクト: zhr008/ERP-1
        /// <summary>
        ///
        /// </summary>
        private void btnPrint_Click(object sender, EventArgs e)
        {
            _currentDt = bOrderHeader.GetPrintList(_currentConduction).Tables[0];
            for (int i = 0; i < _currentDt.Rows.Count; i++)
            {
                #region 引当
                if (CConstant.ALLOATION_COMPLETE.Equals(_currentDt.Rows[i]["ALLOATION_FLAG"]))
                {
                    _currentDt.Rows[i]["ALLOATION_NAME"] = "完了";
                }
                else if (CConstant.ALLOATION_PART.Equals(_currentDt.Rows[i]["ALLOATION_FLAG"]))
                {
                    _currentDt.Rows[i]["ALLOATION_NAME"] = "欠品";
                }
                else
                {
                    _currentDt.Rows[i]["ALLOATION_NAME"] = "未引当";
                }
                #endregion

                #region 出库
                if (CConvert.ToDecimal(_currentDt.Rows[i]["SHIPMENT_QUANTITY"]) == 0)
                {
                    _currentDt.Rows[i]["SHIPMENT_NAME"] = "未出库";
                }
                else if (CConvert.ToDecimal(_currentDt.Rows[i]["QUANTITY"]) != CConvert.ToDecimal(_currentDt.Rows[i]["SHIPMENT_QUANTITY"]))
                {
                    _currentDt.Rows[i]["SHIPMENT_NAME"] = "欠品";
                }
                else
                {
                    _currentDt.Rows[i]["SHIPMENT_NAME"] = "完了";
                }
                #endregion
            }
            if (_currentDt != null)
            {
                int result = CommonExport.DataTableToExcel(_currentDt, CConstant.ORDER_HEADER, CConstant.ORDER_COLUMNS, "ORDER", "ORDER");
                if (result == CConstant.EXPORT_SUCCESS)
                {
                    MessageBox.Show("导出成功。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else if (result == CConstant.EXPORT_FAILURE)
                {
                    MessageBox.Show("数据导出失败。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show("没有可以导出的数据。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
コード例 #5
0
ファイル: FrmShipmentSearch.cs プロジェクト: zhr008/ERP-1
        private void btnPrint_Click(object sender, EventArgs e)
        {
            DataTable printDataTable = bShipment.GetPrintList(currentConduction).Tables[0];

            if (isSearch && printDataTable.Rows.Count > 0)
            {
                int result = CommonExport.DataTableToExcel(printDataTable, CConstant.SHIPMENT_HEADER, CConstant.SHIPMENT_COLUMNS, "SHIPMENT", "SHIPMENT");
                if (result == CConstant.EXPORT_SUCCESS)
                {
                    MessageBox.Show("导出成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else if (result == CConstant.EXPORT_FAILURE)
                {
                    MessageBox.Show("数据导出失败。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
コード例 #6
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            int recordCount = bSales.GetReceiptMatchSearchRecordCount(GetCondition());

            _currentDt = bSales.GetReceiptMatchSearchList(GetCondition(), "", 1, recordCount).Tables[0];
            if (isSearch && _currentDt.Rows.Count > 0)
            {
                string RECEIPT_MATCH_HEADER  = "收款编号,请款公司编号,请款公司名称,收款日期,发票编号,发票金额,预收款金额,收款金额,通货";
                string RECEIPT_MATCH_COLUMNS = "SLIP_NUMBER,CUSTOMER_CLAIM_CODE, CUSTOMER_CLAIM_NAME,SLIP_DATE, INVOICE_NUMBER, INVOICE_AMOUNT,DEPOSIT_AMOUNT,TOTAL_AMOUNT,CURRENCY_NAME";

                int result = CommonExport.DataTableToExcel(_currentDt, RECEIPT_MATCH_HEADER, RECEIPT_MATCH_COLUMNS, "sheet1", "RECEIPT_MATCH");
                if (result == CConstant.EXPORT_SUCCESS)
                {
                    MessageBox.Show("导出成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
コード例 #7
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            int recordCount = bSales.GetSalesRecordCount(GetCondition());

            _currentDt = bSales.GetSalesList(GetCondition(), "", 1, recordCount).Tables[0];
            if (isSearch && _currentDt != null)
            {
                string SALES_HEADER = "发票系统编号,发票编号,请款公司编号,请款公司名称,开票日期,收款预定日,发票金额,未收款金额," +
                                      "收款状态,订单单号,订单金额,出库单号,出库金额,明细开票金额,通货";
                string SALES_COLUMNS = "SLIP_NUMBER,INVOICE_NUMBER,CUSTOMER_CLAIM_CODE,CUSTOMER_CLAIM_NAME,SLIP_DATE,CUSTOMER_CLAIM_DATE,INVOICE_AMOUNT,UN_RECEIPT_AMOUNT," +
                                       "PAYMENT_STATUS_NAME,ORDER_SLIP_NUMBER,ORDER_AMOUNT,SHIPMENT_SLIP_NUMBER,SHIPMENT_AMOUNT,INVOICE_AMOUNT,CURRENCY_NAME";
                int result = CommonExport.DataTableToExcel(_currentDt, SALES_HEADER, SALES_COLUMNS, "sheet1", "SALES");
                if (result == CConstant.EXPORT_SUCCESS)
                {
                    MessageBox.Show("导出成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
コード例 #8
0
 /// <summary>
 /// 导出
 /// </summary>
 private void MasterToolBar_DoExport_Click(object sender, EventArgs e)
 {
     _currentDt = bProductParts.GetList(GetConduction()).Tables[0];
     if (isSearch && _currentDt != null)
     {
         int result = CommonExport.DataTableToExcel(_currentDt, CConstant.PRODUCT_PARTS_HEADER, CConstant.PRODUCT_PARTS_COLUMNS, "PRODUCT_PARTS", "PRODUCT_PARTS");
         if (result == CConstant.EXPORT_SUCCESS)
         {
             MessageBox.Show("数据已经成功导出!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else if (result == CConstant.EXPORT_FAILURE)
         {
             MessageBox.Show("数据导出失败。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     else
     {
         MessageBox.Show("没有可以导出的数据。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #9
0
 private void btnPrint_Click(object sender, EventArgs e)
 {
     _currentDt = bPurchaseOrder.GetPurchaseSupplementList(oldGetCondition).Tables[0];
     if (isSearch && _currentDt.Rows.Count > 0)
     {
         int result = CommonExport.DataTableToExcel(_currentDt, CConstant.PO_SUPPLEMENT_HEADER, CConstant.PO_SUPPLEMENT_COLUMNS, "PO_SUPPLEMENT", "PO_SUPPLEMENT");
         if (result == CConstant.EXPORT_SUCCESS)
         {
             MessageBox.Show("导出成功。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else if (result == CConstant.EXPORT_FAILURE)
         {
             MessageBox.Show("数据导出失败。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     else
     {
         MessageBox.Show("没有可以导出的数据。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #10
0
ファイル: FrmCustomerReported.cs プロジェクト: zhr008/ERP-1
 /// <summary>
 /// 导出
 /// </summary>
 private void MasterToolBar_DoExport_Click(object sender, EventArgs e)
 {
     _currentDt = bCustomerReported.GetList(GetConduction()).Tables[0];
     if (isSearch && _currentDt.Rows.Count > 0)
     {
         int result = CommonExport.DataTableToExcel(_currentDt, CConstant.CUSTOMER_REPORTED_HEADER, CConstant.CUSTOMER_REPORTED_COLUMNS, "CUSTOMER_REPORTED", "CUSTOMER_REPORTED");
         if (result == CConstant.EXPORT_SUCCESS)
         {
             MessageBox.Show("数据已经成功导出!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else if (result == CConstant.EXPORT_FAILURE)
         {
             MessageBox.Show("数据导出失败。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     else
     {
         MessageBox.Show("没有可以导出的数据。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #11
0
 /// <summary>
 /// 导出
 /// </summary>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     _currentDt = bPurchaseOrder.GetPrintList(_currentConduction).Tables[0];
     if (isSearch && _currentDt.Rows.Count > 0)
     {
         int result = CommonExport.DataTableToExcel(_currentDt, CConstant.PURCHASE_ORDER_HEADER, CConstant.PURCHASE_ORDER_COLUMNS, "PURCHASE_ORDER", "PURCHASE_ORDER");
         if (result == CConstant.EXPORT_SUCCESS)
         {
             MessageBox.Show("数据已经成功导出!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else if (result == CConstant.EXPORT_FAILURE)
         {
             MessageBox.Show("数据导出失败。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     else
     {
         MessageBox.Show("没有可以导出的数据。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }