Exemplo n.º 1
0
        /*=================================================           Orders   ==========================================================================*/

        public string AddOrders(orders item)
        {
            CmdCAP = new SqlCommand();

            item.ord_date      = DateTime.Now.ToString();
            item.ord_status    = "Ordered Taken";
            item.expe_dvy_date = DateTime.Now.AddDays(7).ToString();
            item.actl_dvy      = DateTime.Now.AddDays(7).ToString();

            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@uid", SqlDbType.Int, 100, item.uid));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@itm_id", SqlDbType.VarChar, 150, item.itm_id));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@aid", SqlDbType.Int, 50, item.aid));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@phone", SqlDbType.VarChar, 100, item.phone));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@amount", SqlDbType.Int, 100, item.amount));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@shippingchrgs", SqlDbType.Int, 100, item.shipping_charges));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@totalamount", SqlDbType.Int, 50, item.Total_amount));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@paymentmode", SqlDbType.VarChar, 100, item.payment_mode));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@cardno", SqlDbType.VarChar, 100, item.cardno));

            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@cardname", SqlDbType.VarChar, 100, item.cardname));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@expmonth", SqlDbType.Int, 100, item.expmonth));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@expyear", SqlDbType.Int, 100, item.expyear));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@cvv", SqlDbType.Int, 50, item.cvv));

            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@ord_date", SqlDbType.VarChar, 100, item.ord_date));

            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@ord_status", SqlDbType.VarChar, 100, item.ord_status));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@expe_dvy_date", SqlDbType.VarChar, 100, item.expe_dvy_date));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@actl_dvy", SqlDbType.VarChar, 100, item.actl_dvy));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@bagstaus", SqlDbType.VarChar, 100, "ORD"));
            ErrorMessage = CommonDbFunctions.SqlCommandExecution(CommandType.StoredProcedure, "AddOrders", CmdCAP);
            return(ErrorMessage);
        }
Exemplo n.º 2
0
 public string taskloginstring(string strEmail, string strPassword)
 {
     CmdCAP = new SqlCommand();
     AddParameter("@Email", SqlDbType.VarChar, 100, string.IsNullOrEmpty(strEmail)? SqlString.Null : strEmail);
     AddParameter("@Password", SqlDbType.VarChar, 100, string.IsNullOrEmpty(strPassword)? SqlString.Null : strPassword);
     ErrorMessage = CommonDbFunctions.SqlCommandExecution(CommandType.StoredProcedure, "spCheckUserLoginDetails", CmdCAP);
     return(ErrorMessage);
 }
Exemplo n.º 3
0
        public string DleteAddressById(int uid, int aid)
        {
            CmdCAP = new SqlCommand();

            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@AID", SqlDbType.Int, 100, string.IsNullOrEmpty(aid.ToString()) ? SqlInt32.Null : Convert.ToInt32(aid)));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@UID", SqlDbType.Int, 100, string.IsNullOrEmpty(uid.ToString()) ? SqlInt32.Null : Convert.ToInt32(uid)));

            ErrorMessage = CommonDbFunctions.SqlCommandExecution(CommandType.StoredProcedure, "DeleteAddress", CmdCAP);
            return(ErrorMessage);
        }
Exemplo n.º 4
0
        public string RemoveItemFromWhishList(Item item)
        {
            CmdCAP = new SqlCommand();


            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@wh_id", SqlDbType.Int, 100, item.bag_id));

            ErrorMessage = CommonDbFunctions.SqlCommandExecution(CommandType.StoredProcedure, "RemoveItemfromWhishList", CmdCAP);
            return(ErrorMessage);
        }
Exemplo n.º 5
0
        public string UpdateProfilePic(int id, string imagepath)
        {
            CmdCAP = new SqlCommand();

            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@UID", SqlDbType.Int, 100, id));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@Image", SqlDbType.VarChar, 200, string.IsNullOrEmpty(imagepath) ? SqlString.Null : imagepath));


            ErrorMessage = CommonDbFunctions.SqlCommandExecution(CommandType.StoredProcedure, "updateprofilephoto", CmdCAP);
            return(ErrorMessage);
        }
