public ActionResult Create(InfoPartyAViewModel model) { if (ModelState.IsValid) { var InfoPartyA = new InfoPartyA(); AutoMapper.Mapper.Map(model, InfoPartyA); InfoPartyA.IsDeleted = false; InfoPartyA.CreatedUserId = WebSecurity.CurrentUserId; InfoPartyA.ModifiedUserId = WebSecurity.CurrentUserId; InfoPartyA.AssignedUserId = WebSecurity.CurrentUserId; InfoPartyA.CreatedDate = DateTime.Now; InfoPartyA.ModifiedDate = DateTime.Now; InfoPartyARepository.InsertInfoPartyA(InfoPartyA); if (Request["IsPopup"] == "true") { ViewBag.closePopup = "close and append to page parent"; model.Id = InfoPartyA.Id; return(View(model)); } TempData[Globals.SuccessMessageKey] = App_GlobalResources.Wording.InsertSuccess; return(RedirectToAction("Index")); } return(View(model)); }
public ActionResult Edit(InfoPartyAViewModel model) { if (ModelState.IsValid) { if (Request["Submit"] == "Save") { var InfoPartyA = InfoPartyARepository.GetInfoPartyAById(model.Id); AutoMapper.Mapper.Map(model, InfoPartyA); InfoPartyA.ModifiedUserId = WebSecurity.CurrentUserId; InfoPartyA.ModifiedDate = DateTime.Now; InfoPartyARepository.UpdateInfoPartyA(InfoPartyA); TempData[Globals.SuccessMessageKey] = App_GlobalResources.Wording.UpdateSuccess; return(RedirectToAction("Index")); } return(View(model)); } return(View(model)); //if (Request.UrlReferrer != null) // return Redirect(Request.UrlReferrer.AbsoluteUri); //return RedirectToAction("Index"); }
public ActionResult Detail(int?Id) { var infoPartyA = InfoPartyARepository.GetvwInfoPartyAById(Id.Value); if (infoPartyA != null && infoPartyA.IsDeleted != true) { var model = new InfoPartyAViewModel(); AutoMapper.Mapper.Map(infoPartyA, model); return(View(model)); } if (Request.UrlReferrer != null) { return(Redirect(Request.UrlReferrer.AbsoluteUri)); } return(RedirectToAction("Index")); }
public ActionResult Edit(int?Id) { var InfoPartyA = InfoPartyARepository.GetInfoPartyAById(Id.Value); if (InfoPartyA != null && InfoPartyA.IsDeleted != true) { var model = new InfoPartyAViewModel(); AutoMapper.Mapper.Map(InfoPartyA, model); if (model.CreatedUserId != Erp.BackOffice.Helpers.Common.CurrentUser.Id && Erp.BackOffice.Helpers.Common.CurrentUser.UserTypeId != 1) { TempData["FailedMessage"] = "NotOwner"; return(RedirectToAction("Index")); } return(View(model)); } if (Request.UrlReferrer != null) { return(Redirect(Request.UrlReferrer.AbsoluteUri)); } return(RedirectToAction("Index")); }
public ViewResult Create() { var model = new InfoPartyAViewModel(); return(View(model)); }