public ActionResult CreateOrEditPoliScheduleMaster(PoliScheduleMasterModel _model) { if (Session["UserLogon"] != null) { _model.Account = (AccountModel)Session["UserLogon"]; } // convert the time DateTime startDate = DateTime.ParseExact(_model.StartTimeStr, "HH:mm", CultureInfo.InvariantCulture); _model.StartTime = startDate.TimeOfDay; DateTime endDate = DateTime.ParseExact(_model.EndTimeStr, "HH:mm", CultureInfo.InvariantCulture); _model.EndTime = endDate.TimeOfDay; var request = new PoliScheduleMasterRequest { Data = _model, }; PoliScheduleMasterResponse _response = new PoliScheduleMasterValidator(_unitOfWork).Validate(request); ViewBag.Response = $"{_response.Status};{_response.Message}"; ViewBag.Clinics = BindDropDownClinic(); ViewBag.Doctors = BindDropDownDoctor(); ViewBag.Polis = BindDropDownPoli(); ViewBag.Days = BindDropDownDay(); ViewBag.ActionType = _model.Id > 0 ? ClinicEnums.Action.Edit : ClinicEnums.Action.Add; return(View()); }
public JsonResult DeletePoliScheduleMaster(int id) { var request = new PoliScheduleMasterRequest { Data = new PoliScheduleMasterModel { Id = id, Account = Session["UserLogon"] == null ? new AccountModel() : (AccountModel)Session["UserLogon"] }, Action = ClinicEnums.Action.DELETE.ToString() }; PoliScheduleMasterResponse _response = new PoliScheduleMasterValidator(_unitOfWork).Validate(request); return(Json(new { Status = _response.Status, Message = _response.Message }, JsonRequestBehavior.AllowGet)); }