/*<ControllerActionImplementation:SignIn:1/>*/
 public ActionResult ExecuteSignIn()
 {
     ActionResult _result = null;
     bool success = zAppDev.DotNet.Framework.Identity.IdentityHelper.SignIn(@model.UserNameTextBox, @model.PasswordTextBox, @model.RememberMeCB);
     if (((success) == false))
     {
         ClientCommand(ClientCommands.SHOW_MESSAGE, BaseViewPage<string>.GetResourceValue("SignInPage", "SignInFailed").ToString(), MessageType.Error);
         return null;
     }
     zAppDev.DotNet.Framework.Identity.Model.ApplicationUser appUser = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable<zAppDev.DotNet.Framework.Identity.Model.ApplicationUser>((ap) => ap.UserName == @model.UserNameTextBox)?.FirstOrDefault();
     if ((appUser != null))
     {
         if (((((appUser?.EmailConfirmed ?? false)) == false)))
         {
             zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "SignInPage",  DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "email confirm");
             zAppDev.DotNet.Framework.Identity.IdentityHelper.SignOut();
             ClientCommand(ClientCommands.SHOW_MESSAGE, "Please verify your Email first.", MessageType.Error);
             @model.ShowConfirmEmail = true;
             return null;
         }
     }
     string returnUrl = zAppDev.DotNet.Framework.Utilities.Web.GetFormArgument("returnUrl");
     if (((((returnUrl == null || returnUrl.Trim() == "")) == false)))
     {
         ClientCommand(ClientCommands.REDIRECT, (!string.IsNullOrEmpty(ConfigurationHandler.GetAppSetting("ServerExternalPath")) ? ConfigurationHandler.GetAppSetting("ServerExternalPath"): zAppDev.DotNet.Framework.Utilities.Web.GetApplicationPathUri(false)) +returnUrl);
     }
     else
     {
         _result = GetRedirectInfo("HomePage", "Render", new  RouteValueDictionary(new {  }));
     }
     return _result;
 }
示例#2
0
        private static int _GetCommandTimeout(int?timeOut = null)
        {
            if (timeOut.HasValue && timeOut.Value > -1)
            {
                return(timeOut.Value);
            }
#if NETFRAMEWORK
            var timeoutParam = System.Configuration.ConfigurationManager.AppSettings["SQLQueryTimeoutInSeconds"];
#else
            var timeoutParam = ConfigurationHandler.GetAppSetting("SQLQueryTimeoutInSeconds");
#endif

            return(int.TryParse(timeoutParam, out var commandTimeout) ? commandTimeout : 30);
        }
示例#3
0
        /*<ControllerActionImplementation:SignIn:1/>*/
        public ActionResult ExecuteSignIn()
        {
            ActionResult _result = null;
            bool         success = zAppDev.DotNet.Framework.Identity.IdentityHelper.SignIn(@model.UserNameTextBox, @model.PasswordTextBox, @model.RememberMeCB);

            if (((success) == false))
            {
                ClientCommand(ClientCommands.SHOW_MESSAGE, BaseViewPage <string> .GetResourceValue("SignInPage", "SignInFailed").ToString(), MessageType.Error);
                return(null);
            }
            string returnUrl = zAppDev.DotNet.Framework.Utilities.Web.GetFormArgument("returnUrl");

            if (((((returnUrl == null || returnUrl.Trim() == "")) == false)))
            {
                ClientCommand(ClientCommands.REDIRECT, (!string.IsNullOrEmpty(ConfigurationHandler.GetAppSetting("ServerExternalPath")) ? ConfigurationHandler.GetAppSetting("ServerExternalPath"): zAppDev.DotNet.Framework.Utilities.Web.GetApplicationPathUri(false)) + returnUrl);
            }
            else
            {
                _result = GetRedirectInfo("HomePage", "Render", new  RouteValueDictionary(new {  }));
            }
            return(_result);
        }
        /*<ControllerActionImplementation:SignIn:1/>*/
        public ActionResult ExecuteSignIn()
        {
            ActionResult _result = null;
            bool         success = zAppDev.DotNet.Framework.Identity.IdentityHelper.SignIn(@model.UserNameTextBox, @model.PasswordTextBox, @model.RememberMeCB);

            if (((success) == false))
            {
                ClientCommand(ClientCommands.SHOW_MESSAGE, BaseViewPage <string> .GetResourceValue("SignInPage", "SignInFailed").ToString(), MessageType.Error);
                return(null);
            }
            string returnUrl = zAppDev.DotNet.Framework.Utilities.Web.GetFormArgument("returnUrl");

            zAppDev.DotNet.Framework.Identity.Model.ApplicationUser user = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().GetAsQueryable <zAppDev.DotNet.Framework.Identity.Model.ApplicationUser>((a) => a.UserName == @model.UserNameTextBox)?.FirstOrDefault();
            if (((((returnUrl == null || returnUrl.Trim() == "")) == false)))
            {
                ClientCommand(ClientCommands.REDIRECT, (!string.IsNullOrEmpty(ConfigurationHandler.GetAppSetting("ServerExternalPath")) ? ConfigurationHandler.GetAppSetting("ServerExternalPath"): zAppDev.DotNet.Framework.Utilities.Web.GetApplicationPathUri(false)) + returnUrl);
            }
            else
            {
                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "SignInPage", DSS1_RetailerDriverStockOptimisation.Hubs.EventsHub.RaiseDebugMessage, user == null);
                if (((user?.HasPermission("IsStockManager") ?? false)))
                {
                    zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "SignInPage", DSS1_RetailerDriverStockOptimisation.Hubs.EventsHub.RaiseDebugMessage, "IsStockManager");
                    _result = GetRedirectInfo("StockManagerView", "Render", new  RouteValueDictionary(new {  }));
                }
                else if ((user?.IsInRole("Supplier") ?? false))
                {
                    zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "SignInPage", DSS1_RetailerDriverStockOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Supplier");
                    _result = GetRedirectInfo("SupplierView", "Render", new  RouteValueDictionary(new {  }));
                }
                else
                {
                    zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "SignInPage", DSS1_RetailerDriverStockOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Normal");
                    _result = GetRedirectInfo("StockManagerView", "Render", new  RouteValueDictionary(new {  }));
                }
            }
            return(_result);
        }