protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {
            this.currentUser = this.store.CurrentUser();

            base.Initialize(requestContext);
        }
示例#2
0
 public System.Web.SessionState.SessionStateBehavior GetControllerSessionBehavior(
     System.Web.Routing.RequestContext requestContext, string controllerName)
 {
     return(SessionStateBehavior.Default);
 }
 protected override void Initialize(System.Web.Routing.RequestContext requestContext)
 {
     base.Initialize(requestContext);
     examUtil = new ExamUtil(this.Session);
 }
 IController IControllerActivator.Create(System.Web.Routing.RequestContext requestContext, Type controllerType)
 {
     return(DependencyResolver.Current.GetService(controllerType) as IController);
 }
示例#5
0
 protected override void Initialize(System.Web.Routing.RequestContext requestContext)
 {
     ViewBag.ApiAddress = ConfigurationManager.AppSettings["ApiAddress"];
     base.Initialize(requestContext);
 }
示例#6
0
        protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {
            Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");

            base.Initialize(requestContext);
        }
 public void InitializeController(System.Web.Routing.RequestContext context)
 {
     base.Initialize(context);
 }
 /// <inheritdoc />
 public System.Web.SessionState.SessionStateBehavior GetControllerSessionBehavior(System.Web.Routing.RequestContext requestContext, string controllerName)
 {
     throw new NotImplementedException();
 }
 protected override void Initialize(System.Web.Routing.RequestContext requestContext)
 {
     base.Initialize(requestContext);
     _repos = new Lazy <CartonAreaEntityRepository>(() => new CartonAreaEntityRepository(requestContext.HttpContext.User.Identity.Name,
                                                                                         requestContext.HttpContext.Request.UserHostName ?? requestContext.HttpContext.Request.UserHostAddress));
 }
示例#10
0
        protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {
            base.Initialize(requestContext);

            _tareasAdmin = new TareasAdmin();
        }
 /// <inheritdoc />
 public System.Web.Mvc.IController CreateController(System.Web.Routing.RequestContext requestContext, string controllerName)
 {
     throw new NotImplementedException();
 }
 public System.Web.SessionState.SessionStateBehavior GetControllerSessionBehavior(System.Web.Routing.RequestContext requestContext, string controllerName)
 {
     return((requestContext.RouteData.Values.TryGetValue("controllerfactory") as IControllerFactory ?? Default).GetControllerSessionBehavior(requestContext, controllerName));
 }
 public IController CreateController(System.Web.Routing.RequestContext requestContext, string controllerName)
 {
     return((requestContext.RouteData.Values.TryGetValue("controllerfactory") as IControllerFactory ?? Default).CreateController(requestContext, controllerName));
 }
        //SecurityUserApplicationBLL oUserApplicationBLL;
        //private IRepository<SecurityUser> rep;
        // private MasterViewModel<SecurityEF.SecurityUser> oModel;
        //private string sModelKey = "oModel";

        protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {
            base.Initialize(requestContext);
            oUserBLL = new SecurityUserBLL();
            //uaBLL = new SecurityUserApplicationBLL();
        }
        protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {
            base.Initialize(requestContext);

            InitLoggedUser();
        }
示例#16
0
        protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {
            base.Initialize(requestContext);

            mappedDirectory = requestContext.HttpContext.Server.MapPath(Constants.FileUploadPath);
        }
