public ActionResult Edit(NotificationSaveModel model) { try { if (ModelState.IsValid) { if (model.cropper.PhotoNormal != null) { model.notificationsave.NotificationImagePath = model.cropper.PhotoNormal; } else { model.notificationsave.NotificationImagePath = model.notificationsave.NotificationImagePath; } string jsonStr = JsonConvert.SerializeObject(model.notificationsave); TempData["ErrMsg"] = objAPI.PostRecordtoApI("configuration", "savenotification", jsonStr); return(RedirectToAction("index", "notifications", new { Area = "Admin" })); } return(View(model)); } catch (AuthorizationException) { TempData["ErrMsg"] = "Your Login Session has expired. Please Login Again"; return(RedirectToAction("Login", "Account", new { Area = "" })); } }
public ActionResult Edit(long id) { try { NotificationSaveModel model = new NotificationSaveModel(); model.notificationsave = objAPI.GetObjectByKey <utblLCNotification>("configuration", "notificationbyid", id.ToString(), "id"); return(View(model)); } catch (AuthorizationException) { TempData["ErrMsg"] = "Your Login Session has expired. Please Login Again"; return(RedirectToAction("Login", "Account", new { Area = "" })); } }
public static Notification Map(ulong notificationId, ulong eventId, string emailAddress, NotificationSaveModel notification) { var p = new Notification(notificationId, eventId, notification.Message, notification.Created, emailAddress); return(p); }
public Task Add(ulong notificationId, ulong eventId, NotificationSaveModel notification, CancellationToken cancellationToken) { var email = this.User.GetEmailAddress(); return(mediator.Send(new AddNotification(MapClub.Map(notificationId, eventId, email, notification)), cancellationToken)); }