예제 #1
0
        public ActionResult EditCoupons(string Id)
        {
            if (Session["User"] != null)
            {
                Domain.Socioboard.Domain.User _User = (Domain.Socioboard.Domain.User)Session["User"];
                if (_User.UserType != "SuperAdmin")
                {
                    return(RedirectToAction("Index", "Index"));
                }
            }
            else
            {
                return(RedirectToAction("Index", "Index"));
            }

            Domain.Socioboard.Domain.Coupon objCoupon = new Domain.Socioboard.Domain.Coupon();
            objCoupon.Id = Guid.Parse(Id);
            string Objcoupon = (new JavaScriptSerializer().Serialize(objCoupon));

            Api.Coupon.Coupon apiobjCoupons = new Api.Coupon.Coupon();
            List <Domain.Socioboard.Domain.Coupon> lstCoupons = (List <Domain.Socioboard.Domain.Coupon>)(new JavaScriptSerializer().Deserialize(apiobjCoupons.GetCouponsById(Objcoupon), typeof(List <Domain.Socioboard.Domain.Coupon>)));

            Domain.Socioboard.Domain.Coupon objCoupons = lstCoupons[0];
            Session["CouponsToUpdate"] = objCoupons;
            return(View(objCoupons));
        }
예제 #2
0
        public ActionResult UpdateCoupons(string couponcode, string EntryDate, string ExpiryDate, string Status)
        {
            if (Session["User"] != null)
            {
                Domain.Socioboard.Domain.User _User = (Domain.Socioboard.Domain.User)Session["User"];
                if (_User.UserType != "SuperAdmin")
                {
                    return(RedirectToAction("Index", "Index"));
                }
            }
            else
            {
                return(RedirectToAction("Index", "Index"));
            }

            Domain.Socioboard.Domain.Coupon objCoupons = (Domain.Socioboard.Domain.Coupon)Session["CouponsToUpdate"];
            objCoupons.CouponCode      = couponcode;
            objCoupons.EntryCouponDate = Convert.ToDateTime(EntryDate);
            objCoupons.ExpCouponDate   = Convert.ToDateTime(ExpiryDate);
            objCoupons.Status          = Status;
            string ObjCoupn = (new JavaScriptSerializer().Serialize(objCoupons));

            Api.Coupon.Coupon apiobjNews          = new Api.Coupon.Coupon();
            string            CouponUpdateMessage = (string)(new JavaScriptSerializer().Deserialize(apiobjNews.UpdateCoupons(ObjCoupn), typeof(string)));

            return(Content(CouponUpdateMessage));
        }
예제 #3
0
 public ActionResult EditCoupons(string Id)
 {
     Domain.Socioboard.Domain.Coupon objCoupon = new Domain.Socioboard.Domain.Coupon();
     objCoupon.Id = Guid.Parse(Id);
     string Objcoupon = (new JavaScriptSerializer().Serialize(objCoupon));
     Api.Coupon.Coupon apiobjCoupons = new Api.Coupon.Coupon();
     List<Domain.Socioboard.Domain.Coupon> lstCoupons = (List<Domain.Socioboard.Domain.Coupon>)(new JavaScriptSerializer().Deserialize(apiobjCoupons.GetCouponsById(Objcoupon), typeof(List<Domain.Socioboard.Domain.Coupon>)));
     Domain.Socioboard.Domain.Coupon objCoupons = lstCoupons[0];
     Session["CouponsToUpdate"] = objCoupons;
     return View(objCoupons);
 }
예제 #4
0
        public ActionResult EditCoupons(string Id)
        {
            Domain.Socioboard.Domain.Coupon objCoupon = new Domain.Socioboard.Domain.Coupon();
            objCoupon.Id = Guid.Parse(Id);
            string Objcoupon = (new JavaScriptSerializer().Serialize(objCoupon));

            Api.Coupon.Coupon apiobjCoupons = new Api.Coupon.Coupon();
            List <Domain.Socioboard.Domain.Coupon> lstCoupons = (List <Domain.Socioboard.Domain.Coupon>)(new JavaScriptSerializer().Deserialize(apiobjCoupons.GetCouponsById(Objcoupon), typeof(List <Domain.Socioboard.Domain.Coupon>)));

            Domain.Socioboard.Domain.Coupon objCoupons = lstCoupons[0];
            Session["CouponsToUpdate"] = objCoupons;
            return(View(objCoupons));
        }
