Exemple #1
0
        public void bill_printing_for_58()
        {
            blp.bill_no     = bill_no_print;
            blp.cashier     = dataGridView1.CurrentRow.Cells["calcashier_name"].Value.ToString();
            blp.cash_amount = dataGridView1.CurrentRow.Cells["calcashamt"].Value.ToString();
            blp.discount    = dataGridView1.CurrentRow.Cells["cal_discount"].Value.ToString();
            blp.grand_total = dataGridView1.CurrentRow.Cells["cal_grand_total"].Value.ToString();
            blp.sub_total   = dataGridView1.CurrentRow.Cells["cal_sub_total"].Value.ToString();
            blp.table_no    = dataGridView1.CurrentRow.Cells["cal_table_no"].Value.ToString();
            DateTime date_of_billing = Convert.ToDateTime(dataGridView1.CurrentRow.Cells["caldate"].Value);

            blp.print_again = true;
            DataTable dt = blod.searchbybill2(bill_no);

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    blp.datagridview_item_name.Add(dt.Rows[i]["item_name"].ToString());
                    blp.datagridview_item_price.Add(dt.Rows[i]["cost"].ToString());
                    blp.datagridview_total.Add(dt.Rows[i]["total"].ToString());
                    blp.datagridview_quantity.Add(dt.Rows[i]["quantity"].ToString());
                }
                blp.tax_amount     = dt.Rows[0]["tax_amount"].ToString();
                blp.service_charge = dt.Rows[0]["service_charge"].ToString();
            }
            blp.printtobill();
            save_after_print = blp.save_after_print;
        }
Exemple #2
0
        public void bill_printing_for_hotel()
        {
            string bill_no = dataGridView1.CurrentRow.Cells["calbill_no"].Value.ToString();

            bph.bill_no              = bill_no;
            bph.cashier              = dataGridView1.CurrentRow.Cells["calcashier_name"].Value.ToString();
            bph.cash_amount          = dataGridView1.CurrentRow.Cells["calcashamt"].Value.ToString();
            bph.discount             = dataGridView1.CurrentRow.Cells["cal_discount"].Value.ToString();
            bph.grand_total          = dataGridView1.CurrentRow.Cells["cal_grand_total"].Value.ToString();
            bph.sub_total            = dataGridView1.CurrentRow.Cells["cal_sub_total"].Value.ToString();
            bph.table_no             = dataGridView1.CurrentRow.Cells["cal_table_no"].Value.ToString();
            bph.print_again          = true;
            bph.duplicate_bill_print = true;
            bph.mobile_no            = dataGridView1.CurrentRow.Cells["cal_customer_pan"].Value.ToString();
            bph.customer_name        = dataGridView1.CurrentRow.Cells["cal_customer_name"].Value.ToString();
            DateTime  date_of_billing = Convert.ToDateTime(dataGridView1.CurrentRow.Cells["cal_date2"].Value);
            DataTable dt_bil          = blbt.get_all_tax_by_bill_no(bill_no, date_of_billing);

            if (dt_bil.Rows.Count > 0)
            {
                bph.tax_amount     = dt_bil.Rows[0]["tax_amount"].ToString();
                bph.service_charge = dt_bil.Rows[0]["service_charge"].ToString();
            }
            DataTable dt = blod.searchbybill2(bill_no);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                bph.datagridview_item_name.Add(dt.Rows[i]["item_name"].ToString());
                bph.datagridview_item_price.Add(dt.Rows[i]["cost"].ToString());
                bph.datagridview_total.Add(dt.Rows[i]["total"].ToString());
                bph.datagridview_quantity.Add(dt.Rows[i]["quantity"].ToString());
            }
            bph.print();
            save_after_print = blp_80.save_after_print;
        }