示例#17
0
        protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {
            base.Initialize(requestContext);

            string applicationPath = requestContext.HttpContext.Request.ApplicationPath == "/" ? "" : Request.ApplicationPath;


            DataTable dt = SSoft.Data.SqlHelper.SelectTable(@"SELECT * From vw_System_Program", new SqlParameter[] { new SqlParameter("@UserInfo_NO", SSoft.Web.Security.User.Emp_ID) });

            var programList = dt.AsEnumerable().Select(t => new YMIR.Models.Sys.MenuModel
            {
                SystemId     = t.Field <Guid>("SYS_SYSTEMNO_Id"),
                SystemName   = t.Field <string>("SYSNO_NAME"),
                SystemClass  = t.Field <string>("SYS_CLASS"),
                ProgramType  = t.Field <string>("PROGRAMNO_NAME"),
                ProgramId    = t.Field <Guid>("ID"),
                ProgramNo    = t.Field <string>("PRGNO"),
                ProgramName  = t.Field <string>("PROGRAMNO_NAME"),
                ProgramPath  = t.Field <string>("PROG_URL1"),
                ProgarmOrder = t.Field <int>("PROGRAMNO_ORDERID")
            }).ToList();

            this.ProgramList = programList;
            List <DisplayValue> menu = new List <DisplayValue>();
            var systemGroup          = programList.OrderBy(t => t.SystemId).GroupBy(t => new { t.SystemId, t.SystemName, t.SystemClass });
            int index = 0;

            foreach (var g1 in systemGroup)
            {
                DisplayValue sysDisplayValue = new DisplayValue();
                sysDisplayValue.Value    = g1.Key.SystemId.ToString();
                sysDisplayValue.Display  = g1.Key.SystemName.ToString();
                sysDisplayValue.Display1 = "m_" + g1.Key.SystemId.ToString();
                sysDisplayValue.Display2 = "m_" + g1.Key.SystemId.ToString();
                sysDisplayValue.Display3 = "m_" + g1.Key.SystemId.ToString() + " onlink";
                sysDisplayValue.Display4 = g1.Key.SystemClass.ToString();
                sysDisplayValue.Int01    = index++;
                menu.Add(sysDisplayValue);
                sysDisplayValue.ChildDisplayValues = new List <DisplayValue>();

                var programTypeGroup = programList.Where(t => t.SystemId == g1.Key.SystemId).OrderBy(t => t.ProgarmOrder).ThenBy(t => t.ProgramId);

                foreach (var g2 in programTypeGroup)
                {
                    DisplayValue programDisplayValue = new DisplayValue();
                    programDisplayValue.Value    = g2.ProgramId.ToString();
                    programDisplayValue.Display  = g2.ProgramName;
                    programDisplayValue.Display1 = g2.ProgramNo;
                    programDisplayValue.Display2 = applicationPath + "\\" + g2.ProgramNo;
                    sysDisplayValue.ChildDisplayValues.Add(programDisplayValue);
                }

                //var programTypeGroup = programList.Where(t => t.SystemId == g1.Key.SystemId).OrderBy(t => t.ProgarmOrder).ThenBy(t => t.ProgramId).GroupBy(t => new { t.ProgramType });

                //foreach (var g2 in programTypeGroup)
                //{
                //    DisplayValue typeDisplayValue = new DisplayValue();
                //    typeDisplayValue.Value = g2.Key.ProgramType.ToString();
                //    typeDisplayValue.Display = g2.Key.ProgramType.ToString();
                //    sysDisplayValue.ChildDisplayValues.Add(typeDisplayValue);

                //    typeDisplayValue.ChildDisplayValues = new List<DisplayValue>();

                //    var programGroup = programList.Where(t => t.SystemId == g1.Key.SystemId && t.ProgramType == g2.Key.ProgramType).OrderBy(t => t.ProgarmOrder).ThenBy(t => t.ProgramId);

                //    foreach (var g3 in programGroup)
                //    {
                //        DisplayValue programDisplayValue = new DisplayValue();
                //        programDisplayValue.Value = g3.ProgramId.ToString();
                //        programDisplayValue.Display = g3.ProgramName;
                //        programDisplayValue.Display1 = g3.ProgramNo;
                //        programDisplayValue.Display2 = applicationPath + "\\" + g3.ProgramNo;
                //        typeDisplayValue.ChildDisplayValues.Add(programDisplayValue);
                //    }
                //}
            }
            this.ViewBag.MenuModel = menu;



            var findProgram = this.IRF_DB.vw_System_Program.Where(t => t.PRGNO == this.ProgramNo);

            if (findProgram.Count() > 0)
            {
                this.Title = findProgram.First().PROGRAMNO_NAME;// + "--" + SSoft.Web.Security.User.FriendPath;
                if ((this.ViewBag.MenuModel as List <DisplayValue>).Where(t => t.Display == findProgram.First().PROGRAMNO_NAME).Count() > 0)
                {
                    this.MainMenuId = (this.ViewBag.MenuModel as List <DisplayValue>).Where(t => t.Display == findProgram.First().PROGRAMNO_NAME).First().Int01.ToString();
                }
                //this.MainMenuId = (findProgram.First().WUPage_TabId-1).ToString();
                if (this.IRF_DB.vw_System_Program.Where(t => t.PRGNO == this.ProgramNo).Count() > 0)
                {
                    this.ProgramId = this.IRF_DB.vw_System_Program.Where(t => t.PRGNO == this.ProgramNo).First().PROGRAMNO_Id.ToString();
                }
            }



            //here the routedata is available
            string controller_name = ControllerContext.RouteData.Values["Controller"].ToString();

            if (string.IsNullOrWhiteSpace(this.ProgramNo))
            {
                this.ProgramNo = controller_name;
            }
            this.MainMenuId = "0";
            this.IsAllow    = false;
            if (this.ProgramNo.ToUpper() == "HOME")
            {
                this.IsAllow = true;
            }
            else
            {
                if (this.ProgramList != null)
                {
                    if (this.ProgramList.Where(t => t.ProgramNo.ToUpper() == this.ProgramNo.ToUpper()).Count() > 0)
                    {
                        this.IsAllow = true;
                    }
                }
            }
        }
 public IController CreateController(RequestContext requestContext, string controllerName)
 {
     IController controller = Container.Resolve<IController>(controllerName);            
     return controller;
 }
