コード例 #1
0
        //
        // GET: /SignIn/
        public ActionResult Index(string ReturnUrl)
        {
            if (ReturnUrl == "Sessionexpire")
            {
                ViewBag.LoginError = "Session Expire";
            }
            SignIn Model = new Models.SignIn();

            return(View("SignIn", Model));
        }
コード例 #2
0
        //
        // GET: /SignIn/
        public ActionResult Index(string ReturnUrl)
        {
            SessionMangment.Users_.APIHostUrl = System.Configuration.ConfigurationManager.AppSettings["APIHostUrl"];
            if (ReturnUrl == "Sessionexpire")
            {
                ViewBag.LoginError = "Session Expire";
            }
            SignIn Model = new Models.SignIn();

            return(View("SignIn", Model));
        }
コード例 #3
0
        public ActionResult ValidateUser(string UserEmail)
        {
            SignIn Model = new Models.SignIn();

            Model.UserName = UserEmail;
            SessionMangment.Users_.APIHostUrl = System.Configuration.ConfigurationManager.AppSettings["APIHostUrl"];
            var           Data  = TelerikMvcWebMail.Common.CallWebApi("api/ApiHome/ValidateUser", RestSharp.Method.POST, Model);
            UserViewModel _User = new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize <UserViewModel>(Data);

            if (_User == null)
            {
                return(RedirectToAction("Index", "Home", new { ReturnUrl = "UserNameInvalid" }));
            }
            else
            {
                SessionMangment.Users_.FullName  = _User.FirstName + " " + _User.LastName;
                SessionMangment.Users_.UserEmail = _User.Email;
                SessionMangment.Users_.UserId    = _User.id.ToString();
                return(RedirectToAction("Index", "File"));
            }
        }