private string find_product_id_give_temp_selling_id(string tid) { DataTable dt = Select_Logic.get_data_with_two_para("select_product_id_give_temp_selling_id", tid); string s = dt.Rows[0][0].ToString(); return(s); }
private void bind_order() { DataTable dt = Select_Logic.load_order_data(); grv_order.DataSource = dt; grv_order.DataBind(); }
protected void grv_view_prod_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "sell") { User_Property_Tbl_Temp_Selling ut = new User_Property_Tbl_Temp_Selling(); ut.c_id = find_customer_id(); ut.p_id = e.CommandArgument.ToString(); ut.bill_no = Session["bill_no"].ToString(); string prod_price = ""; DataTable dt = Select_Logic.get_data_with_two_para("select_tbl_product_give_id", ut.p_id); prod_price = dt.Rows[0]["prod_price"].ToString(); ut.prod_price = find_product_price(); Insert_Logic.Insert_Temp_Selling(ut); Update_Logic.update_status("update_status_tbl_product_sp", "0", ut.p_id); //deduct stock from tbl_stock where p_id=here p_id DataTable dt1 = Select_Logic.Find_Stock_Information("tbl_stock_give_p_id", ut.p_id); int stock = Convert.ToInt32((dt1.Rows[0][2]).ToString()); stock = stock - 1; //update stock string sub_cat_id = dt.Rows[0]["sub_cat_id"].ToString(); Update_Logic.deduct_stock(sub_cat_id, stock.ToString()); } }
// add new product in grid view protected void Button3_Click(object sender, EventArgs e) { DataTable dt1 = Select_Logic.search_product("select_tbl_product_give_unique_no_sp", txt_unique_id2.Text); grv_view_prod.DataSource = dt1; grv_view_prod.DataBind(); }
private void bind_Dealer() { DataTable dt = Select_Logic.get_data_with_one_para("select_tbl_dealer_sp"); grv_dealer.DataSource = dt; grv_dealer.DataBind(); }
private void bind_product() { DataTable dt = Select_Logic.get_data_with_one_para("select_tbl_product_manage_sp"); grv_product.DataSource = dt; grv_product.DataBind(); }
//call when control is trasffered for update the details about the orders . //we load the data when first time loading the page private void fetch_data() { x = Session["id"].ToString(); Session["id"] = ""; DataTable dt = Select_Logic.get_data_with_two_para("select_tbl_manage_order_give_id_sp", x); ddl_order_quality.SelectedValue = dt.Rows[0]["order_quality"].ToString(); ddl_order_type.SelectedValue = dt.Rows[0]["o_type"].ToString(); ddl_sub_category_name.SelectedValue = dt.Rows[0]["sub_cat_id"].ToString(); bind_sub_category(); txt_book_no.Text = dt.Rows[0]["book_name"].ToString(); txt_customer_name.Text = dt.Rows[0]["c_name"].ToString(); txt_customer_mobile_no.Text = dt.Rows[0]["c_mobile_no"].ToString(); txt_customer_address.Text = dt.Rows[0]["c_address"].ToString(); txt_design_no.Text = dt.Rows[0]["design_no"].ToString(); txt_email_address.Text = dt.Rows[0]["c_email_address"].ToString(); txt_order_complete_date.Text = dt.Rows[0]["order_complete_date"].ToString(); txt_order_date.Text = dt.Rows[0]["order_Date"].ToString(); txt_prod_weight.Text = dt.Rows[0]["prod_weight"].ToString(); Session["cus_id"] = dt.Rows[0]["c_id"].ToString(); Button1.Text = "Edit"; }
protected void Button1_Click(object sender, EventArgs e) { DataTable dt = Select_Logic.select_tbl_product_selling_from_to(TextBox1.Text, TextBox2.Text); grd_selling.DataSource = dt; grd_selling.DataBind(); }
private void bind_Sub_Category() { DataTable dt = Select_Logic.get_data_with_one_para("select_tbl_sub_category_manage_sp"); grv_sub_cat.DataSource = dt; grv_sub_cat.DataBind(); }
protected string find_sub_cat_id() { DataTable dt = Select_Logic.Find_Sub_Category("select_tbl_sub_category_give_name", txt_sub_category_name.Text); string id = dt.Rows[0]["sub_cat_id"].ToString(); return(id); }
protected void Button1_Click(object sender, EventArgs e) { String username = txt_user_name.Text; String password = txt_password.Text; DataTable dt = Select_Logic.Login(username, password); String temp_u = ""; String temp_p = ""; try { temp_u = dt.Rows[0][1].ToString(); temp_p = dt.Rows[0][2].ToString(); } catch (IndexOutOfRangeException e1) { ErroeMessage.Text = "Invalid LogIn"; ErroeMessage.ForeColor = System.Drawing.Color.Red; } if (temp_u.Equals(username) && temp_p.Equals(password)) { Session["username"] = temp_u; Response.Redirect("home.aspx"); } else { ErroeMessage.Text = "Invalid LogIn"; ErroeMessage.ForeColor = System.Drawing.Color.Red; } }
protected void Page_Load(object sender, EventArgs e) { if (Session["username"] == "") { Response.Redirect("LoginPage.aspx"); } else { if (!IsPostBack) { dt = Select_Logic.find_user_data(Session["username"].ToString()); txt_user_name.Text = dt.Rows[0]["u_name"].ToString(); txt_address.Text = dt.Rows[0]["u_address"].ToString(); txt_shop_name.Text = dt.Rows[0]["u_shop_name"].ToString(); photo = dt.Rows[0]["u_photo"].ToString(); txt_user_name.Enabled = false; txt_shop_name.Enabled = false; txt_address.Enabled = false; txt_address.CssClass = "form-control"; txt_shop_name.CssClass = "form-control"; txt_user_name.CssClass = "form-control"; } } }
public void find_customer_data() { String bill = Session["Bill_no_customer_page"].ToString(); DataTable dt = Select_Logic.find_remaining_customer_Data("tbl_remaining_customer", bill); if (dt.Rows.Count == 0) { //set error message Session["error_product_selling_page"] = "No Data Found"; Response.Redirect("home.aspx"); } txt_current_gold_price.Enabled = false; txt_customer_address.Text = dt.Rows[0]["c_address"].ToString(); txt_email_address.Text = dt.Rows[0]["c_email_address"].ToString(); txt_mobile_no.Text = dt.Rows[0]["c_mobile_no"].ToString(); txt_customer_name.Text = dt.Rows[0]["c_name"].ToString(); txt_purchase_date.Text = dt.Rows[0]["purchase_date"].ToString(); txt_total_amount.Text = dt.Rows[0]["remaining_amount"].ToString(); btn_ok.Enabled = false; txt_unique_id2.Enabled = false; grv_view_prod.Enabled = false; Button5.Enabled = false; grv_prod_selling.Enabled = false; }
protected void gridview_PageIndexChanging(object sender, GridViewPageEventArgs e) { grd_customer.PageIndex = e.NewPageIndex; DataTable dt = Select_Logic.find_customer_pending_bill(); grd_customer.DataSource = dt; grd_customer.DataBind(); }
protected void gridview_PageIndexChanging(object sender, GridViewPageEventArgs e) { grd_incomplete_order.PageIndex = e.NewPageIndex; DataTable dt = Select_Logic.find_incomplete_order(); grd_incomplete_order.DataSource = dt; grd_incomplete_order.DataBind(); }
protected void gridview_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView1.PageIndex = e.NewPageIndex; DataTable dt = Select_Logic.load_order_remaining_amount(); GridView1.DataSource = dt; GridView1.DataBind(); }
protected void gridview_PageIndexChanging(object sender, GridViewPageEventArgs e) { grd_selling.PageIndex = e.NewPageIndex; DataTable dt = Select_Logic.select_tbl_product_selling_from_to(TextBox1.Text, TextBox2.Text); grd_selling.DataSource = dt; grd_selling.DataBind(); }
protected void gridview_PageIndexChanging(object sender, GridViewPageEventArgs e) { grv_cat.PageIndex = e.NewPageIndex; DataTable dt = Select_Logic.get_data_with_one_para("select_tbl_category_sp"); grv_cat.DataSource = dt; grv_cat.DataBind(); }
private string find_product_price() { DataTable dt = Select_Logic.get_data_with_two_para("select_tbl_product_give_id", Session["id"].ToString()); string weight = dt.Rows[0]["prod_weight"].ToString(); int prod_price = (Convert.ToInt32(txt_current_gold_price.Text) * Convert.ToInt32(weight)) / 10; return(prod_price.ToString()); }
public void fetch_data() { id = Session["id"].ToString(); Session["id"] = ""; DataTable dt = Select_Logic.get_data_with_two_para("select_tbl_category_give_id_sp", id); txt_category_name.Text = dt.Rows[0]["cat_name"].ToString(); btn_ok.Text = "Edit"; }
protected void gridview_PageIndexChanging(object sender, GridViewPageEventArgs e) { grv_order.PageIndex = e.NewPageIndex; DataTable dt = Select_Logic.load_order_data(); grv_order.DataSource = dt; grv_order.DataBind(); grv_order.DataBind(); }
private void bind_sub_category() { DataTable dt = Select_Logic.get_data_with_one_para("select_tbl_sub_category_sp"); ddl_sub_category_name.DataSource = dt; ddl_sub_category_name.DataTextField = "sub_cat_name"; ddl_sub_category_name.DataValueField = "sub_cat_id"; ddl_sub_category_name.DataBind(); ddl_sub_category_name.Items.Insert(0, "--Select Category--"); }
protected void Page_Load(object sender, EventArgs e) { if (Session["username"] == "") { Response.Redirect("LoginPage.aspx"); } DataTable dt = Select_Logic.find_incomplete_order(); grd_incomplete_order.DataSource = dt; grd_incomplete_order.DataBind(); }
private void deduct_stock_delete_product(string id) { DataTable dt = Select_Logic.Find_Stock_Information("tbl_stock_give_p_id", id); int stock = Convert.ToInt32((dt.Rows[0][2]).ToString()); stock = stock - 1; //update stock string sub_cat_id = dt.Rows[0]["sub_cat_id"].ToString(); Update_Logic.deduct_stock(sub_cat_id, stock.ToString()); }
public void fetch_data() { id = Session["id"].ToString(); Session["id"] = ""; DataTable dt = Select_Logic.get_data_with_two_para("select_tbl_dealer_give_id_sp ", id); txt_dealer_name.Text = dt.Rows[0]["d_name"].ToString(); txt_dealer_email.Text = dt.Rows[0]["d_email_address"].ToString(); txt_dealer_location.Text = dt.Rows[0]["d_location"].ToString(); btn_ok.Text = "Edit"; }
private void bind_stock() { DataTable dt = Select_Logic.get_data_with_one_para("select_tbl_stock_manage_sp"); dt.Columns.Add("dt_purchase_date"); foreach (DataRow dr in dt.Rows) { dr["dt_purchase_date"] = Convert.ToDateTime(dr["last_update_date"]).ToString("dd/MM/yyyy"); } grv_stock.DataSource = dt; grv_stock.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { DataTable dt = Select_Logic.selling_data(); if (dt.Rows.Count > 0) { ReportDocument data = new ReportDocument(); Total_Selling ts = new Total_Selling(); data.Load(Server.MapPath("Report_Total_Selling_Product.rpt")); //crystal report will be loaded in report document data.SetDataSource(dt); //all data will be filled in report from data table CrystalReportViewer1.ReportSource = data; //assign data in crystal report } }
private void fetch_data() { id = Session["id"].ToString(); Session["id"] = ""; DataTable dt = Select_Logic.get_data_with_two_para("select_tbl_sub_category_give_id", id); ddl_sub_category.SelectedValue = dt.Rows[0]["cat_id"].ToString(); Bind_Category(); txt_sub_category_name.Text = dt.Rows[0]["sub_cat_name"].ToString(); btn_ok.Text = "Edit"; }
protected void Page_Load(object sender, EventArgs e) { if (Session["username"] == "") { Response.Redirect("LoginPage.aspx"); } else { DataTable dt = Select_Logic.load_order_remaining_amount(); GridView1.DataSource = dt; GridView1.DataBind(); } }
//fetch final products data in main grid view protected void fetch_sell_data() { // String id = Session["id"].ToString(); DataTable dt = Select_Logic.Find_Selling_Data("select_selling_data_give_billno_cus_id_sp ", find_customer_id(), Session["bill_no"].ToString()); grv_prod_selling.DataSource = dt; grv_prod_selling.DataBind(); DataTable dt1 = Select_Logic.Find_Total_Payment("select_total_payment_temp_selling_sp", find_customer_id(), Session["bill_no"].ToString()); txt_total_amount.Text = dt1.Rows[0][0].ToString(); }