public JsonResult SaveBasNormalSchedule(CBasNormalSchedule BasNormalSchedule) { string str = string.Empty; if (!ModelState.IsValid) { List <string> errorList = ModelStateExtension.GetModelError(ViewData); str = string.Join(",", errorList.ToArray()); return(Json(new { Success = false, Msg = str }, JsonRequestBehavior.AllowGet)); } else { CBasNormalSchedule tmpBasNormalSchedule = null; str = "<=SaveSuccess>"; if (!string.IsNullOrEmpty(BasNormalSchedule.BasNormalScheduleId)) { tmpBasNormalSchedule = _BasNormalScheduleDBAccess.Get(BasNormalSchedule.BasNormalScheduleId); TryUpdateModel <CBasNormalSchedule>(tmpBasNormalSchedule); } else { tmpBasNormalSchedule = BasNormalSchedule; } string errMsg; bool Success; Success = _BasNormalScheduleDBAccess.Save(tmpBasNormalSchedule, out errMsg); return(Json(new { Success = Success, Msg = Success ? str : errMsg, BasNormalSchedule = tmpBasNormalSchedule }, JsonRequestBehavior.AllowGet)); } }
public ActionResult BasNormalScheduleVTm() { CBasNormalSchedule BasNormalSchedule = new CBasNormalSchedule(); string BasNormalScheduleId = Request.QueryString["BasNormalScheduleId"]; BasNormalSchedule = _BasNormalScheduleDBAccess.Get(BasNormalScheduleId); if (BasNormalSchedule == null) { return(RedirectToAction("BasNormalSchedule", "BasicData")); } return(View(BasNormalSchedule)); }