public string GetSubCategoryPrice(PropSubcategory objsubCategory, string userName) { if (userName != null && userName != "") { SqlCommand cmd = new SqlCommand("proc_subCategory", objCon.Con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Action", "GetSubCategoryPrice"); cmd.Parameters.AddWithValue("@status", objsubCategory.flag); cmd.Parameters.AddWithValue("@id", objsubCategory.ID); SqlDataAdapter adpt = new SqlDataAdapter(); DataSet ds = new DataSet(); if (objCon.Con.State == ConnectionState.Open) { } else { objCon.Con.Open(); } cmd.Connection = objCon.Con; adpt.SelectCommand = cmd; adpt.Fill(ds, "SubCategoryPrice"); objCon.Con.Close(); return(ds.GetXml()); } else { return("Not Valid"); } }
/// <summary> /// This Method is used to Delete data into tbl_category table /// </summary> /// <param name="objsubCategory">ID and Action</param> /// <returns>1 for success and -1 for fail</returns> public string DeleteSubCategory(PropSubcategory objsubCategory, string userName) { if (userName != null && userName != "") { SqlCommand cmd = new SqlCommand("proc_subCategory", objCon.Con); cmd.CommandType = CommandType.StoredProcedure; objCon.Con.Open(); try { cmd.Parameters.AddWithValue("@ID", objsubCategory.ID); cmd.Parameters.AddWithValue("@status", objsubCategory.flag); cmd.Parameters.AddWithValue("@Action", "Delete"); return(cmd.ExecuteNonQuery().ToString()); } catch (Exception showError) { throw showError; } finally { cmd.Dispose(); objCon.Con.Close(); objCon.Con.Dispose(); } } else { return("Not Valid"); } }
public string AssociateSubCategory(int Categoryid) { string str = string.Empty; PropSubcategory propSubCategory = new PropSubcategory(); propSubCategory.CategoryIDValue = Categoryid; BllSubCategory objSubCategory = new BllSubCategory(); str = objSubCategory.AssociateSubCategory(propSubCategory, Session["associate"].ToString()); return(str); }
public string SubCategories(int Categoryid) { string str = string.Empty; PropSubcategory propSubCategory = new PropSubcategory(); propSubCategory.CategoryIDValue = Categoryid; BllSubCategory objSubCategory = new BllSubCategory(); str = objSubCategory.GetSubCategories(propSubCategory); return(str); }
public string SelectCatSubCategory(int flag, int Categoryid) { string str = string.Empty; PropSubcategory propSubCategory = new PropSubcategory(); propSubCategory.flag = flag; propSubCategory.CategoryIDValue = Categoryid; BllSubCategory objSubCategory = new BllSubCategory(); str = objSubCategory.CateSubcategory(propSubCategory); return(str); }
public string CategoryWiseSubCategoryOfAssociate(int Categoryid) { string str = string.Empty; if (Session["associate"].ToString() != "" || Session["associate"].ToString() != null) { PropSubcategory propSubCategory = new PropSubcategory(); propSubCategory.CategoryIDValue = Categoryid; BllSubCategory objSubCategory = new BllSubCategory(); str = objSubCategory.CategoryWiseSubCategoryofAssociate(propSubCategory, Session["associate"].ToString()); return(str); } else { return("Error in Authentication"); } }
/// <summary> /// This Method is used to Select data /// </summary> /// <param name="objCategory">Action</param> /// <returns>1 for success and -1 for fail</returns> public string RecordSelect(PropSubcategory objProperty, string UserName) { DllSubCategory objDal = new DllSubCategory(); try { return(objDal.SelectSubCategory(objProperty, UserName)); } catch (Exception info) { throw info; } finally { objDal = null; } }
/// <summary> /// This Method is used to Select data /// </summary> /// <param name="objCategory">Action</param> /// <returns>1 for success and -1 for fail</returns> public string GetSubCategories(PropSubcategory objProperty) { DllSubCategory objDal = new DllSubCategory(); try { return(objDal.SubCategories(objProperty)); } catch (Exception info) { throw info; } finally { objDal = null; } }
public string CategoryWiseSubCategoryofAssociate(PropSubcategory objProperty, string UserName) { DllSubCategory objDal = new DllSubCategory(); try { return(objDal.CategoryWiseSubCategoryofAssociate(objProperty, UserName)); } catch (Exception info) { throw info; } finally { objDal = null; } }
public string SubCategoryWisePrice(int id) { string str = string.Empty; if (Session["associate"].ToString() != "" || Session["associate"].ToString() != null) { PropSubcategory propSubCategory = new PropSubcategory(); propSubCategory.ID = id; propSubCategory.flag = 1; BllSubCategory objSubCategory = new BllSubCategory(); str = objSubCategory.SubCategoryWisePrice(propSubCategory, Session["associate"].ToString()); return(str); } else { return("Error in Authentication"); } }
public string SubCategories(PropSubcategory objsubCategory) { SqlCommand cmd = new SqlCommand("proc_subCategory", objCon.Con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Action", "HomePageSubCat"); cmd.Parameters.AddWithValue("@categoryId", objsubCategory.CategoryIDValue); SqlDataAdapter adpt = new SqlDataAdapter(); DataSet ds = new DataSet(); if (objCon.Con.State == ConnectionState.Open) { } else { objCon.Con.Open(); } cmd.Connection = objCon.Con; adpt.SelectCommand = cmd; adpt.Fill(ds, "subCategories"); objCon.Con.Close(); return(ds.GetXml()); }
/// <summary> /// This Method will be used to Post data into proc_subCategory table /// </summary> /// <param name="objsubCategory">Name</param> /// <returns>1 for success and -1 for fail</returns> public string InsertSubCategory(PropSubcategory objsubCategory, string userName) { if (userName != null && userName != "") { //proc_subCategory is the stored procedure name which will be used to Insert data into the table SqlCommand cmd = new SqlCommand("proc_subCategory", objCon.Con); cmd.CommandType = CommandType.StoredProcedure; if (objCon.Con.State == ConnectionState.Open) { } else { objCon.Con.Open(); } cmd.Parameters.AddWithValue("@SubCategory", objsubCategory.SubCategoryNameValue); cmd.Parameters.AddWithValue("@categoryId", objsubCategory.CategoryIDValue); cmd.Parameters.AddWithValue("@Action", "Add"); return(cmd.ExecuteNonQuery().ToString()); } else { return("Not Valid"); } }