示例#19
0
 protected override void Initialize(System.Web.Routing.RequestContext requestContext)
 {
     SetLastHost(requestContext.HttpContext);
     base.Initialize(requestContext);
 }
 public SessionStateBehavior GetControllerSessionBehavior(RequestContext requestContext, string controllerName)
 {
    return System.Web.SessionState.SessionStateBehavior.Default;
 }
示例#21
0
        ///// <summary>
        ///// Gets the role of user making the request
        ///// </summary>
        //public UserRole? Role
        //{
        //	get
        //	{
        //		UserRole? role = null;
        //		if (HttpContext != null && Session.CurrentUser != null)
        //		{
        //			role = Session.CurrentUser.Role;
        //		}
        //		return role;
        //	}
        //}
        #endregion

        #region Init
        protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {
            base.Initialize(requestContext);

            this.Init();
        }
 protected override IController GetControllerInstance(System.Web.Routing.RequestContext requestContext, Type controllerType)
 {
     return((Controller)Injector.Container.Resolve(controllerType.FullName));
 }
示例#23
0
 protected override void Initialize(System.Web.Routing.RequestContext requestContext)
 {
     ViewBag.User = new Models.User();
     base.Initialize(requestContext);
 }
示例#24
0
 public IEnumerable <ToolbarGroup> GetGroups(System.Web.Routing.RequestContext requestContext)
 {
     return(new ToolbarGroup[0]);
 }
示例#25
0
 protected override void Initialize(System.Web.Routing.RequestContext requestContext)
 {
     base.Initialize(requestContext);
     repo = new TrustTecsRepository(Cust.CustId);
 }
