コード例 #1
0
        public ActionResult EditMySelf(string USER_ID)
        {
            SetDefaulButton(StandardButtonMode.Modify);

            var da = new SECS02P002DA();

            SetStandardErrorLog(da.DTO);
            da.DTO.Execute.ExecuteType = SECS02P002ExecuteType.GetUser;
            TempModel.USER_ID          = da.DTO.Model.USER_ID = USER_ID;
            da.Select(da.DTO);
            if (da.DTO.Model != null)
            {
                localModel            = da.DTO.Model;
                localModel.APP_CODE   = da.DTO.Model.COM_CODE;
                TempModel.COM_CODE    = da.DTO.Model.COM_CODE;
                TempModel.IS_DISABLED = "N";
            }

            SetDefaultData(StandardActionName.Edit);
            string view = "EditMySelf";

            AddButton(StandButtonType.ButtonAjax, "RePassword", "RePassword", iconCssClass: FaIcons.FaRefresh);

            return(View(view, localModel));
        }
コード例 #2
0
 private void Set(SECS02P002Model model)
 {
     foreach (var item in model.USER_STATUS_MODEL)
     {
         item.Value = item.Value.Trim();
     }
 }
コード例 #3
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"));
        }
コード例 #4
0
        public ActionResult GetFullAppName(SECS02P002Model model)
        {
            var da = new SECS02P002DA();

            SetStandardErrorLog(da.DTO);
            da.DTO.Execute.ExecuteType = SECS02P002ExecuteType.GetFullAppName;
            da.DTO.Model.COM_CODE      = model.APP_CODE;

            da.SelectNoEF(da.DTO);
            return(JsonAllowGet(da.DTO.Model.Details[0]));
        }
コード例 #5
0
        public ActionResult Index()
        {
            SetDefaulButton(StandardButtonMode.Index);

            //AddButton(StandButtonType.ButtonAjax, "report", "Report", cssClass: "std-btn-print", iconCssClass: FaIcons.FaPrint, url: Url.Action("ViewReport"));

            if (TempSearch.IsDefaultSearch && !Request.GetRequest("page").IsNullOrEmpty())
            {
                localModel = TempSearch.CloneObject();
            }
            SetDefaultData(StandardActionName.Index);

            return(View(StandardActionName.Index, localModel));
        }
コード例 #6
0
        public ActionResult ForGetPassword(SECS02P002Model model)
        {
            var da = new SECS02P002DA();

            SetStandardErrorLog(da.DTO);
            da.DTO.Execute.ExecuteType = SECS02P002ExecuteType.ForGetPassword;
            model.CRET_BY  = SessionHelper.SYS_USER_ID;
            model.COM_CODE = SessionHelper.SYS_COM_CODE;
            da.DTO.Model   = model;

            da.UpdateNoEF(da.DTO);


            return(JsonAllowGet(da.DTO.Model));
        }
コード例 #7
0
        public ActionResult SaveModify(SECS02P002Model 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);
        }
コード例 #8
0
        public ActionResult Info(string USER_ID)
        {
            SetDefaulButton(StandardButtonMode.View);
            var da = new SECS02P002DA();

            SetStandardErrorLog(da.DTO);
            da.DTO.Execute.ExecuteType = DTOExecuteType.GetByID;
            TempModel.USER_ID          = da.DTO.Model.USER_ID = USER_ID;
            da.Select(da.DTO);
            if (da.DTO.Model != null)
            {
                localModel = da.DTO.Model;
            }
            return(View(StandardActionName.Info, localModel));
        }
コード例 #9
0
        public ActionResult CheckAdmin(SECS02P002Model model)
        {
            var jsonResult = new JsonResult();

            var da = new SECS02P002DA();

            SetStandardErrorLog(da.DTO);
            da.DTO.Execute.ExecuteType = SECS02P002ExecuteType.CheckAdmin;
            da.DTO.Model.USG_ID        = model.USG_ID;
            da.SelectNoEF(da.DTO);

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

            return(JsonAllowGet(da.DTO.Model));
            //return jsonResult;
        }
