Beispiel #1
0
 public bool Test()
 {
     SqlParameter[] param = new SqlParameter[1];
     DBHelper helper = new DBHelper();
     param[0] = new SqlParameter(CONSTANT.CAT_ID, "ZCVV");
     bool ds = helper.InsertQuery(PROCEDURES.CAT_INSERT, param);
     return ds;
 }
Beispiel #2
0
       public int deleteProduct(string product_id)
       {
           DBHelper helper = new DBHelper();

           SqlParameter[] param = new SqlParameter[1];
           param[0] = new SqlParameter(CONSTANT.PRODUCT_ID, product_id);
           int res = helper.InsertQuery(PROCEDURES.DELETE_PRODUCT, param);
           return res;
       }
Beispiel #3
0
       public int deleteSubCategory(int id)
       {
           DBHelper helper = new DBHelper();

           SqlParameter[] param = new SqlParameter[1];
           param[0] = new SqlParameter(CONSTANT.SUB_CATEGORY_ID, id);
           int res = helper.InsertQuery(PROCEDURES.DELETE_SUB_CATEGORY, param);

           return res;
        
       }
Beispiel #4
0
        public int createNewUser(User_Details _user, string type)
        {
            DBHelper helper = new DBHelper();
            SqlParameter[] param = new SqlParameter[6];
            param[0] = new SqlParameter(CONSTANT.UID, _user.User_ID);
            param[1] = new SqlParameter(CONSTANT.USER_NAME, _user.User_Name);
            param[2] = new SqlParameter(CONSTANT.PASSWORD, _user.User_Password);
            param[3] = new SqlParameter(CONSTANT.DESIGNATION, _user.User_Designation);
            param[4] = new SqlParameter(CONSTANT.USER_EMAIL, _user.User_Email);
            param[5] = new SqlParameter(CONSTANT.TYPE, type);


            int res = helper.InsertQuery(PROCEDURES.ADD_NEW_USER, param);

            return res;



        }
Beispiel #5
0
       public int updateProduct(ProductDetails product)
       {
           DBHelper helper = new DBHelper();
           SqlParameter[] param = new SqlParameter[11];
           param[0] = new SqlParameter(CONSTANT.SUB_CATEGORY_ID, product.SubCategory);
           param[1] = new SqlParameter(CONSTANT.BRAND_ID, product.Brand_Name);
           param[2] = new SqlParameter(CONSTANT.PRODUCT_ID, product.Prod_Id);
           param[3] = new SqlParameter(CONSTANT.PRODUCT_NAME, product.Prod_Name);
           param[4] = new SqlParameter(CONSTANT.PRODUCT_IMAGE, product.Prod_Img);
           param[5] = new SqlParameter(CONSTANT.PRICE, product.Price);
           param[6] = new SqlParameter(CONSTANT.OFFER_PRICE, product.Offer_Price);
           param[7] = new SqlParameter(CONSTANT.PURCHASE_PRICE, product.Purchase_Price);
           param[8] = new SqlParameter(CONSTANT.PACKING_QUANITY, product.Prod_Quantity);
           param[9] = new SqlParameter(CONSTANT.TotalQuantity, product.Total_Quantity);
           param[10] = new SqlParameter(CONSTANT.SUB_CLASSFICATION_NAME, product.SubClassification);

           int res = helper.InsertQuery(PROCEDURES.UPDATE_PRODUCTS, param);
           return res;

       }
Beispiel #6
0
       public int DeleteCategory(int cat_id)
       {
           DBHelper helper = new DBHelper();

           SqlParameter[] param = new SqlParameter[1];
           param[0] = new SqlParameter(CONSTANT.CAT_ID, cat_id);
           int res = helper.InsertQuery(PROCEDURES.DELETE_CATEGORY, param);

           return res;
       }
Beispiel #7
0
       public int InsertSubClassification(string sub_class,string Sub_Cat_Id)
       {
           int res = 0;
           DBHelper helper = new DBHelper();

           SqlParameter[] param = new SqlParameter[2];
           param[0] = new SqlParameter(CONSTANT.SUB_CATEGORY_ID, Sub_Cat_Id);
           param[1] = new SqlParameter(CONSTANT.SUB_CLASSFICATION_NAME, sub_class);
           res = helper.InsertQuery(PROCEDURES.INSERT_SUB_CLASSIFICATION, param);
           return res;
       }
Beispiel #8
0
       public int UpdateCategory(Category cat)
       {
           DBHelper helper = new DBHelper();

           SqlParameter[] param = new SqlParameter[2];
           param[0] = new SqlParameter(CONSTANT.CAT_ID, cat.Cat_Id);

           param[1] = new SqlParameter(CONSTANT.CATEGORY_NAME, cat.Cat_Name);
           int res = helper.InsertQuery(PROCEDURES.UPDATE_CATEGORY, param);
           return res;
       
       }
Beispiel #9
0
       public int InsertCategory(string categoryName)
       {
            DBHelper helper = new DBHelper();

           SqlParameter[] param = new SqlParameter[1];
           param[0] = new SqlParameter(CONSTANT.CATEGORY_NAME, categoryName);

           int res = helper.InsertQuery(PROCEDURES.INSERT_CATEGORY, param);
           return res;
       }
Beispiel #10
0
       public int EnterSubCat(int catID, string subCategoryName)
       {
           DBHelper helper = new DBHelper();

           SqlParameter[] param = new SqlParameter[2];
           param[0] = new SqlParameter(CONSTANT.CAT_ID , catID );
           param[1] = new SqlParameter(CONSTANT.SUB_CAT_NAME, subCategoryName);
           int res = helper.InsertQuery(PROCEDURES.INSERT_SUB_CATEGORY, param);
           return res;


       }
Beispiel #11
0
       public int DeleteBrand(int Brand_Id)
       {

           DBHelper helper = new DBHelper();

           SqlParameter[] param = new SqlParameter[1];
           param[0] = new SqlParameter(CONSTANT.BRAND_ID, Brand_Id);
           int res = helper.InsertQuery(PROCEDURES.DELETE_BRAND, param);
           return res;
       
       }
Beispiel #12
0
       public int InsertBrand(Brand brand)
       {

           DBHelper helper = new DBHelper();
           SqlParameter []parm=new SqlParameter[1];
           parm[0]=new SqlParameter(CONSTANT.BRAND_NAME,brand.Brand_Name);
           int res = helper.InsertQuery(PROCEDURES.INSERT_BRAND, parm);
           return res;

       }