Exemplo n.º 1
0
 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");
     }
 }
Exemplo n.º 2
0
        /// <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");
            }
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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");
            }
        }
Exemplo n.º 7
0
        /// <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;
            }
        }
Exemplo n.º 8
0
        /// <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;
            }
        }
Exemplo n.º 9
0
        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;
            }
        }
Exemplo n.º 10
0
        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");
            }
        }
Exemplo n.º 11
0
        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());
        }
Exemplo n.º 12
0
 /// <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");
     }
 }