示例#26
0
        //Set User Data
        protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {
            base.Initialize(requestContext);
            if (requestContext.HttpContext != null && requestContext.HttpContext.User != null)
            {
                if (requestContext.HttpContext.User.Identity.IsAuthenticated)
                {
                    var ussserr     = User;
                    var ussserrIden = ussserr.Identity;
                    var ussserrIDD  = ussserrIden.GetUserId();
                    var currentUser = db.Users.Where(f => f.Id == ussserrIDD).FirstOrDefault();
                    if (currentUser != null)
                    {
                        ViewBag.BaseUserFirstName  = currentUser.FirstName;
                        ViewBag.BaseUserLastName   = currentUser.LastName;
                        ViewBag.BaseUserFacebookId = currentUser.FacebookId;
                        if (User.IsInRole("Admin"))
                        {
                            if (Admin.IsServerRenderingVideo() == true)
                            {
                                ViewBag.RenderingVideo = true;
                            }
                            List <FuneralHome> OnlineHomes = Admin.GetOnlineCustomers(db);
                            if (OnlineHomes.Count > 0)
                            {
                                ViewBag.OnlineHomes = OnlineHomes;
                            }
                            List <Service> ServicesInQues = Admin.GetVideosInQue(db);
                            if (ServicesInQues.Count > 0)
                            {
                                ViewBag.ServicesInQue = ServicesInQues;
                            }
                            List <CRMNotification> notifications = new List <CRMNotification>();
                            DateTime tomorrow = DateTime.Now.AddDays(1);
                            List <CRMFuneralHome> homesThatNeedToBeContacted = db.CRMFuneralHome.Where(f => f.NextContactByUserName == currentUser.UserName && f.NextContactDate < tomorrow).ToList();
                            foreach (var home in homesThatNeedToBeContacted)
                            {
                                string iconClass = "fa-phone";
                                if (home.NextContactType == "Email" || home.NextContactType == "email")
                                {
                                    iconClass = "fa-envelope";
                                }
                                string          notificationText = home.NextContactType + " " + home.Name;
                                CRMNotification notification     = new CRMNotification()
                                {
                                    NotifyDate = home.NextContactDate.AddDays(-1),
                                    UserName   = home.NextContactByUserName,
                                    IconClass  = iconClass,
                                    Link       = "/crm/funeralhomehighlight/" + home.Id,
                                    Text       = notificationText
                                };
                                notifications.Add(notification);
                            }
                            ViewBag.Notifications = notifications;

                            //float serverUsage = Admin.getServerUsage();
                        }
                    }
                }
            }
        }
示例#27
0
 protected override IController GetControllerInstance(System.Web.Routing.RequestContext requestContext, Type controllerType)
 {
     return(controllerType == null ? null : (IController)_unityBootStrapper.UnityContainer
            .Resolve(controllerType));
 }
 protected override void Initialize(System.Web.Routing.RequestContext requestContext)
 {
     BaseAddress = "http://" + requestContext.HttpContext.Request.Url.Authority + "/api/";
     base.Initialize(requestContext);
 }
示例#29
0
 /// <summary>
 /// Override Initialize method
 /// </summary>
 /// <param name="requestContext">Request Context</param>
 protected override void Initialize(System.Web.Routing.RequestContext requestContext)
 {
     base.Initialize(requestContext);
     ControllerInternal = new SourceJournalProfileControllerInternal <T>(Context);
 }
示例#30
0
        protected override void Execute(System.Web.Routing.RequestContext requestContext)
        {
            requestContext.HttpContext.Items[HttpContextItemKeys.ThemeFolder] = "Default";

            base.Execute(requestContext);
        }
示例#31
0
 protected override IController GetControllerInstance(System.Web.Routing.RequestContext requestContext, Type controllerType)
 {
     return(controllerType == null ? null : (IController)ninjectKernel.Get(controllerType));
 }
示例#32
0
 /// <summary>
 /// Initializes data that might not be available when the constructor is called.
 /// </summary>
 /// <param name="requestContext">The HTTP context and route data.</param>
 protected override void Initialize(System.Web.Routing.RequestContext requestContext)
 {
     this._mSwTime.Start();
     base.Initialize(requestContext);
     this.WriteStatisc("Initialize", this.RouteData.Values.FirstOrDefault().Value.ToString());
 }