예제 #5
0
        public ActionResult UpdateCoupons(string couponcode, string EntryDate, string ExpiryDate, string Status)
        {
            Domain.Socioboard.Domain.Coupon objCoupons = (Domain.Socioboard.Domain.Coupon)Session["CouponsToUpdate"];
            objCoupons.CouponCode      = couponcode;
            objCoupons.EntryCouponDate = Convert.ToDateTime(EntryDate);
            objCoupons.ExpCouponDate   = Convert.ToDateTime(ExpiryDate);
            objCoupons.Status          = Status;
            string ObjCoupn = (new JavaScriptSerializer().Serialize(objCoupons));

            Api.Coupon.Coupon apiobjNews          = new Api.Coupon.Coupon();
            string            CouponUpdateMessage = (string)(new JavaScriptSerializer().Deserialize(apiobjNews.UpdateCoupons(ObjCoupn), typeof(string)));

            return(Content(CouponUpdateMessage));
        }
예제 #6
0
 public string GetCouponsById(string ObjCoupons)
 {
     try
     {
         Domain.Socioboard.Domain.Coupon        Coupon  = (Domain.Socioboard.Domain.Coupon)(new JavaScriptSerializer().Deserialize(ObjCoupons, typeof(Domain.Socioboard.Domain.Coupon)));
         List <Domain.Socioboard.Domain.Coupon> objNews = ObjCouponRepo.GetCouponByCouponId(Coupon);
         return(new JavaScriptSerializer().Serialize(objNews));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
         return(null);
     }
 }
예제 #7
0
 public ActionResult AddCoupons(string Couponcode, string EntryDate, string ExpiryDate, string Status, string Percentage)
 {
     Domain.Socioboard.Domain.Coupon objCoupons = new  Domain.Socioboard.Domain.Coupon();
     objCoupons.Id = Guid.NewGuid();
     objCoupons.CouponCode = Couponcode;
     objCoupons.EntryCouponDate = Convert.ToDateTime(EntryDate);
     objCoupons.ExpCouponDate = Convert.ToDateTime(ExpiryDate);
     objCoupons.Status = Status;
     objCoupons.Discount = Convert.ToInt16(Percentage);
     string ObjCoupn = (new JavaScriptSerializer().Serialize(objCoupons));
     Api.Coupon.Coupon apiobjCoupon = new Api.Coupon.Coupon();
     string CouponUpdateMessage = (string)(new JavaScriptSerializer().Deserialize(apiobjCoupon.AddCoupons(ObjCoupn), typeof(string)));
     return Content(CouponUpdateMessage);
 }
예제 #8
0
        public ActionResult AddCoupons(string Couponcode, string EntryDate, string ExpiryDate, string Status, string Percentage)
        {
            Domain.Socioboard.Domain.Coupon objCoupons = new  Domain.Socioboard.Domain.Coupon();
            objCoupons.Id              = Guid.NewGuid();
            objCoupons.CouponCode      = Couponcode;
            objCoupons.EntryCouponDate = Convert.ToDateTime(EntryDate);
            objCoupons.ExpCouponDate   = Convert.ToDateTime(ExpiryDate);
            objCoupons.Status          = Status;
            objCoupons.Discount        = Convert.ToInt16(Percentage);
            string ObjCoupn = (new JavaScriptSerializer().Serialize(objCoupons));

            Api.Coupon.Coupon apiobjCoupon        = new Api.Coupon.Coupon();
            string            CouponUpdateMessage = (string)(new JavaScriptSerializer().Deserialize(apiobjCoupon.AddCoupons(ObjCoupn), typeof(string)));

            return(Content(CouponUpdateMessage));
        }
