Пример #1
0
 public ActionResult Index()
 {
     SetDefaulButton(StandardButtonMode.Index);
     if (TempSearch.IsDefaultSearch && !Request.GetRequest("page").IsNullOrEmpty())
     {
         localModel = TempSearch.CloneObject();
     }
     SetDefaultData(StandardActionName.Index);
     return(View(StandardActionName.Index, localModel));
 }
Пример #2
0
        public ActionResult SaveModify(MSTS02P001Model model)
        {
            var jsonResult = new JsonResult();

            if (ModelState.IsValid)
            {
                var result = SaveData(StandardActionName.SaveModify, model);
                jsonResult = Success(result, StandardActionName.SaveModify, Url.Action(StandardActionName.Index, new { page = 1 }));
            }
            else
            {
                jsonResult = ValidateError(ModelState, StandardActionName.SaveModify);
            }
            return(jsonResult);
        }
Пример #3
0
        public ActionResult Search(MSTS02P001Model model)
        {
            var da = new MSTS02P001DA();

            SetStandardErrorLog(da.DTO);
            da.DTO.Execute.ExecuteType = MSTS02P001ExecuteType.GetAll;
            if (Request.GetRequest("page").IsNullOrEmpty())
            {
                model.IsDefaultSearch = true;
                TempSearch            = model;
            }
            da.DTO.Model = TempSearch;
            SetStandardField(da.DTO.Model);
            da.SelectNoEF(da.DTO);
            return(JsonAllowGet(da.DTO.Models, da.DTO.Result));
        }
Пример #4
0
        public ActionResult SaveCreate(MSTS02P001Model model)
        {
            var jsonResult = new JsonResult();

            if (ModelState.IsValid)
            {
                model.IS_USE = "F"; //defualt
                var result = SaveData(StandardActionName.SaveCreate, model);
                jsonResult = Success(result, StandardActionName.SaveCreate, Url.Action(StandardActionName.Index, new { page = 1 }));
            }
            else
            {
                jsonResult = ValidateError(ModelState, StandardActionName.SaveCreate);
            }

            return(jsonResult);
        }
Пример #5
0
        public ActionResult Edit(MSTS02P001Model model)
        {
            var da = new MSTS02P001DA();

            SetStandardErrorLog(da.DTO);
            da.DTO.Execute.ExecuteType = MSTS01P001ExecuteType.GetByID;
            da.DTO.Model.YEAR          = model.YEAR;
            da.DTO.Model.COM_CODE      = model.COM_CODE;

            da.SelectNoEF(da.DTO);
            localModel = da.DTO.Model;

            SetDefaulButton(StandardButtonMode.Modify);
            SetDefaultData();   //set ค่า DDL


            return(View(StandardActionName.Edit, localModel));
        }