Exemplo n.º 6
0
        public string UpdatePassword(int id, string password)
        {
            CmdCAP = new SqlCommand();

            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@UID", SqlDbType.Int, 100, id));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@Password", SqlDbType.VarChar, 100, string.IsNullOrEmpty(password) ? SqlString.Null : password));


            ErrorMessage = CommonDbFunctions.SqlCommandExecution(CommandType.StoredProcedure, "UpdatePassword", CmdCAP);
            return(ErrorMessage);
        }
Exemplo n.º 7
0
        public string CommonForMovetowhislist_RemovefromBag(Item item)
        {
            CmdCAP = new SqlCommand();

            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@uid", SqlDbType.Int, 100, item.uid));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@itm_id", SqlDbType.Int, 100, item.itm_id));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@type", SqlDbType.Int, 100, item.type));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@bag_id", SqlDbType.Int, 100, item.bag_id));

            ErrorMessage = CommonDbFunctions.SqlCommandExecution(CommandType.StoredProcedure, "MoveToWishLost_AND_RemovefromBag", CmdCAP);
            return(ErrorMessage);
        }
Exemplo n.º 8
0
        public string AddorEditProductByAdmin(Products_Types product)
        {
            CmdCAP = new SqlCommand();


            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@PID", SqlDbType.Int, 0, product.PID));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@pName", SqlDbType.VarChar, 100, string.IsNullOrEmpty(product.pName) ? SqlString.Null : product.pName));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@IsActive", SqlDbType.Bit, 0, product.IsActive));


            ErrorMessage = CommonDbFunctions.SqlCommandExecution(CommandType.StoredProcedure, "spAddorEditProductByAdmin", CmdCAP);
            return(ErrorMessage);
        }
Exemplo n.º 9
0
        public string AddorEditSubCategoryByAdmin(Products_SubCategory product_subcategory)
        {
            CmdCAP = new SqlCommand();


            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@prod_subcat_id", SqlDbType.Int, 0, product_subcategory.prod_subcat_id));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@pscName", SqlDbType.VarChar, 100, string.IsNullOrEmpty(product_subcategory.pscName) ? SqlString.Null : product_subcategory.pscName));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@prod_cat_id", SqlDbType.Int, 0, product_subcategory.prod_cat_id));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@IsActive", SqlDbType.Bit, 0, product_subcategory.IsActive));


            ErrorMessage = CommonDbFunctions.SqlCommandExecution(CommandType.StoredProcedure, "spAddorEditSubCategoryByAdmin", CmdCAP);
            return(ErrorMessage);
        }
Exemplo n.º 10
0
        public string AddItemsToBag(Item item)
        {
            CmdCAP = new SqlCommand();

            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@uid", SqlDbType.Int, 100, item.uid));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@itm_id", SqlDbType.Int, 100, item.itm_id));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@size", SqlDbType.VarChar, 50, string.IsNullOrEmpty(item.size) ? SqlString.Null : item.size));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@price", SqlDbType.Int, 100, item.price));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@qunty", SqlDbType.Int, 100, item.qunty));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@status", SqlDbType.VarChar, 100, "INB"));

            ErrorMessage = CommonDbFunctions.SqlCommandExecution(CommandType.StoredProcedure, "AdditemsToBag", CmdCAP);
            return(ErrorMessage);
        }
Exemplo n.º 11
0
        public string UpdateBagDetails(Item item)
        {
            CmdCAP = new SqlCommand();


            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@bag_id", SqlDbType.Int, 100, item.bag_id));

            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@qunty", SqlDbType.Int, 100, item.qunty));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@size", SqlDbType.VarChar, 100, item.size));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@type", SqlDbType.Int, 100, item.type));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@price", SqlDbType.Int, 100, item.price));
            ErrorMessage = CommonDbFunctions.SqlCommandExecution(CommandType.StoredProcedure, "UpdateBagDetails", CmdCAP);
            return(ErrorMessage);
        }
