Example #1
0
        /// <summary>
        /// 导出
        /// </summary>
        private void MasterToolBar_DoExport_Click(object sender, EventArgs e)
        {
            _currentDt = bSafetyStock.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 { }
                }
                SaveFileDialog sf = new SaveFileDialog();
                sf.FileName = "LZ_SAFETY_STOCK_" + 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\n";
                if (sf.ShowDialog(this) == DialogResult.OK)
                {
                    int result = CExport.DataTableToCsv(_currentDt, header, sf.FileName);
                    if (result == 0)
                    {
                        MessageBox.Show("导出成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
        }
Example #2
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            _currentDt = bProductBuild.GetBuildSearchPrintList(GetConduction()).Tables[0];
            _currentDt.Columns.Add("STATUS");
            foreach (DataRow row in _currentDt.Rows)
            {
                if (CConvert.ToInt32(row["STATUS_FLAG"]) == CConstant.BUILD_STATUS)
                {
                    row["STATUS"] = "组成";
                }
            }
            _currentDt.Columns.Remove("STATUS_FLAG");
            if (_currentDt.Rows.Count > 0 && isSearch)
            {
                SaveFileDialog sf = new SaveFileDialog();
                sf.FileName = "HD_BUILD_SEARCH_" + 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\n";
                if (sf.ShowDialog(this) == DialogResult.OK)
                {
                    if (_currentDt != null)
                    {
                        int result = CExport.DataTableToCsv(_currentDt, header, sf.FileName);
                        if (result == 0)
                        {
                            MessageBox.Show("成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                }
            }
        }
Example #3
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            int recordCount = bPurchase.GetPurchaseRecordCount(GetCondition());

            _currentDt = bPurchase.GetPurchaseList(GetCondition(), "", 1, recordCount).Tables[0];
            if (isSearch && _currentDt != null)
            {
                SaveFileDialog sf = new SaveFileDialog();
                sf.FileName = "LZ_PURCHASE_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xlsx";
                sf.Filter   = "(文件)|*.xls;*.xlsx";
                string header = "画面明细编号\t采购内部编号\t供应商编号\t供应商名称\t供应商类型\t供应商类型名称\t供应商类型名称\t国外发票No\t国外发票金额\t国内发票No\t" +
                                "国内发票金额\t付款状态\t付款状态名称\t开票日期\t付款预定日\t通货编号\t通货名称\t状态\t\n";
                if (sf.ShowDialog(this) == DialogResult.OK)
                {
                    _currentDt.Columns.Remove("INVOICE_No");
                    _currentDt.Columns.Remove("INVOICE_NO_AMOUNT");
                    if (_currentDt != null)
                    {
                        int result = CExport.DataTableToCsv(_currentDt, header, sf.FileName);
                        if (result == 0)
                        {
                            MessageBox.Show("导出成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                }
            }
        }
Example #4
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            int recordCount = bPaymentMatch.GetPaymentMatchSearchRecordCount(GetCondition());

            _currentDt = bPaymentMatch.GetPaymentMatchSearchList(GetCondition(), "", 1, recordCount).Tables[0];
            if (isSearch && _currentDt.Rows.Count > 0)
            {
                SaveFileDialog sf = new SaveFileDialog();
                sf.FileName = "LZ_PAYEMNT_MATCH_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xlsx";
                sf.Filter   = "(文件)|*.xls;*.xlsx";

                string header = "序号\t付款编号\t供应商名称\t付款日期\t发票编号\t发票金额\t通货名称\t预付款金额\t付款金额\t状态\t\n";
                if (sf.ShowDialog(this) == DialogResult.OK)
                {
                    if (_currentDt != null)
                    {
                        int result = CExport.DataTableToCsv(_currentDt, header, sf.FileName);
                        if (result == 0)
                        {
                            MessageBox.Show("导出成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                }
            }
        }
Example #5
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            if (slipnumber != null && status_flag == CConstant.INVENTORY_END)
            {
                try
                {
                    //if (hashtb.Count > 0)
                    //{
                    int s = bInventory.UpdataInventory(slipnumber, hashtb, _userInfo.CODE, true);
                    if (s <= 0)
                    {
                        MessageBox.Show("盘点失败!");
                    }
                    else
                    {
                        MessageBox.Show("盘点成功!");
                    }
                    //}
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else if (slipnumber == null)
            {
                _currentdt = bInventory.GetStartPrintList(txtWarehouseCode.Text.Trim()).Tables[0];
                if (_currentdt.Rows.Count > 0 && isSearch)
                {
                    SaveFileDialog sf = new SaveFileDialog();
                    sf.FileName = "HD_INVENTORY_START_" + 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\n";
                    if (sf.ShowDialog(this) == DialogResult.OK)
                    {
                        if (_currentdt != null)
                        {
                            int result = CExport.DataTableToCsv(_currentdt, header, sf.FileName);
                            if (result == 0)
                            {
                                MessageBox.Show("成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            }
                        }
                    }
                }
            }
        }
Example #6
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            _currentDt = bProductBuild.GetBuildPrintList(GetConduction()).Tables[0];
            _currentDt.Columns.Add("PURCHASE_QUANTITY");
            _currentDt.Columns.Add("NO_ALLOATION");
            _currentDt.Columns.Add("STATUE_FLAG");

            foreach (DataRow rows in _currentDt.Rows)
            {
                rows["PURCHASE_QUANTITY"] = CConvert.ToDecimal(rows["QUANTITY"]) * CConvert.ToDecimal(txtQuantity.Text.Trim());
                decimal        alloationQuantity = bAlloation.GetAlloationQuantity(txtWarehouse.Text.Trim(), CConvert.ToString(rows["PRODUCT_PART_CODE"]));
                BaseStockTable stock             = new BaseStockTable();
                stock = bPurchaseOrder.GetStockModel(txtWarehouse.Text.Trim(), CConvert.ToString(rows["PRODUCT_PART_CODE"]));
                rows["NO_ALLOATION"] = stock.QUANTITY - alloationQuantity;
                if (CConvert.ToDecimal(rows["NO_ALLOATION"]) >= CConvert.ToDecimal(rows["PURCHASE_QUANTITY"]))
                {
                    rows["STATUE_FLAG"] = "OK";
                }
                else
                {
                    rows["STATUE_FLAG"] = "NG";
                }
            }
            if (_currentDt.Rows.Count > 0 && isSearch)
            {
                SaveFileDialog sf = new SaveFileDialog();
                sf.FileName = "HD_BUILD_PRINT_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
                sf.Filter   = "(文件)|*.xls;*.xlsx";

                string header = "组成品编号\t组成品名称\t材料编号\t材料名称\t材料规格\t单位编号\t单位名称\t最小构成数量\t需求数量\t未引当数量\t状况\t\n";
                if (sf.ShowDialog(this) == DialogResult.OK)
                {
                    if (_currentDt != null)
                    {
                        int result = CExport.DataTableToCsv(_currentDt, header, sf.FileName);
                        if (result == 0)
                        {
                            MessageBox.Show("成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                }
            }
        }
Example #7
0
        /// <summary>
        /// 导出
        /// </summary>
        private void MasterToolBar_DoExport_Click(object sender, EventArgs e)
        {
            _currentDt = bCustomerReported.GetList(GetConduction()).Tables[0];
            if (isSearch && _currentDt != null)
            {
                SaveFileDialog sf = new SaveFileDialog();
                sf.FileName = "LZ_CUSTOMER_REPORTED_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
                sf.Filter   = "(文件)|*.xls;*.xlsx";

                string header = "客户编号\t客户名称\t报备客户编号\t报备客户名称\t报备日期\t有效日期\t状态\t创建人员\t创建时间\t最后更新人\t最后更新时间\t\n";
                if (sf.ShowDialog(this) == DialogResult.OK)
                {
                    int result = CExport.DataTableToCsv(_currentDt, header, sf.FileName);
                    if (result == 0)
                    {
                        MessageBox.Show("导出成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
        }
Example #8
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            int recordCount = bSales.GetUnReceiptRecordCount(GetCondition());

            _currentDt = bSales.GetUnReceiptList(GetCondition(), "", 1, recordCount).Tables[0];
            if (isSearch && _currentDt.Rows.Count > 0)
            {
                SaveFileDialog sf = new SaveFileDialog();
                sf.FileName = "LZ_UNRECEIPT_MATCH_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xlsx";
                sf.Filter   = "(文件)|*.xls;*.xlsx";

                string header = "画面明细编号\t销售内部编号\t请款公司编号\t请款公司名称\t开票日期\t发票编号\t发票金额\t通货\t收款预定日\t未收金额\t状态\t\n";
                if (sf.ShowDialog(this) == DialogResult.OK)
                {
                    //_currentDt.Columns.Remove("Row");
                    int result = CExport.DataTableToCsv(_currentDt, header, sf.FileName);
                    if (result == 0)
                    {
                        MessageBox.Show("导出成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            _currentDt = bStock.GetPrintList(GetConduction()).Tables[0];
            if (isSearch && _currentDt != null)
            {
                SaveFileDialog sf = new SaveFileDialog();
                sf.FileName = "HD_STOCK_ADJUSTMENT_" + 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\n";
                if (sf.ShowDialog(this) == DialogResult.OK)
                {
                    if (_currentDt != null)
                    {
                        int result = CExport.DataTableToCsv(_currentDt, header, sf.FileName);
                        if (result == 0)
                        {
                            MessageBox.Show("成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                }
            }
        }
Example #10
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            _currentDt = bStock.GetDelayPrintList(GetConduction()).Tables[0];
            if (_currentDt.Rows.Count > 0 && isSearch)
            {
                SaveFileDialog sf = new SaveFileDialog();
                sf.FileName = "HD_DELAY_" + 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\n";
                if (sf.ShowDialog(this) == DialogResult.OK)
                {
                    if (_currentDt != null)
                    {
                        int result = CExport.DataTableToCsv(_currentDt, header, sf.FileName);
                        if (result == 0)
                        {
                            MessageBox.Show("成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                }
            }
        }
Example #11
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            _currentDt = bInventory.GetEndPrintList(GetConduction()).Tables[0];
            if (_currentDt.Rows.Count > 0 && isSearch)
            {
                SaveFileDialog sf = new SaveFileDialog();
                sf.FileName = "HD_INVENTORY_SEARCH_" + 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明细状态\n";
                if (sf.ShowDialog(this) == DialogResult.OK)
                {
                    if (_currentDt != null)
                    {
                        int result = CExport.DataTableToCsv(_currentDt, header, sf.FileName);
                        if (result == 0)
                        {
                            MessageBox.Show("成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                }
            }
        }