Пример #1
0
 private MISS01P001Model SetModelDateTime(MISS01P001Model model)
 {
     if (!model.STR_CLOSE_DATE.IsNullOrEmpty())
     {
         model.CLOSE_DATE = model.STR_CLOSE_DATE.AsDateTimes();
     }
     if (!model.STR_DEPLOY_QA.IsNullOrEmpty())
     {
         model.DEPLOY_QA = model.STR_DEPLOY_QA.AsDateTimes();
     }
     if (!model.STR_RDEPLOY_PD.IsNullOrEmpty())
     {
         model.DEPLOY_PD = model.STR_RDEPLOY_PD.AsDateTimes();
     }
     if (!model.STR_ISSUE_DATE.IsNullOrEmpty())
     {
         model.ISSUE_DATE = model.STR_ISSUE_DATE.AsDateTimes();
     }
     if (!model.STR_RESPONSE_DATE.IsNullOrEmpty())
     {
         model.RESPONSE_DATE = model.STR_RESPONSE_DATE.AsDateTimes();
     }
     if (!model.STR_TARGET_DATE.IsNullOrEmpty())
     {
         model.TARGET_DATE = model.STR_TARGET_DATE.AsDateTimes();
     }
     return(model);
 }
Пример #2
0
 private void SetDateToString(MISS01P001Model model)
 {
     if (!model.CLOSE_DATE.IsNullOrEmpty())
     {
         localModel.STR_CLOSE_DATE = model.CLOSE_DATE.AsStringDate();
     }
     if (!model.DEPLOY_QA.IsNullOrEmpty())
     {
         localModel.STR_DEPLOY_QA = model.DEPLOY_QA.AsStringDate();
     }
     if (!model.DEPLOY_PD.IsNullOrEmpty())
     {
         localModel.STR_RDEPLOY_PD = model.DEPLOY_PD.AsStringDate();
     }
     if (!model.ISSUE_DATE.IsNullOrEmpty())
     {
         localModel.STR_ISSUE_DATE = model.ISSUE_DATE.AsStringDate();
     }
     if (!model.RESPONSE_DATE.IsNullOrEmpty())
     {
         localModel.STR_RESPONSE_DATE = model.RESPONSE_DATE.AsStringDate();
     }
     if (!model.TARGET_DATE.IsNullOrEmpty())
     {
         localModel.STR_TARGET_DATE = model.TARGET_DATE.AsStringDate();
     }
 }
Пример #3
0
        public ActionResult SaveCreate(MISS01P001Model model)
        {
            var jsonResult = new JsonResult();

            if (ModelState.IsValid)
            {
                model          = SetModelDateTime(model);
                model          = RemoveSpace(model);
                model.COM_CODE = TempModel.APP_CODE = model.APP_CODE;
                var result = SaveData(StandardActionName.SaveCreate, model);
                //if(result.ResultMsg != null)
                //{
                //    string msg = string.Format("Issue no. {0}" + Environment.NewLine +
                //             "FROM {1}" + Environment.NewLine +
                //             "TO " + "@" + "{2}" + Environment.NewLine +
                //             "Detail {3}", model.NO, model.ISSUE_BY, model.SOLUTION, model.REMARK);

                //    lineNotify(msg);
                //}
                jsonResult = Success(result, StandardActionName.SaveCreate, Url.Action(StandardActionName.Index, new { page = 1 }));
            }
            else
            {
                jsonResult = ValidateError(ModelState, StandardActionName.SaveCreate);
            }

            return(jsonResult);
        }
Пример #4
0
 private void Set(MISS01P001Model model)
 {
     foreach (var item in model.RESPONSE_BY_MODEL)
     {
         item.Value = item.Value.Trim();
     }
 }
Пример #5
0
        public ActionResult LoadExcel(MISS01P001Model model)
        {
            var jsonResult = new JsonResult();

            if (ModelState.IsValid)
            {
                model.ds         = ExcelData.TBL_SELECT;
                model.CLIENT_ID  = TempModel.CLIENT_ID = Guid.NewGuid().ToString();
                model.COM_CODE   = model.APP_CODE;
                model.FILE_EXCEL = ExcelData.UPLOAD_FILENAME;

                var result = SaveData("Upload", model);
                if (result.IsResult)
                {
                    if (model.ERROR_CODE == "0")
                    {
                        return(Json(new WEBAPP.Models.AjaxResult("Upload", true, AlertStyles.Success, "Load Excel File Completed!")));
                    }
                    else
                    {
                        return(Json(new WEBAPP.Models.AjaxResult("Upload", false, AlertStyles.Error, "Load Excel File InComplete!")));
                    }
                }

                return(Json(new WEBAPP.Models.AjaxResult("Upload", false, AlertStyles.Error, "Load Excel File InComplete!" + " " + result.ResultMsg)));
            }
            else
            {
                jsonResult = ValidateError(ModelState, StandardActionName.SaveModify);
            }

            return(jsonResult);
        }
