示例#1
0
        // PUT: api/PackageVip/5
        public IHttpActionResult Put(int id, [FromBody] PackageVipDTO packageVip)
        {
            var res = new Repositories().UpdatePackageVip(packageVip);

            if (res)
            {
                return(Ok());
            }

            return(NotFound());
        }
示例#2
0
        // POST: api/PackageVip
        public IHttpActionResult Post([FromBody] PackageVipDTO packageVip)
        {
            var res = new Repositories().CreatePackageVip(packageVip);

            if (res)
            {
                return(Ok());
            }

            return(InternalServerError());
        }
示例#3
0
        public ActionResult CreatePackageVip(PackageVipDTO packageVip)
        {
            var res = ApiService.CreatePackageVip(packageVip);

            if (!res)
            {
                return(RedirectToAction("CreatePackageVip"));
            }
            ViewBag.Payment    = ApiService.GetAllPayment();
            ViewBag.PackageVip = ApiService.GetAllPackageVip();
            return(RedirectToAction("Index"));
        }
示例#4
0
        public bool CreatePackageVip(PackageVipDTO packageVip)
        {
            try
            {
                var data = new PackageVipDao().CreatePackageVip(new PackageVip()
                {
                    PVipMonths = packageVip.PVipMonths,
                    PVipName   = packageVip.PVipName,
                    PVipPrice  = packageVip.PVipPrice,
                });

                return(true);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return(false);
            }
        }
示例#5
0
 public ActionResult EditPackageVip(PackageVipDTO packageVipDto)
 {
     try
     {
         // TODO: Add update logic here
         var res = ApiService.UpdatePackageVip(packageVipDto);
         if (!res)
         {
             return(RedirectToAction("EditPackageVip"));
         }
         ViewBag.Payment    = ApiService.GetAllPayment();
         ViewBag.PackageVip = ApiService.GetAllPackageVip();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
示例#6
0
        public bool UpdatePackageVip(PackageVipDTO packageVip)
        {
            try
            {
                new PackageVipDao().Update(new PackageVip()
                {
                    ID         = packageVip.ID,
                    PVipMonths = packageVip.PVipMonths,
                    PVipName   = packageVip.PVipName,
                    PVipPrice  = packageVip.PVipPrice,
                });

                return(true);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return(false);
            }
        }
示例#7
0
 public bool UpdatePackageVip(PackageVipDTO packageVip)
 {
     return(new PackageVipBus().UpdatePackageVip(packageVip));
 }
示例#8
0
 public bool CreatePackageVip(PackageVipDTO packageVip)
 {
     return(new PackageVipBus().CreatePackageVip(packageVip));
 }