Exemplo n.º 1
0
 public ActionResult Create(NLSViewModel viewModel)
 {
     var req = viewModel.MapTo<SaveNLSRequest>();
     var response = _nlsService.SaveNLS(req);
     TempData["IsSuccess"] = response.IsSuccess;
     TempData["Message"] = response.Message;
     if (response.IsSuccess)
     {
         return RedirectToAction("Index");
     }
     return View("Create", viewModel);
 }
Exemplo n.º 2
0
 //
 // GET: /NLS/Edit/5
 public ActionResult Manage()
 {
     var viewModel = new NLSViewModel();
     var id = string.IsNullOrEmpty(Request.QueryString["nlsId"]) ? 0 : int.Parse(Request.QueryString["nlsId"]);
     if (id != 0)
     {
         var nls = _nlsService.GetNLS(new GetNLSRequest { Id = id });
         viewModel = nls.MapTo<NLSViewModel>();
     }
     else {
         var vesselScheduleId = int.Parse(Request.QueryString["vsId"]);
         viewModel.VesselScheduleId = vesselScheduleId;
         viewModel.VesselName = _vesselScheduleService.GetVesselSchedule(new GetVesselScheduleRequest { Id = vesselScheduleId }).VesselName;
     }
     return View(viewModel);
 }
Exemplo n.º 3
0
 public ActionResult Manage(NLSViewModel viewModel)
 {
     var req = viewModel.MapTo<SaveNLSRequest>();
     var response = _nlsService.SaveNLS(req);
     TempData["IsSuccess"] = response.IsSuccess;
     TempData["Message"] = response.Message;
     if (response.IsSuccess)
     {
         return RedirectToAction("Display", "Highlight");
     }
     return View("Manage", viewModel);
 }
Exemplo n.º 4
0
 public ActionResult ManageRemark(NLSViewModel viewModel)
 {
     var req = viewModel.MapTo<SaveNLSRequest>();
     var response = _nlsService.SaveNLS(req);
     return Json(response);
 }