Пример #6
0
        public ActionResult AddRefNo(MISS01P001Model model)
        {
            SetDefaulButton(StandardButtonMode.Create);
            AddButton(StandButtonType.ButtonAjax, "GetRefNo", "Reference No", iconCssClass: FaIcons.FaPrint);
            SetDefaultData(StandardActionName.Add);
            localModel.USER_ID = SessionHelper.SYS_USER_ID;
            string view = "AddRefNo";

            #region set ref_no
            if (!model.REF_NO.IsNullOrEmpty())
            {
                var da = new MISS01P001DA();
                da.DTO.Execute.ExecuteType = MISS01P001ExecuteType.GetReOpen;
                da.DTO.Model.NO            = model.REF_NO;
                da.DTO.Model.REF_NO        = model.REF_NO;
                da.DTO.Model.APP_CODE      = model.COM_CODE;
                da.SelectNoEF(da.DTO);

                da.DTO.Model.NO = da.DTO.Model.NO + 1;

                localModel = da.DTO.Model;

                SetDefaultData(StandardActionName.Add);
            }
            #endregion

            return(View(view, localModel));
        }
Пример #7
0
        public ActionResult ViewReport02(MISS01P001Model model)
        {
            string error_code = "0";
            string RE_BUG     = " ";

            if (model.CRET_BY == null)
            {
                model.CRET_BY = SessionHelper.SYS_USER_ID;
            }

            if (model.ISSUE_DATE_PERIOD == null)
            {
                model.ISSUE_DATE_PERIOD = "2019-04";
            }

            string Parameter = string.Concat
                               (
                "&error_code=", error_code
                , "&CRET_BY=", model.CRET_BY
                //, "&RE_BUG" , HttpUtility.UrlEncode(RE_BUG)
                , "&ISSUE_DATE_PERIOD=", model.ISSUE_DATE_PERIOD
                               );

            return(Content("http://" + "CHANG" + "/SDMSReport?/" + "REPORTING_SDMSBBK" + "/" + ReportName2 + "&rs:Command=Render&rs:Format=HTML4.0&rc:Parameters=false" + Parameter));
        }
Пример #8
0
        private MISS01P001Model RemoveSpace(MISS01P001Model model)
        {
            if (!model.MENU.IsNullOrEmpty())
            {
                model.MENU = model.MENU.Trim();
            }
            if (!model.PRG_NAME.IsNullOrEmpty())
            {
                model.PRG_NAME = model.PRG_NAME.Trim();
            }

            return(model);
        }
Пример #9
0
        public ActionResult GetRefNo(MISS01P001Model model)
        {
            var jsonResult = new JsonResult();

            var da = new MISS01P001DA();

            da.DTO.Execute.ExecuteType = MISS01P001ExecuteType.GetNo;
            TempModel.APP_CODE         = da.DTO.Model.COM_CODE = model.APP_CODE;
            da.SelectNoEF(da.DTO);
            da.DTO.Model.NO = da.DTO.Model.NO + 1;
            localModel.RESPONSE_BY_MODEL = BindResponseByIn();
            //jsonResult = Success(da.DTO.Result, StandardActionName.Add);

            return(JsonAllowGet(da.DTO.Model));
            //return jsonResult;
        }
Пример #10
0
        public ActionResult Info(MISS01P001Model model)
        {
            var da = new MISS01P001DA();

            da.DTO.Execute.ExecuteType = MISS01P001ExecuteType.GetByID;
            //da.DTO.Model.COM_CODE = SessionHelper.SYS_COM_CODE;
            da.DTO.Model.APP_CODE = model.COM_CODE;
            da.DTO.Model.NO       = model.NO;
            da.SelectNoEF(da.DTO);
            localModel = da.DTO.Model;

            SetDateToString(da.DTO.Model);
            SetDefaulButton(StandardButtonMode.Other);

            return(View(StandardActionName.Info, localModel));
        }
Пример #11
0
        public ActionResult Search(MISS01P001Model model)
        {
            var da = new MISS01P001DA();

            SetStandardErrorLog(da.DTO);
            da.DTO.Execute.ExecuteType = MISS01P001ExecuteType.GetAll;

            if (Request.GetRequest("page").IsNullOrEmpty())
            {
                model.IsDefaultSearch = true;
                TempSearch            = model;
            }
            da.DTO.Model          = TempSearch;
            da.DTO.Model.COM_CODE = SessionHelper.SYS_COM_CODE;
            da.SelectNoEF(da.DTO);
            return(JsonAllowGet(da.DTO.Models, da.DTO.Result));
        }
