Exemple #1
0
        public ActionResult Golive(MISS01P002Model model)
        {
            var da = new MISS01P002DA();

            SetStandardErrorLog(da.DTO);
            da.DTO.Execute.ExecuteType = MISS01P002ExecuteType.MoveToGolive;

            da.DTO.Model           = model;
            da.DTO.Model.FLAG      = "G";
            da.DTO.Model.CRET_BY   = SessionHelper.SYS_USER_ID;
            da.DTO.Model.CRET_DATE = DateTime.Now;
            da.UpdateNoEF(da.DTO);


            return(JsonAllowGet(da.DTO.Model));
        }
        private DTOResult SaveData(string mode, object model)
        {
            var da = new MISS01P002DA();

            //ในกรณีที่มีการ SaveLog ให้ Include SetStandardLog ด้วย
            //SetStandardLog(
            //   da.DTO,
            //   model,
            //   GetSaveLogConfig("dbo", "VSMS_COMPANY", "COM_CODE"));


            if (mode == StandardActionName.SaveCreate)
            {
                SetStandardField(model);
                da.DTO.Model = (MISS01P002Model)model;
                //da.DTO.Execute.ExecuteType = MISS01P002ExecuteType.Insert;
                da.DTO.Model.COM_CODE = SessionHelper.SYS_COM_CODE;

                da.InsertNoEF(da.DTO);
            }
            else if (mode == StandardActionName.Delete)
            {
                da.DTO.Models         = (List <MISS01P002Model>)model;
                da.DTO.Model.COM_CODE = SessionHelper.SYS_COM_CODE;
                da.DeleteNoEF(da.DTO);
            }
            else if (mode == "Assignment")
            {
                SetStandardField(model);
                da.DTO.Execute.ExecuteType = MISS01P002ExecuteType.UpdateAssignment;
                da.DTO.Model = (MISS01P002Model)model;
                da.UpdateNoEF(da.DTO);
            }
            else if (mode == "FilePacket")
            {
                SetStandardFieldWithoutComCode(model);
                da.DTO.Execute.ExecuteType = MISS01P002ExecuteType.UpdateFilePacket;
                da.DTO.Model = (MISS01P002Model)model;
                da.UpdateNoEF(da.DTO);
            }

            return(da.DTO.Result);
        }
        public ActionResult Assignment(MISS01P002Model model)
        {
            var da = new MISS01P002DA();

            SetStandardErrorLog(da.DTO);
            da.DTO.Execute.ExecuteType = MISS01P002ExecuteType.GetByIdOpening;

            da.DTO.Model.COM_CODE = model.COM_CODE; //checked
            da.DTO.Model.NO       = model.NO;

            da.SelectNoEF(da.DTO);

            #region Set Value
            var view = string.Empty;
            view = "Assignment";
            SetButton(view);
            localModel                   = da.DTO.Model;
            TempModel.COM_CODE           = da.DTO.Model.COM_CODE.Trim();
            localModel.ASSIGN_USER_MODEL = BindOwner();
            #endregion

            return(View(view, localModel));
        }
        public ActionResult FilePacket(MISS01P002Model model)
        {
            SetDefaulButton(StandardButtonMode.Create);
            SetDefaultData();
            SetButton("FilePacket");

            #region set default
            var view = string.Empty;
            view = "FilePacket";

            var da = new MISS01P002DA();
            da.DTO.Execute.ExecuteType = MISS01P002ExecuteType.GetFilePacket;
            da.DTO.Model.COM_CODE      = model.COM_CODE;
            da.DTO.Model.ISE_NO        = model.ISE_NO;
            da.SelectNoEF(da.DTO);

            localModel         = da.DTO.Model;
            localModel.FILE_ID = da.DTO.Model.FILE_ID.Trim();
            //localModel.COM_CODE = SessionHelper.SYS_COM_CODE;
            #endregion

            return(View(view, localModel));
        }
        public ActionResult SearchOpening(MISS01P002Model model)
        {
            var da = new MISS01P002DA();

            SetStandardErrorLog(da.DTO);
            da.DTO.Execute.ExecuteType = MISS01P002ExecuteType.GetAllOpening;

            if (Request.GetRequest("page").IsNullOrEmpty())
            {
                model.IsDefaultSearch = true;
                TempSearch            = model;
            }

            //if (model.APP_CODE.IsNullOrEmpty())
            //{
            //    var app = BindAppCode();
            //    model.APP_CODE = app[0].Value.ToString();
            //}

            da.DTO.Model          = TempSearch;
            da.DTO.Model.COM_CODE = model.APP_CODE;
            da.SelectNoEF(da.DTO);
            return(JsonAllowGet(da.DTO.Models, da.DTO.Result));
        }