Esempio n. 1
0
        public JsonResult SaveBasSpecialScheduleIndex(CBasSpecialScheduleIndex BasSpecialScheduleIndex)
        {
            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
            {
                CBasSpecialScheduleIndex tmpBasSpecialScheduleIndex = null;
                str = "<=SaveSuccess>";
                if (!string.IsNullOrEmpty(BasSpecialScheduleIndex.BasSpecialScheduleIndexId))
                {
                    tmpBasSpecialScheduleIndex = _BasSpecialScheduleIndexDBAccess.Get(BasSpecialScheduleIndex.BasSpecialScheduleIndexId);
                    TryUpdateModel <CBasSpecialScheduleIndex>(tmpBasSpecialScheduleIndex);
                }
                else
                {
                    tmpBasSpecialScheduleIndex = BasSpecialScheduleIndex;
                }
                string errMsg;
                bool   Success;
                Success = _BasSpecialScheduleIndexDBAccess.Save(tmpBasSpecialScheduleIndex, out errMsg);
                return(Json(new { Success = Success, Msg = Success ? str : errMsg, BasSpecialScheduleIndex = tmpBasSpecialScheduleIndex }, JsonRequestBehavior.AllowGet));
            }
        }
Esempio n. 2
0
        public ActionResult BasSpecialSchedule()
        {
            CBasSpecialScheduleIndex BasSpecialScheduleIndex = new CBasSpecialScheduleIndex();
            string BasSpecialScheduleIndexId = Request.QueryString["BasSpecialScheduleIndexId"];

            BasSpecialScheduleIndex = _BasSpecialScheduleIndexDBAccess.Get(BasSpecialScheduleIndexId);
            if (BasSpecialScheduleIndex == null)
            {
                return(RedirectToAction("BasSpecialScheduleIndex", "BasicData"));
            }
            return(View(BasSpecialScheduleIndex));
        }