Exemplo n.º 12
0
        public string UpdateUserPersonalData(User user)
        {
            CmdCAP = new SqlCommand();

            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@UID", SqlDbType.Int, 100, user.UID));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@Firstname", SqlDbType.VarChar, 100, string.IsNullOrEmpty(user.FirstName) ? SqlString.Null : user.FirstName));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@LastName", SqlDbType.VarChar, 100, string.IsNullOrEmpty(user.LastName) ? SqlString.Null : user.LastName));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@Email", SqlDbType.VarChar, 100, string.IsNullOrEmpty(user.Email) ? SqlString.Null : user.Email));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@PhoneNo", SqlDbType.VarChar, 100, string.IsNullOrEmpty(user.PhoneNo) ? SqlString.Null : user.PhoneNo));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@Gender", SqlDbType.VarChar, 10, string.IsNullOrEmpty(user.Gender) ? SqlString.Null : user.Gender));


            ErrorMessage = CommonDbFunctions.SqlCommandExecution(CommandType.StoredProcedure, "UpdateUserDataById", CmdCAP);
            return(ErrorMessage);
        }
Exemplo n.º 13
0
        public string vendoritemadding(int vid, string items)
        {
            CmdCAP = new SqlCommand();

            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@vid", SqlDbType.Int, 0, vid));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@prod_subcat_id", SqlDbType.VarChar, 1000, string.IsNullOrEmpty(items) ? SqlString.Null : items));
            using (ConCAP = new SqlConnection())
            {
                try
                {
                    ErrorMessage = CommonDbFunctions.SqlCommandExecution(CommandType.StoredProcedure, "sp_vendoritems", CmdCAP);
                }
                catch (SqlException ex)
                {
                    ErrorMessage = ex.Message;
                }
            }

            //DataTable dt = new DataTable();
            //dt.Columns.Add(new DataColumn("vid", typeof(Int32)));
            //dt.Columns.Add(new DataColumn("prod_subcat_id", typeof(Int32)));


            //foreach (product model in list)
            //{


            //    dt.Rows.Add(model.vid,model.prod_subcat_id);


            //}


            //using (SqlConnection con = new SqlConnection(str))
            //{

            //    SqlCommand sqlcom = new SqlCommand("sp_vendoritemlist", con);
            //    sqlcom.CommandType = CommandType.StoredProcedure;
            //    sqlcom.Parameters.AddWithValue("@List", dt);
            //    // sqlcom.Parameters.Add(prmReturn);
            //    con.Open();
            //    sqlcom.ExecuteNonQuery();
            //}


            return(ErrorMessage);
        }
Exemplo n.º 14
0
        public string AddingAddressDetails(AddressModel model)
        {
            CmdCAP = new SqlCommand();

            //CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@AID", SqlDbType.Int, 100, string.IsNullOrEmpty(model.AID.ToString()) ? SqlInt32.Null : Convert.ToInt32(model.AID)));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@UID", SqlDbType.Int, 100, string.IsNullOrEmpty(model.UID.ToString()) ? SqlInt32.Null : Convert.ToInt32(model.UID)));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@Address", SqlDbType.VarChar, 100, string.IsNullOrEmpty(model.Address) ? SqlString.Null : model.Address));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@Town", SqlDbType.VarChar, 100, string.IsNullOrEmpty(model.Town) ? SqlString.Null : model.Town));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@City", SqlDbType.VarChar, 100, string.IsNullOrEmpty(model.City) ? SqlString.Null : model.City));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@Pincode", SqlDbType.Int, 100, string.IsNullOrEmpty(model.Pincode.ToString()) ? SqlInt32.Null : Convert.ToInt32(model.Pincode)));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@State", SqlDbType.VarChar, 100, string.IsNullOrEmpty(model.State) ? SqlString.Null : model.State));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@Type", SqlDbType.VarChar, 50, string.IsNullOrEmpty(model.Type) ? SqlString.Null : model.Type));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@avaldays", SqlDbType.VarChar, 100, string.IsNullOrEmpty(model.avaldays) ? SqlString.Null : model.avaldays));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@Time", SqlDbType.VarChar, 50, model.Time));

            ErrorMessage = CommonDbFunctions.SqlCommandExecution(CommandType.StoredProcedure, "Addaddress", CmdCAP);
            return(ErrorMessage);
        }
Exemplo n.º 15
0
 public string delvitem(int vpid)
 {
     CmdCAP = new SqlCommand();
     CmdCAP.Parameters.Clear();
     CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@Vpid", SqlDbType.Int, 0, vpid));
     using (ConCAP = new SqlConnection())
     {
         try
         {
             ErrorMessage = CommonDbFunctions.SqlCommandExecution(CommandType.StoredProcedure, "sp_vitemdel", CmdCAP);
         }
         catch (SqlException ex)
         {
             ErrorMessage = ex.Message;
         }
     }
     return(ErrorMessage);
 }
