Ejemplo n.º 1
0
        public IActionResult EditCampaign(Guid id)
        {
            var model = new EditCampaignModel();

            model.Load(id);
            return(View(model));
        }
Ejemplo n.º 2
0
 public IActionResult EditCampaign([Bind(nameof(EditCampaignModel.Name),
                                         nameof(EditCampaignModel.Subject),
                                         nameof(EditCampaignModel.Body),
                                         nameof(EditCampaignModel.Datetime),
                                         nameof(EditCampaignModel.GroupId),
                                         nameof(EditCampaignModel.Status))]
                                   EditCampaignModel model)
 {
     if (ModelState.IsValid)
     {
         try
         {
             model.Edit();
             model.Response = new ResponseModel("Update Successfull", ResponseType.Success);
             return(RedirectToAction("index"));
         }
         catch (DuplicationException message)
         {
             model.Response = new ResponseModel(message.Message, ResponseType.Failure);
         }
         catch (Exception ex)
         {
             model.Response = new ResponseModel("Update Failed.", ResponseType.Failure);
             // error logger code
         }
     }
     return(View(model));
 }
Ejemplo n.º 3
0
 public ActionResult Edit(EditCampaignModel model)
 {
     return(AsView(Handler.Get <EditCampaignHandler>().Handle(model), RedirectToAction("Edit", "Campaign", new { id = model.Id })));
 }