Exemplo n.º 1
0
        public string InsertPromoCode(PropPromoCode objPromocode)
        {
            SqlCommand cmd = new SqlCommand("proc_PromoCode", objCon.Con);

            cmd.CommandType = CommandType.StoredProcedure;
            objCon.Con.Open();
            try
            {
                cmd.Parameters.AddWithValue("@categoryID", objPromocode.CategoryID);
                cmd.Parameters.AddWithValue("@SubCategoryID", objPromocode.SubCategoryID);
                cmd.Parameters.AddWithValue("@fromDate", objPromocode.FromDate);
                cmd.Parameters.AddWithValue("@toDate", objPromocode.ToDate);
                cmd.Parameters.AddWithValue("@discount", objPromocode.Discount);
                cmd.Parameters.AddWithValue("@promoCode", objPromocode.PromoCode);
                cmd.Parameters.AddWithValue("@associateID", objPromocode.AssociateID);
                cmd.Parameters.AddWithValue("@action", "Add");
                return(cmd.ExecuteNonQuery().ToString());
            }
            catch (Exception showError)
            {
                throw showError;
            }
            finally
            {
                cmd.Dispose();
                objCon.Con.Close();
                objCon.Con.Dispose();
            }
        }
Exemplo n.º 2
0
        public int RecordUpdate(PropPromoCode objProperty)
        {
            DllPromoCode objDal = new DllPromoCode();

            try
            {
                return(objDal.UpdatePromoCode(objProperty));
            }
            catch (Exception info)
            {
                throw info;
            }
            finally
            {
                objDal = null;
            }
        }
Exemplo n.º 3
0
        public string RecordInsert(PropPromoCode objProperty)
        {
            DllPromoCode objDal = new DllPromoCode();

            try
            {
                return(objDal.InsertPromoCode(objProperty));
            }
            catch (Exception info)
            {
                throw info;
            }
            finally
            {
                objDal = null;
            }
        }
        public string InsertPromo(int categoryID, int SubcategoryID, DateTime _fromDate, DateTime _toDate, float Discount, string PromoCode)
        {
            string str = string.Empty;

            if (Session["associate"].ToString() != "" || Session["associate"].ToString() != null)
            {
                PropPromoCode propPromo = new PropPromoCode();
                propPromo.CategoryID    = categoryID;
                propPromo.SubCategoryID = SubcategoryID;
                propPromo.FromDate      = _fromDate;
                propPromo.ToDate        = _toDate;
                propPromo.Discount      = Discount;
                propPromo.PromoCode     = PromoCode;
                propPromo.AssociateID   = Convert.ToInt16(Session["associate"]);
                BllPromoCode objPromoCode = new BllPromoCode();
                str = objPromoCode.RecordInsert(propPromo);
                return(str);
            }
            else
            {
                return("Error in Authentication");
            }
        }
Exemplo n.º 5
0
        public int DeletePromoCode(PropPromoCode objPromocode)
        {
            SqlCommand cmd = new SqlCommand("proc_UDS_PromoCodeRegistration", objCon.Con);

            return(cmd.ExecuteNonQuery());
        }