Exemplo n.º 16
0
        //public int Register(User user)
        //    {
        //        SqlCommand sqlcommand = new SqlCommand();

        //        SqlParameter[] param = new SqlParameter[10];
        //        param[0] = new SqlParameter("@Firstname", user.FirstName);
        //        param[1] = new SqlParameter("@LastName", user.LastName);
        //        param[2] = new SqlParameter("@Email", user.Email);
        //        param[3] = new SqlParameter("@PhoneNo", user.PhoneNo);
        //        param[4] = new SqlParameter("@Gender", user.Gender);
        //        param[5] = new SqlParameter("@Address", user.Address);
        //        param[6] = new SqlParameter("@Password", user.Password);
        //        param[7] = new SqlParameter("@OTP", user.OTP);
        //        param[8] = new SqlParameter("@Image", user.Image);
        //        param[9] = new SqlParameter("@RoleID", user.RoleID);


        //        sqlcommand = new SqlCommand("spRegistration", OpenConnection())
        //        {
        //            CommandType = CommandType.StoredProcedure
        //        };
        //        sqlcommand.Parameters.AddRange(param);


        //        try
        //        {
        //            int irowsAffected = sqlcommand.ExecuteNonQuery();
        //            return irowsAffected;

        //        }
        //        catch (SqlException ex)
        //        {
        //            //handel sql excepetions
        //            Console.WriteLine(ex.Message + "  in UserDb StoreUser()");
        //            return 0;
        //        }
        //        catch (Exception ex)
        //        {
        //            //handel exceptions
        //            Console.WriteLine(ex.Message + "  in UserDb StoreUser()");
        //            return 0;
        //        }
        //        finally
        //        {
        //            CloseConnection();
        //        }
        //    }

        public string Register(User user)
        {
            CmdCAP = new SqlCommand();


            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@Firstname", SqlDbType.VarChar, 100, string.IsNullOrEmpty(user.FirstName) ? SqlString.Null : user.FirstName));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@LastName", SqlDbType.VarChar, 100, string.IsNullOrEmpty(user.LastName) ? SqlString.Null : user.LastName));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@Email", SqlDbType.VarChar, 100, string.IsNullOrEmpty(user.Email) ? SqlString.Null : user.Email));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@PhoneNo", SqlDbType.VarChar, 100, string.IsNullOrEmpty(user.PhoneNo) ? SqlString.Null : user.PhoneNo));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@Gender", SqlDbType.VarChar, 10, string.IsNullOrEmpty(user.Gender) ? SqlString.Null : user.Gender));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@Password", SqlDbType.VarChar, 100, string.IsNullOrEmpty(user.Password) ? SqlString.Null : user.Password));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@OTP", SqlDbType.Int, 0, string.IsNullOrEmpty(user.OTP.ToString()) ? SqlInt32.Null : Convert.ToInt32(user.OTP)));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@Image", SqlDbType.VarChar, 100, user.Image));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@RoleID", SqlDbType.Int, 0, user.RoleID));

            ErrorMessage = CommonDbFunctions.SqlCommandExecution(CommandType.StoredProcedure, "spRegistration", CmdCAP);
            return(ErrorMessage);
        }
Exemplo n.º 17
0
        public string inspname(string pname)
        {
            CmdCAP = new SqlCommand();

            //CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@Imode", SqlDbType.VarChar, 50, "Insproud"));
            CmdCAP.Parameters.Add(CommonDbFunctions.AddParameter("@pname", SqlDbType.VarChar, 50, string.IsNullOrEmpty(pname) ? SqlString.Null : pname));
            CmdCAP.CommandText = "Sp_vendor";
            CmdCAP.CommandType = CommandType.StoredProcedure;

            using (ConCAP = new SqlConnection())
            {
                try
                {
                    ErrorMessage = CommonDbFunctions.SqlCommandExecution(CommandType.StoredProcedure, "Sp_vendor", CmdCAP);
                }
                catch (SqlException ex)
                {
                    ErrorMessage = ex.Message;
                }
            }
            return(ErrorMessage);
        }