コード例 #10
0
        public ActionResult CustomsExport(SECS02P002Model model)
        {
            var da = new SECS02P002DA();

            SetStandardErrorLog(da.DTO);
            da.DTO.Execute.ExecuteType = SECS02P002ExecuteType.GetQuerySearchAll;

            da.Select(da.DTO);

            if (da.DTO.Models != null)
            {
                ExportHelper.ExportExcel(Response, da.DTO.Models);
            }

            return(Content("ExportExcel clicked"));
        }
コード例 #11
0
        public ActionResult SaveCreate(SECS02P002Model model)
        {
            var jsonResult = new JsonResult();

            if (ModelState.IsValid)
            {
                model.COM_CODE = SessionHelper.SYS_COM_CODE;

                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);
        }
コード例 #12
0
        public ActionResult Search(SECS02P002Model model)
        {
            var da = new SECS02P002DA();

            SetStandardErrorLog(da.DTO);
            da.DTO.Execute.ExecuteType = SECS02P002ExecuteType.GetQuerySearchAll;
            if (Request.GetRequest("page").IsNullOrEmpty())
            {
                model.IsDefaultSearch = true;
                TempSearch            = model;
            }
            da.DTO.Model = TempSearch;

            da.DTO.Model.COM_CODE = SessionHelper.SYS_COM_CODE;

            da.Select(da.DTO);
            return(JsonAllowGet(da.DTO.Models, da.DTO.Result));
        }
コード例 #13
0
        public ActionResult Index()
        {
            if (SessionHelper.SYS_USG_LEVEL != "A" && SessionHelper.SYS_USG_LEVEL != "S")
            {
                return(RedirectToAction("EditMySelf", new { USER_ID = SessionHelper.SYS_USER_ID }));
            }

            SetDefaulButton(StandardButtonMode.Index);

            //AddButton(StandButtonType.ButtonAjax, "report", "Report", cssClass: "std-btn-print", iconCssClass: FaIcons.FaPrint, url: Url.Action("ViewReport"));

            if (TempSearch.IsDefaultSearch && !Request.GetRequest("page").IsNullOrEmpty())
            {
                localModel = TempSearch.CloneObject();
            }
            SetDefaultData(StandardActionName.Index);

            return(View(StandardActionName.Index, localModel));
        }
コード例 #14
0
        public ActionResult Edit(string USER_ID)
        {
            SetDefaulButton(StandardButtonMode.Modify);

            var da = new SECS02P002DA();

            SetStandardErrorLog(da.DTO);
            da.DTO.Execute.ExecuteType = SECS02P002ExecuteType.GetByID;
            TempModel.USER_ID          = da.DTO.Model.USER_ID = USER_ID;
            da.Select(da.DTO);
            if (da.DTO.Model != null)
            {
                localModel          = da.DTO.Model;
                localModel.APP_CODE = da.DTO.Model.COM_CODE;
                TempModel.COM_CODE  = da.DTO.Model.COM_CODE;
            }

            SetDefaultData(StandardActionName.Edit);

            return(View(StandardActionName.Edit, localModel));
        }
コード例 #15
0
        public ActionResult ViewReport(SECS02P002Model model)
        {
            string ReportName = "J03FWL007R01";

            return(Content("http://" + AppConfigHelper.ReportServerName + "/ReportServer?/" + AppConfigHelper.ReportFolderName + "/" + ReportName + "&rs:Command=Render&rs:Format=HTML4.0&rc:Parameters=false" + "&company_name=AutoAlliance%20(Thailand)%20Co.,Ltd.&user_id=vsmadmin&DateFromHead=21+%e0%b8%98%e0%b8%b1%e0%b8%99%e0%b8%a7%e0%b8%b2%e0%b8%84%e0%b8%a1+2558&DateToHead=25+%e0%b8%98%e0%b8%b1%e0%b8%99%e0%b8%a7%e0%b8%b2%e0%b8%84%e0%b8%a1+2558&error_code=0&WARE_HOUSE_FT=AAT&PE_HID=25&PE_NAME=2015-DEC%20PERIOD%204%20TO%20AAT&PE_START_DATE=2015-12-21&PE_END_DATE=2015-12-25"));
        }