public IHttpActionResult UpdateHoliday(HolidayModel holidayModel) { long result; JavaScriptSerializer serializer = new JavaScriptSerializer(); HolidayModel holiday = serializer.Deserialize <HolidayModel>(holidayModel.jsonData); result = HolidayRepository.UpdateHoliday(holiday); return(Ok(result)); }
public ActionResult Edit(HolidayVM model) { try { string holidayId = string.Empty; model.UpdatedBy = LogInManager.LoggedInUserId; holidayId = holidayRepository.UpdateHoliday(model); if (!string.IsNullOrWhiteSpace(holidayId)) { return(Json(new { IsSuccess = true, data = new { HolidayId = holidayId } }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { IsSuccess = false, errorMessage = "Holiday details not updated successfully." }, JsonRequestBehavior.AllowGet)); } } catch (Exception e) { Utility.Utility.LogError(e, "Edit"); return(Json(new { IsSuccess = false, errorMessage = e.Message })); } }