public static product_model select_id(int product_id) { My_Connection conn = new My_Connection(); SqlParameter[] p = new SqlParameter[1]; p[0] = new SqlParameter("@id", product_id); DataSet ds = conn.select_id("sp_product_select_id", p); if (ds.Tables[0].Rows.Count == 0) { return(null); } else { DataRow dr = ds.Tables[0].Rows[0]; product_model product = new product_model(); product.product_id = int.Parse(dr["product_id"].ToString()); product.product_name = dr["product_name"].ToString(); product.product_code = dr["product_code"].ToString(); product.product_price = int.Parse(dr["product_price"].ToString()); product.product_short_description = dr["product_short_description"].ToString(); product.product_warranty = int.Parse(dr["product_warranty"].ToString()); product.product_stock = int.Parse(dr["product_stock"].ToString()); product.product_main_image = dr["product_main_image"].ToString(); product.product_status = Boolean.Parse(dr["product_status"].ToString()); return(product); } }
public static company_master_modal select_id(int company_id) { My_Connection conn = new My_Connection(); SqlParameter [] p = new SqlParameter[1]; p[0] = new SqlParameter("@company_id", company_id); DataSet ds = conn.select_id("sp_company_master_select_id", p); if (ds.Tables[0].Rows.Count == 0) { return(null); } else { DataRow dr = ds.Tables[0].Rows[0]; company_master_modal company = new company_master_modal(); company.company_id = int.Parse(dr["company_id"].ToString()); company.company_name = dr["company_name"].ToString(); company.company_status = Boolean.Parse(dr["company_status"].ToString()); return(company); } }
public static product_images_model select_id(int product_image_id) { My_Connection conn = new My_Connection(); SqlParameter[] p = new SqlParameter[1]; p[0] = new SqlParameter("@product_image_id", product_image_id); DataSet ds = conn.select_id("sp_product_images_select_id", p); if (ds.Tables[0].Rows.Count == 0) { return(null); } else { DataRow dr = ds.Tables[0].Rows[0]; product_images_model product_image = new product_images_model(); product_image.product_image_id = int.Parse(dr["product_image_id"].ToString()); product_image.product_secondary_image = dr["product_secondary_image"].ToString(); product_image.product_image_status = Boolean.Parse(dr["product_image_status"].ToString()); return(product_image); } }
public static seller_registration_model login_seller(string username, string password) { My_Connection con = new My_Connection(); SqlParameter[] p = new SqlParameter[2]; p[0] = new SqlParameter("@username", username); p[1] = new SqlParameter("@password", password); DataSet ds = con.select_id("sp_seller_registration_check", p); if (ds.Tables[0].Rows.Count == 0) { return(null); } else { DataRow dr = ds.Tables[0].Rows[0]; seller_registration_model srm = new seller_registration_model(); srm.user_name = dr["user_name"].ToString(); srm.password = dr["password"].ToString(); return(srm); } }
public static void select_id(int product_review_id) { My_Connection con = new My_Connection(); SqlParameter[] p = new SqlParameter[1]; p[0] = new SqlParameter("@product_review_id", product_review_id); con.select_id("sp_product_review_select_id", p); }
public static void delete(int order_id) { My_Connection conn = new My_Connection(); SqlParameter[] p = new SqlParameter[1]; p[0] = new SqlParameter("@order_master_id", order_id); conn.select_id("sp_order_master_delete", p); }
public static void delete(int final_id) { My_Connection conn = new My_Connection(); SqlParameter[] p = new SqlParameter[1]; p[0] = new SqlParameter("@cart_id", final_id); conn.select_id("sp_final_cart_delete", p); }
public static void select_id(int dummy_id) { My_Connection conn = new My_Connection(); SqlParameter[] p = new SqlParameter[1]; p[0] = new SqlParameter("@cart_id", dummy_id); conn.select_id("sp_dummy_cart_select_id", p); }
public static void delete(int product_id) { My_Connection conn = new My_Connection(); SqlParameter[] p = new SqlParameter[1]; p[0] = new SqlParameter("@id", product_id); conn.select_id("sp_product_delete", p); }
public static void select_id(int seller_id) { My_Connection con = new My_Connection(); SqlParameter[] p = new SqlParameter[1]; p[0] = new SqlParameter("@seller_id", seller_id); con.select_id("sp_seller_registration_select_id", p); }
public static menu_category_model select_id(int menu_category_id) { My_Connection conn = new My_Connection(); SqlParameter[] p = new SqlParameter[1]; p[0] = new SqlParameter("@menu_category_id", menu_category_id); DataSet ds = conn.select_id("sp_menu_category_select_id", p); if (ds.Tables[0].Rows.Count == 0) { return(null); } else { DataRow dr = ds.Tables[0].Rows[0]; menu_category_model menu = new menu_category_model(); menu.menu_category_id = int.Parse(dr["menu_category_id"].ToString()); menu.menu_category_name = dr["menu_category_name"].ToString(); menu.menu_category_status = Boolean.Parse(dr["menu_category_status"].ToString()); return(menu); } }