Exemple #3
0
        // bool save_after_print;
        public void bill_printing_for_80()
        {
            string bill_no = dataGridView1.CurrentRow.Cells["col_bill_no"].Value.ToString();

            blp_80.bill_no = bill_no;

            // blp_80.c = dataGridView1.CurrentRow.Cells["col_credit_amount"].Value.ToString();
            blp_80.customer_name = dataGridView1.CurrentRow.Cells["col_customername"].Value.ToString();
            //blp_80.credit_by = dataGridView1.CurrentRow.Cells["col_credit_by"].Value.ToString();
            //blp_80.credit_date = dataGridView1.CurrentRow.Cells["col_credit_date"].Value.ToString();
            //  bph.credit_by = dataGridView1.CurrentRow.Cells["col_customername"].Value.ToString();

            DateTime date_of_billing = Convert.ToDateTime(dataGridView1.CurrentRow.Cells["col_credit_date"].Value);


            DataTable dt = blod.searchbybill2(bill_no);

            blp_80.table_no       = dt.Rows[0]["table_no"].ToString();
            blp_80.discount       = dt.Rows[0]["discount"].ToString();
            blp_80.grand_total    = dt.Rows[0]["grand_total"].ToString();
            blp_80.sub_total      = dt.Rows[0]["sub_total"].ToString();
            blp_80.tax_amount     = dt.Rows[0]["tax_amount"].ToString();
            blp_80.service_charge = dt.Rows[0]["service_charge"].ToString();

            blp_80.billing_date = Convert.ToDateTime(dt.Rows[0]["date_of_sale"]);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                blp_80.datagridview_item_name.Add(dt.Rows[i]["item_name"].ToString());
                blp_80.datagridview_item_price.Add(dt.Rows[i]["cost"].ToString());
                blp_80.datagridview_total.Add(dt.Rows[i]["total"].ToString());
                blp_80.datagridview_quantity.Add(dt.Rows[i]["quantity"].ToString());
                blp_80.datagridview_complementary.Add("");
            }
            blp_80.printtobill();
            //save_after_print = blp_80.save_after_print;
        }
        private void datatableLoad()
        {
            if (cbo_searchTYpe.Text == "" || cbo_searchTYpe.Text == "Choose Type" || txt_searchText.Text == "")
            {
                MessageBox.Show("The Fields are Empty or invalid.");
            }

            else
            {
                string    theDate  = dtp_from.Value.ToString("yyyy-MM-dd") + " " + cbo_from_hours.Text + ":" + cbo_minuts_from.Text + ":00";
                string    theDate2 = dtp_to.Value.ToString("yyyy-MM-dd") + " " + cbo_to_hours.Text + ":" + cbo_minuts.Text + ":00";
                DateTime  dateOne  = Convert.ToDateTime(theDate);
                DateTime  datetwo  = Convert.ToDateTime(theDate2);
                DataTable dtfis    = blrr.GetFiscalYearsales(dateOne, datetwo);
                if (dtfis.Rows.Count > 0)
                {
                    fiscal_year = dtfis.Rows[0]["fiscal_year"].ToString();
                }
                else
                {
                    DataTable dt = blfs.get_all_data_from_fiscal("True");
                    if (dt.Rows.Count > 0)
                    {
                        fiscal_year = dt.Rows[0]["fiscal_year"].ToString();
                    }
                }
                if (cbo_searchTYpe.Text == "Item")
                {
                    colunm_name = "item_name";
                }
                else if (cbo_searchTYpe.Text == "Category")
                {
                    colunm_name = "category_name";
                }
                else if (cbo_searchTYpe.Text == "Bill No")
                {
                    colunm_name = "bill_no";
                }

                else if (cbo_searchTYpe.Text == "Payment Mode")
                {
                    colunm_name = "payment_mode";
                }

                else if (cbo_searchTYpe.Text == "KOT Type")
                {
                    colunm_name = "kot_type";
                }
                else if (cbo_searchTYpe.Text == "Sales Type")
                {
                    colunm_name = "sales_type";
                }
                else if (cbo_searchTYpe.Text == "User")
                {
                    colunm_name = "cashier_name";
                }
                else if (cbo_searchTYpe.Text == "Service provider")
                {
                    colunm_name = "service_provider";
                }
                int intSkip = 0;

                intSkip = (this.mintCurrentPage * this.mintPageSize);
                if (cbo_searchTYpe.Text == "ALL")
                {
                    dt_report = blod.searchALLSalesWithoutpagination(dateOne, datetwo, fiscal_year);
                    dtLoad    = blod.searchALLSales(dateOne, datetwo, mintPageSize, intSkip, fiscal_year);
                    dtSum     = blrr.totalSalesSum(dateOne, datetwo, fiscal_year);
                    DataGridViewLoad();
                }
                else if (cbo_searchTYpe.Text == "Bill No")
                {
                    dtLoad    = blod.searchbybill2(txt_searchText.Text);
                    dt_report = blod.searchbybill2(txt_searchText.Text);
                    dtSum     = blrr.totalSalesSumByBillNo(txt_searchText.Text, fiscal_year);
                    DataGridViewLoad();
                }
                else if (cbo_searchTYpe.Text == "Category Group")
                {
                    dtLoad    = blcg.getallFromView(dateOne, datetwo, txt_searchText.Text);
                    dt_report = blcg.getallFromView(dateOne, datetwo, txt_searchText.Text);
                    DataGridViewLoad();
                }
                else
                {
                    dtLoad    = brr.searchitembyColumnNameDynamic(txt_searchText.Text, dateOne, datetwo, colunm_name, fiscal_year);
                    dt_report = brr.searchitembyColumnNameDynamic(txt_searchText.Text, dateOne, datetwo, colunm_name, fiscal_year);
                    // dtSum = blrr.totalSalesSumBYdifferentColumn(txt_searchText.Text, dateOne, datetwo, colunm_name);
                    DataGridViewLoad();
                }
                this.status = (this.mintCurrentPage + 1).ToString() + " / " + this.mintPageCount.ToString();
            }
        }