예제 #9
0
 public string AddCoupons(string ObjCoupons)
 {
     try
     {
         Domain.Socioboard.Domain.Coupon objcoupon = (Domain.Socioboard.Domain.Coupon)(new JavaScriptSerializer().Deserialize(ObjCoupons, typeof(Domain.Socioboard.Domain.Coupon)));
         if (ObjCouponRepo.GetCouponByCouponCode(objcoupon).Count < 1 || ObjCouponRepo.GetCouponByCouponCode(objcoupon).Count == 0)
         {
             ObjCouponRepo.Add(objcoupon);
             return(new JavaScriptSerializer().Serialize("Added Successfully"));
         }
         else
         {
             return(new JavaScriptSerializer().Serialize("Coupon Already Exist"));
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
         return(null);
     }
 }
예제 #10
0
 public string UpdateCoupons(string ObjCoupons)
 {
     try
     {
         Domain.Socioboard.Domain.Coupon objcoupon = (Domain.Socioboard.Domain.Coupon)(new JavaScriptSerializer().Deserialize(ObjCoupons, typeof(Domain.Socioboard.Domain.Coupon)));
         int res = ObjCouponRepo.SetCouponById(objcoupon);
         if (res == 1)
         {
             return(new JavaScriptSerializer().Serialize("Updated Successfully"));
         }
         else
         {
             return(new JavaScriptSerializer().Serialize("Coupon Already Exist"));
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
         return(null);
     }
 }
        public ActionResult EditCoupons(string Id)
        {
            if (Session["User"] != null)
            {
                Domain.Socioboard.Domain.User _User = (Domain.Socioboard.Domain.User)Session["User"];
                if (_User.UserType != "SuperAdmin")
                {
                    return RedirectToAction("Index", "Index");
                }
            }
            else
            {
                return RedirectToAction("Index", "Index");
            }

            Domain.Socioboard.Domain.Coupon objCoupon = new Domain.Socioboard.Domain.Coupon();
            objCoupon.Id = Guid.Parse(Id);
            string Objcoupon = (new JavaScriptSerializer().Serialize(objCoupon));
            Api.Coupon.Coupon apiobjCoupons = new Api.Coupon.Coupon();
            List<Domain.Socioboard.Domain.Coupon> lstCoupons = (List<Domain.Socioboard.Domain.Coupon>)(new JavaScriptSerializer().Deserialize(apiobjCoupons.GetCouponsById(Objcoupon), typeof(List<Domain.Socioboard.Domain.Coupon>)));
            Domain.Socioboard.Domain.Coupon objCoupons = lstCoupons[0];
            Session["CouponsToUpdate"] = objCoupons;
            return View(objCoupons);
        }
        public ActionResult AddCoupons(string Couponcode, string EntryDate, string ExpiryDate, string Status, string Percentage)
        {
            if (Session["User"] != null)
            {
                Domain.Socioboard.Domain.User _User = (Domain.Socioboard.Domain.User)Session["User"];
                if (_User.UserType != "SuperAdmin")
                {
                    return RedirectToAction("Index", "Index");
                }
            }
            else
            {
                return RedirectToAction("Index", "Index");
            }

            Domain.Socioboard.Domain.Coupon objCoupons = new  Domain.Socioboard.Domain.Coupon();
            objCoupons.Id = Guid.NewGuid();
            objCoupons.CouponCode = Couponcode;
            objCoupons.EntryCouponDate = Convert.ToDateTime(EntryDate);
            objCoupons.ExpCouponDate = Convert.ToDateTime(ExpiryDate);
            objCoupons.Status = Status;
            objCoupons.Discount = Convert.ToInt16(Percentage);
            string ObjCoupn = (new JavaScriptSerializer().Serialize(objCoupons));
            Api.Coupon.Coupon apiobjCoupon = new Api.Coupon.Coupon();
            string CouponUpdateMessage = (string)(new JavaScriptSerializer().Deserialize(apiobjCoupon.AddCoupons(ObjCoupn), typeof(string)));
            return Content(CouponUpdateMessage);
        }