コード例 #1
0
        public ActionResult Edit(string COM_CODE, decimal?USG_ID)
        {
            SetDefaulButton(StandardButtonMode.Modify);
            var da = new SECS02P001DA();

            SetStandardErrorLog(da.DTO);
            da.DTO.Execute.ExecuteType = SECS02P001ExecuteType.GetByID;

            TempModel          = null;
            TempModel.COM_CODE = da.DTO.Model.COM_CODE = COM_CODE;
            TempModel.USG_ID   = da.DTO.Model.USG_ID = USG_ID;

            da.Select(da.DTO);

            if (da.DTO.Model != null)
            {
                localModel = da.DTO.Model;
            }

            localModel.USG_STATUS_MODEL = GetUsgStatus();
            localModel.USG_LEVEL_MODEL  = GetUsgLevel();
            Set(localModel, "USG_LEVEL_MODEL");
            Set(localModel, "USG_STATUS_MODEL");

            return(View(StandardActionName.Edit, localModel));
        }
コード例 #2
0
ファイル: AccountController.cs プロジェクト: Linlijian/SDMST
        public ActionResult SignIn(string returnUrl, string Username)
        {
            ViewBag.message       = string.Empty;
            ViewBag.messageHeader = string.Empty;
            string cdsid = Username;

            if (!string.IsNullOrEmpty(Request.ServerVariables["AUTH_USER"].ToString().Trim()))
            {
                cdsid = Request.ServerVariables["AUTH_USER"].ToString().Split('\\')[0];
            }

            SECS02P002Model dsSys = GET_VSMS_USER(cdsid);

            if (!dsSys.USER_ID.IsNullOrEmpty())
            {
                if (dsSys.IS_DISABLED == "Y")
                {
                    ViewBag.message = string.Concat("-", "Your account is disabled,please contact your system administrator", "<br/>");
                }
                else
                {
                    if (!dsSys.COM_CODE.IsNullOrEmpty() && !dsSys.USG_ID.IsNullOrEmpty())
                    {
                        SECS02P001Model dsUSerGroup = GET_VSMS_USRGROUP(dsSys.COM_CODE, dsSys.USG_ID);
                        if (!dsUSerGroup.COM_CODE.IsNullOrEmpty() &&
                            dsUSerGroup.USG_ID != null &&
                            !dsUSerGroup.USG_CODE.IsNullOrEmpty())
                        {
                            if (!dsUSerGroup.USG_STATUS.IsNullOrEmpty() &&
                                dsUSerGroup.USG_STATUS == "D")
                            {
                                ViewBag.message = string.Concat("-", "Your user group is disable,plase contarct your system administrator", "<br/>");
                            }
                            else
                            {
                                FormsAuthentication.SetAuthCookie(cdsid.Trim(), false);

                                LogInResult enmLogInResult = CheckUserLogInForWindowAuthen(cdsid.Trim());
                                if (enmLogInResult == LogInResult.WrongUserNameOrPassword)
                                {
                                    ViewBag.message = string.Concat("-", "Wrong username or password", "<br/>");
                                }
                                else if (enmLogInResult == LogInResult.Success)
                                {
                                    return(RedirectToAction("SelectModule"));
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                ViewBag.message = string.Concat("User ", cdsid, ": Wrong user name or password");
            }

            return(View("SignIn"));
        }
コード例 #3
0
        public ActionResult Index()
        {
            SetDefaulButton(StandardButtonMode.Index);

            if (TempSearch.IsDefaultSearch && !Request.GetRequest("page").IsNullOrEmpty())
            {
                localModel = TempSearch;
            }
            localModel.USG_STATUS_MODEL = GetUsgStatus();
            return(View(StandardActionName.Index, localModel));
        }
コード例 #4
0
        public ActionResult SaveCreate(SECS02P001Model model, string button = "")
        {
            var jsonResult = new JsonResult();

            if (ModelState.IsValid)
            {
                model.COM_CODE = SessionHelper.SYS_COM_CODE;
                var result = SaveData(StandardActionName.SaveCreate, model);
                jsonResult = Success(result, StandardActionName.SaveModify, Url.Action(StandardActionName.Index, new { page = 1 }));
            }
            else
            {
                jsonResult = ValidateError(ModelState, StandardActionName.SaveModify);
            }
            return(jsonResult);
        }
コード例 #5
0
 private void Set(SECS02P001Model model, string mode)
 {
     if (mode == "USG_STATUS_MODEL")
     {
         foreach (var item in model.USG_STATUS_MODEL)
         {
             item.Value = item.Value.Trim();
         }
     }
     else if (mode == "USG_LEVEL_MODEL")
     {
         foreach (var item in model.USG_LEVEL_MODEL)
         {
             item.Value = item.Value.Trim();
         }
     }
 }
コード例 #6
0
        public ActionResult SaveModify(SECS02P001Model model)
        {
            var jsonResult = new JsonResult();

            if (ModelState.IsValid)
            {
                model.COM_CODE = TempModel.COM_CODE;
                model.USG_ID   = TempModel.USG_ID;
                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);
        }
コード例 #7
0
        public ActionResult Search(SECS02P001Model model)
        {
            var da = new SECS02P001DA();

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

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

            da.DTO.Model = TempSearch;

            da.Select(da.DTO);
            return(JsonAllowGet(da.DTO.Models));
        }
コード例 #8
0
        public ActionResult SaveConfPrgSeq(SECS02P001Model model)
        {
            var jsonResult = new JsonResult();

            if (ModelState.IsValid)
            {
                model.COM_CODE = TempModel.COM_CODE;
                model.USG_ID   = TempModel.USG_ID;
                var result = SaveData("SaveConfPrgSeq", model);
                if (result.IsResult && SessionHelper.SYS_USG_ID == TempModel.USG_ID)
                {
                    Session[SessionSystemName.SYS_MENU] = null;
                    var Menu = SessionHelper.SYS_MenuModel;
                }
                jsonResult = Success(result, StandardActionName.SaveModify, Url.Action("ConfPrgSeq", new { page = 1, TempModel.COM_CODE, TempModel.USG_ID }));
            }
            else
            {
                jsonResult = ValidateError(ModelState, StandardActionName.SaveModify);
            }
            return(jsonResult);
        }
コード例 #9
0
        public ActionResult ConfSysSeq(string COM_CODE, string USG_LEVEL, decimal?USG_ID)
        {
            SetDefaulButton(StandardButtonMode.Other);
            AddStandardButton(StandardButtonName.SaveModify, url: Url.Action("SaveConfSysSeq"));
            var da = new SECS02P001DA();

            SetStandardErrorLog(da.DTO);
            da.DTO.Execute.ExecuteType = SECS02P001ExecuteType.GetByID;

            TempModel           = null;
            TempModel.COM_CODE  = da.DTO.Model.COM_CODE = COM_CODE;
            TempModel.USG_ID    = da.DTO.Model.USG_ID = USG_ID;
            TempModel.USG_LEVEL = da.DTO.Model.USG_LEVEL = USG_LEVEL;

            da.Select(da.DTO);

            if (da.DTO.Model != null)
            {
                localModel = da.DTO.Model;
            }
            localModel.SYS_GROUP_NAME_MODEL = GetDDLCenter(DDLCenterKey.DD_VSMS_USRGROUP_003, new VSMParameter(COM_CODE.Trim()), new VSMParameter(USG_LEVEL));
            return(View("ConfSysSeq", localModel));
        }
コード例 #10
0
        public ActionResult ConfPrg(string COM_CODE, decimal?USG_ID)
        {
            SetDefaulButton(StandardButtonMode.Other);
            AddStandardButton(StandardButtonName.SaveModify, url: Url.Action("SaveConfPrg"));
            var da = new SECS02P001DA();

            SetStandardErrorLog(da.DTO);
            da.DTO.Execute.ExecuteType = SECS02P001ExecuteType.GetByID;

            TempModel          = null;
            TempModel.COM_CODE = da.DTO.Model.COM_CODE = COM_CODE;
            TempModel.USG_ID   = da.DTO.Model.USG_ID = USG_ID;

            da.Select(da.DTO);

            if (da.DTO.Model != null)
            {
                localModel          = da.DTO.Model;
                TempModel.USG_LEVEL = da.DTO.Model.USG_LEVEL;
            }

            localModel.SYS_CODE_MODEL = GetDDLCenter(DDLCenterKey.DD_VSMS_SYSTEM_002);
            return(View("ConfPrg", localModel));
        }