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); }
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()); } }
//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"; }
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"; }
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_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 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"; }
//load data when update is required private void fetch_product() { id = Session["id"].ToString(); Session["id"] = ""; DataTable dt = Select_Logic.get_data_with_two_para("select_tbl_product_give_id", id); txt_product_name.Text = dt.Rows[0]["prod_name"].ToString(); txt_generate_unique_no.Text = dt.Rows[0]["prod_unique_no"].ToString(); txt_product_description.Text = dt.Rows[0]["prod_description"].ToString(); txt_weight.Text = dt.Rows[0]["prod_weight"].ToString(); ddl_dealer_name.SelectedValue = dt.Rows[0]["d_id"].ToString(); bind_dealer(); ddl_product_quality.SelectedValue = dt.Rows[0]["prod_quality"].ToString(); ddl_product_type.SelectedValue = dt.Rows[0]["prod_type"].ToString(); ddl_sub_category_name.SelectedValue = dt.Rows[0]["sub_cat_id"].ToString(); bind_sub_category(); }
private void fetch_old_gold() { s_id = Session["id"].ToString(); Session["id"] = ""; DataTable dt = Select_Logic.get_data_with_two_para("select_tbl_old_intake_give_id", s_id); txt_customer_name.Text = dt.Rows[0]["c_name"].ToString(); txt_email_address.Text = dt.Rows[0]["c_email_address"].ToString(); txt_customer_mobile_no.Text = dt.Rows[0]["c_mobile_no"].ToString(); txt_customer_address.Text = dt.Rows[0]["c_address"].ToString(); Session["cus_id"] = dt.Rows[0]["c_id"].ToString(); ddl_sub_category_name.SelectedValue = dt.Rows[0]["sub_cat_id"].ToString(); bind_sub_category(); txt_prod_price.Text = dt.Rows[0]["prod_price"].ToString(); txt_prod_description.Text = dt.Rows[0]["prod_description"].ToString(); txt_weight.Text = dt.Rows[0]["prod_weight"].ToString(); txt_purchase_date.Text = dt.Rows[0]["in_date"].ToString(); ddl_order_quality.SelectedValue = dt.Rows[0]["prod_quality"].ToString(); ddl_product_type.SelectedValue = dt.Rows[0]["prod_type"].ToString(); Button1.Text = "Edit"; }