Пример #12
0
        public ActionResult Index(string ACTIVE_STEP = "1")
        {
            string ACTIVE_WIZARD_MAX = "2";
            var    view = string.Empty;
            var    da   = new MISS01P001DA();


            if (ACTIVE_STEP == "1")
            {
                view = "Index1";
                SetDefaulButton(StandardButtonMode.Index);
                RemoveStandardButton("DeleteSearch");
                AddStandardButton(StandardButtonName.Upload);
                AddStandardButton(StandardButtonName.DownloadTemplate, url: "MISS01TP001");
                if (TempSearch.IsDefaultSearch && !Request.GetRequest("page").IsNullOrEmpty())
                {
                    localModel = TempSearch.CloneObject();
                }

                localModel.USER_ID = SessionHelper.SYS_USER_ID;
                SetDefaultData(StandardActionName.Index);
            }
            else if (ACTIVE_STEP == "2")
            {
                view = "Index2";
                AddButton(StandButtonType.ButtonAjax, "report", "Report Issue", iconCssClass: FaIcons.FaPrint, cssClass: "std-btn-print", url: Url.Action("ViewReport"), isValidate: true);

                AddButton(StandButtonType.ButtonAjax, "report", "Summary Issue", iconCssClass: FaIcons.FaPrint, cssClass: "std-btn-print", url: Url.Action("ViewReportSummary"), isValidate: true);

                AddButton(StandButtonType.ButtonAjax, "report", "Report02", iconCssClass: FaIcons.FaPrint, cssClass: "std-btn-print", url: Url.Action("ViewReport02"), isValidate: true);

                if (TempSearch.IsDefaultSearch && !Request.GetRequest("page").IsNullOrEmpty())
                {
                    localModel = TempSearch.CloneObject();
                }
            }
            SetHeaderWizard(new WizardHelper.WizardHeaderConfig(
                                ACTIVE_STEP,
                                ACTIVE_WIZARD_MAX,
                                new WizardHelper.WizardHeader("", Url.Action("Index", new { ACTIVE_STEP = "1" }), iconCssClass: FaIcons.FaPencil, textStep: Translation.MIS.MISS01P001.Index1),
                                new WizardHelper.WizardHeader("", Url.Action("Index", new { ACTIVE_STEP = "2" }), iconCssClass: FaIcons.FaSearch, textStep: Translation.MIS.MISS01P001.Index2)));


            return(View(view, localModel));
        }
Пример #13
0
        public ActionResult SaveModify(MISS01P001Model model)
        {
            var jsonResult = new JsonResult();

            if (ModelState.IsValid)
            {
                model          = SetModelDateTime(model);
                model          = RemoveSpace(model);
                model.COM_CODE = TempModel.APP_CODE = model.APP_CODE;
                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);
        }
Пример #14
0
        public ActionResult Edit(MISS01P001Model model)
        {
            var da = new MISS01P001DA();

            da.DTO.Execute.ExecuteType = MISS01P001ExecuteType.GetByID;
            da.DTO.Model.NO            = model.NO;
            TempModel.APP_CODE         = da.DTO.Model.APP_CODE = model.COM_CODE;
            da.SelectNoEF(da.DTO);
            localModel = da.DTO.Model;

            localModel.RESPONSE_BY_MODEL = BindResponseByIn();
            Set(localModel);

            SetDefaultData(StandardActionName.Edit);
            SetDateToString(da.DTO.Model);
            SetDefaulButton(StandardButtonMode.Modify);
            AddButton(StandButtonType.ButtonAjax, "GetRefNo", "Reference No", iconCssClass: FaIcons.FaPrint);

            return(View(StandardActionName.Edit, localModel));
        }
Пример #15
0
        public ActionResult Save(MISS01P001Model model)
        {
            var jsonResult = new JsonResult();

            if (ModelState.IsValid)
            {
                model.CLIENT_ID = TempModel.CLIENT_ID;
                model.COM_CODE  = TempModel.APP_CODE = model.APP_CODE;
                var result = SaveData("SaveUpload", model);
                if (result.IsResult)
                {
                    jsonResult = Success(result, "SaveUpload", Url.Action(StandardActionName.Index, new { page = 1 }));
                }
                else
                {
                    return(Json(new WEBAPP.Models.AjaxResult("Upload", false, AlertStyles.Error, "Save InComplete " + result.ResultMsg)));
                }
            }
            else
            {
                jsonResult = ValidateError(ModelState, "SaveUpload");
            }
            return(jsonResult);
        }
Пример #16
0
        public ActionResult GetNo(MISS01P001Model model)
        {
            var jsonResult = new JsonResult();

            var da = new MISS01P001DA();

            da.DTO.Execute.ExecuteType = MISS01P001ExecuteType.GetNo;
            da.DTO.Model.COM_CODE      = model.APP_CODE;
            da.SelectNoEF(da.DTO);
            if (da.DTO.Model.NO.IsNullOrEmpty())
            {
                da.DTO.Model.NO = 1;
            }
            else
            {
                da.DTO.Model.NO = da.DTO.Model.NO + 1;
            }


            //jsonResult = Success(da.DTO.Result, StandardActionName.Add);

            return(JsonAllowGet(da.DTO.Model));
            //return jsonResult;
        }