Exemplo n.º 1
0
 /// <summary>
 /// 导出
 /// </summary>
 private void MasterToolBar_DoExport_Click(object sender, EventArgs e)
 {
     _currentDt = bSupplier.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 = CExport.DataTableToExcel(_currentDt, CConstant.SUPPLIER_HEADER, CConstant.SUPPLIER_COLUMNS, "SUPPLIER", "SUPPLIER");
         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);
     }
 }
Exemplo n.º 2
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            _currentDt = bRerceipt.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 = CExport.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);
                }
            }
        }
Exemplo n.º 3
0
 private void btnPrint_Click(object sender, EventArgs e)
 {
     _currentDt = bPurchaseOrder.GetPurchaseSupplementList(oldGetCondition).Tables[0];
     if (isSearch && _currentDt.Rows.Count > 0)
     {
         int result = CExport.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);
         }
     }
 }
Exemplo n.º 4
0
        //private void btnAlloation_Click(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        string warehousecode = dgvData.SelectedRows[0].Cells["WAREHOUSE_CODE"].Value.ToString();
        //        string productcode = dgvData.SelectedRows[0].Cells["PRODUCT_CODE"].Value.ToString();
        //        if (warehousecode != null && productcode != null)
        //        {
        //            FrmStockReView frm = new FrmStockReView();
        //            frm.WAREHOUSE = warehousecode;
        //            frm.PRODUCT = productcode;
        //            frm.TYPE = CConstant.STOCK_ALLOATION_LIST;
        //            DialogResult resule = frm.ShowDialog(this);
        //            frm.Enabled = false;
        //            frm.Dispose();
        //        }
        //        else
        //        {
        //            MessageBox.Show("请选择正确的行!");
        //        }
        //    }
        //    catch
        //    {
        //        MessageBox.Show("请先选择一行!");
        //    }

        //}
        #endregion

        #region 导出
        private void btnPrint_Click(object sender, EventArgs e)
        {
            _currentDt = bStock.GetStockPrintList(oldGetCondition).Tables[0];
            if (_currentDt.Rows.Count > 0 && isSearch)
            {
                int result = CExport.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);
                }
            }
        }
Exemplo n.º 5
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            DataTable printDataTable = bShipment.GetPrintList(currentConduction).Tables[0];

            if (isSearch && printDataTable.Rows.Count > 0)
            {
                int result = CExport.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);
                }
            }
        }
Exemplo n.º 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 = CExport.DataTableToExcel(_currentDt, RECEIPT_MATCH_HEADER, RECEIPT_MATCH_COLUMNS, "sheet1", "RECEIPT_MATCH");
                if (result == CConstant.EXPORT_SUCCESS)
                {
                    MessageBox.Show("导出成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Exemplo n.º 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 = CExport.DataTableToExcel(_currentDt, SALES_HEADER, SALES_COLUMNS, "sheet1", "SALES");
                if (result == CConstant.EXPORT_SUCCESS)
                {
                    MessageBox.Show("导出成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Exemplo n.º 8
0
 /// <summary>
 /// 导出
 /// </summary>
 private void btnExport_Click(object sender, EventArgs e)
 {
     if (_currentDt.Rows.Count > 0)
     {
         int result = CExport.DataTableToExcel(_currentDt, CConstant.AVAILABILITY_HEADER, CConstant.AVAILABILITY_COLUMNS, "AVAILABILITY", "AVAILABILITY");
         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);
     }
 }
Exemplo n.º 9
0
 /// <summary>
 /// 导出
 /// </summary>
 private void MasterToolBar_DoExport_Click(object sender, EventArgs e)
 {
     _currentDt = bProduct.GetList(GetConduction()).Tables[0];
     if (isSearch && _currentDt != null)
     {
         int result = CExport.DataTableToExcel(_currentDt, CConstant.PRODUCT_HEADER, CConstant.PRODUCT_COLUMNS, "PRODUCT", "PRODUCT");
         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);
     }
 }
 /// <summary>
 /// 导出
 /// </summary>
 private void MasterToolBar_DoExport_Click(object sender, EventArgs e)
 {
     _currentDt = bCompositionProductsSpecification.GetList(GetConduction()).Tables[0];
     if (isSearch && _currentDt.Rows.Count > 0)
     {
         int result = CExport.DataTableToExcel(_currentDt, CConstant.MACHINE_HEADER, CConstant.MACHINE_COLUMNS, "MACHINE", "MACHINE");
         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);
     }
 }
Exemplo n.º 11
0
        private void btnExport_Click(object sender, EventArgs e)
        {
            DataTable drawingDt = ds.Tables[0] as DataTable;

            if (drawingDt != null)
            {
                int result = CExport.DataTableToExcel(drawingDt, CConstant.DRAWING_HEADER, CConstant.DRAWING_COLUMNS, "DRAWING", "DRAWING");
                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);
            }
        }
Exemplo n.º 12
0
        private void btnExport_Click(object sender, EventArgs e)
        {
            DataTable productionDt = dt as DataTable;

            if (productionDt != null)
            {
                int result = CExport.DataTableToExcel(productionDt, CConstant.PRODUCTION_HEADER, CConstant.PRODUCTION_COLUMNS, "PRODUCTION", "PRODUCTION");
                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);
            }
        }