// PUT: api/PackageVip/5 public IHttpActionResult Put(int id, [FromBody] PackageVipDTO packageVip) { var res = new Repositories().UpdatePackageVip(packageVip); if (res) { return(Ok()); } return(NotFound()); }
// POST: api/PackageVip public IHttpActionResult Post([FromBody] PackageVipDTO packageVip) { var res = new Repositories().CreatePackageVip(packageVip); if (res) { return(Ok()); } return(InternalServerError()); }
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")); }
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); } }
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()); } }
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); } }
public bool UpdatePackageVip(PackageVipDTO packageVip) { return(new PackageVipBus().UpdatePackageVip(packageVip)); }
public bool CreatePackageVip(PackageVipDTO packageVip) { return(new PackageVipBus().CreatePackageVip(packageVip)); }