Exemplo n.º 1
0
        public void SetStatus(long idDashboard, AvailableStatus status, DashboardType type, Int32 idCommunity, Boolean loadFromRecycleBin, OrderSettingsBy orderBy, Boolean ascending)
        {
            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout();
            }
            else
            {
                ModuleDashboard.ActionType action = (status == AvailableStatus.Available) ? ModuleDashboard.ActionType.DashboardSettingsEnable : ModuleDashboard.ActionType.DashboardSettingsDisable;
                try
                {
                    DashboardSettings item = Service.DashboardSettingsSetStatus(idDashboard, status);
                    if (item == null || item.Status != status)
                    {
                        action = (status == AvailableStatus.Available) ? ModuleDashboard.ActionType.DashboardSettingsUnableToEnable : ModuleDashboard.ActionType.DashboardSettingsUnableToDisable;
                    }
                    View.DisplayMessage(action);
                    View.SendUserAction(idCommunity, CurrentIdModule, idDashboard, action);
                }
                catch (DashboardException ex) {
                    action = (status == AvailableStatus.Available) ? ModuleDashboard.ActionType.DashboardSettingsUnableToEnable : ModuleDashboard.ActionType.DashboardSettingsUnableToDisable;
                    View.SendUserAction(idCommunity, CurrentIdModule, idDashboard, action);
                    View.DisplayMessage(ex.ErrorType);
                }

                LoadSettings(type, idCommunity, loadFromRecycleBin, orderBy, ascending);
            }
        }
Exemplo n.º 2
0
        public void FocusKeywordProperty_OnSet_SetsTheValueToNull()
        {
            var dashboardSettings = new DashboardSettings();

            dashboardSettings.FocusKeyword = null;
            Assert.IsNull(dashboardSettings.FocusKeyword);
        }
Exemplo n.º 3
0
        public void FocusKeywordProperty_OnSet_SetsTheValue()
        {
            var dashboardSettings = new DashboardSettings();

            dashboardSettings.FocusKeyword = "focus";
            Assert.AreEqual("focus", dashboardSettings.FocusKeyword);
        }
Exemplo n.º 4
0
 public void VirtualDelete(long idDashboard, Boolean delete, DashboardType type, Int32 idCommunity, Boolean loadFromRecycleBin, OrderSettingsBy orderBy, Boolean ascending)
 {
     if (UserContext.isAnonymous)
     {
         View.DisplaySessionTimeout();
     }
     else
     {
         ModuleDashboard.ActionType action = (delete) ? ModuleDashboard.ActionType.DashboardSettingsVirtualDelete : ModuleDashboard.ActionType.DashboardSettingsVirtualUndelete;
         try
         {
             DashboardSettings item = Service.DashboardSettingsVirtualDelete(idDashboard, delete);
             if (item == null)
             {
                 action = (delete) ? ModuleDashboard.ActionType.DashboardSettingsUnableToVirtualDelete : ModuleDashboard.ActionType.DashboardSettingsUnableToUndelete;
             }
             View.DisplayMessage(action);
             View.SendUserAction(idCommunity, CurrentIdModule, idDashboard, action);
         }
         catch (DashboardException ex)
         {
             action = (delete) ? ModuleDashboard.ActionType.DashboardSettingsUnableToVirtualDelete : ModuleDashboard.ActionType.DashboardSettingsUnableToUndelete;
             View.SendUserAction(idCommunity, CurrentIdModule, idDashboard, action);
             View.DisplayMessage(ex.ErrorType);
         }
         LoadSettings(type, idCommunity, loadFromRecycleBin, orderBy, ascending);
     }
 }
Exemplo n.º 5
0
 public WmiDataProvider(DashboardSettings.Provider provider)
     : base(provider)
 {
     _config = Current.Settings.GetSettings<WmiProviderSettings>();
     _wmiNodes = InitNodeList(_config.Nodes).OrderBy(x => x.OriginalName).ToList();
     _config.Changed += OnConfigChanged;
 }
Exemplo n.º 6
0
 public void SaveSettings(dtoBaseDashboardSettings dto)
 {
     if (UserContext.isAnonymous)
     {
         View.DisplaySessionTimeout();
     }
     else
     {
         String url = "";
         ModuleDashboard.ActionType action   = (dto.Id == 0) ? ModuleDashboard.ActionType.DashboardSettingsUnableToAdd : ModuleDashboard.ActionType.DashboardSettingsUnableToSave;
         DashboardSettings          settings = (dto.Id > 0) ? CurrentManager.Get <DashboardSettings>(dto.Id) : null;
         if (dto.Id > 0 && settings == null)
         {
             View.DisplayDeletedDashboard();
             View.SendUserAction(dto.IdCommunity, CurrentIdModule, dto.Id, action);
             lm.Comol.Core.DomainModel.Helpers.CacheHelper.PurgeCacheItems(CacheKeys.AllDashboard);
             return;
         }
         else if (settings != null && settings.Active && !dto.ForAll && dto.Assignments.Count == 0)
         {
             View.DisplayMessage(DashboardErrorType.NoAssignmentsForActiveSettings);
         }
         else
         {
             try
             {
                 DashboardSettings item = Service.SaveBaseSettings(dto);
                 if (item != null)
                 {
                     action = (dto.Id > 0) ? ModuleDashboard.ActionType.DashboardSettingsSaved : ModuleDashboard.ActionType.DashboardSettingsAdded;
                     if (action == ModuleDashboard.ActionType.DashboardSettingsAdded)
                     {
                         url = RootObject.DashboardEdit(item.Id, item.Type, dto.IdCommunity, true);
                     }
                     else
                     {
                         View.EnableSelector(!item.ForAll);
                     }
                 }
                 View.DisplayMessage(action);
                 lm.Comol.Core.DomainModel.Helpers.CacheHelper.PurgeCacheItems(CacheKeys.AllDashboard);
             }
             catch (DashboardException ex)
             {
                 View.DisplayMessage(ex.ErrorType);
             }
         }
         View.SendUserAction(dto.IdCommunity, CurrentIdModule, dto.Id, action);
         if (!String.IsNullOrEmpty(url))
         {
             View.RedirectToUrl(url);
         }
         else if (action == ModuleDashboard.ActionType.DashboardSettingsSaved)
         {
             View.LoadWizardSteps(Service.GetAvailableSteps(WizardDashboardStep.Settings, settings.Id, settings.Type, View.IdContainerCommunity));
         }
     }
 }
        public IActionResult Index2()
        {
            var dashboardSettings = new DashboardSettings();

            configuration.Bind("DashboardSettings", dashboardSettings);

            //requires using Newtonsoft.Json
            return(Content(JsonConvert.SerializeObject(dashboardSettings)));
        }
Exemplo n.º 8
0
        private void btnSettings_Click(object sender, EventArgs e)
        {
            DashboardSettings settings = new DashboardSettings(this);

            System.Threading.Thread.Sleep(300);
            bodyPanel.Controls.Add(settings);
            settings.Show();
            settings.BringToFront();
        }
Exemplo n.º 9
0
        public void SaveViews(long idDashboard, dtoViewSettings dto)
        {
            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout();
            }
            else
            {
                ModuleDashboard.ActionType action = ModuleDashboard.ActionType.DashboardSettingsViewsUnableToSave;
                if (dto.Pages.Count > 0 && dto.Pages.Where(p => p.Type != DashboardViewType.Combined && p.Type != DashboardViewType.Tile && !p.Range.IsValid(p.MaxItems)).Any())
                {
                    View.DisplayRangeError(dto, dto.Pages.Where(p => p.Type != DashboardViewType.Combined && p.Type != DashboardViewType.Tile && !p.Range.IsValid(p.MaxItems)).Select(p => p).ToList());
                }
                else if (!dto.Pages.Where(p => p.Type != DashboardViewType.Search && p.Type != DashboardViewType.Subscribe).Any())
                {
                    View.DisplayNoPageError();
                }
                else if (dto.Pages.Where(p => p.Type == DashboardViewType.Tile).Any() && dto.Pages.Where(p => p.Type == DashboardViewType.Tile && !dto.Pages.Where(d => d.Type == p.TileRedirectOn).Any()).Any())
                {
                    View.DisplayTileUnableToRedirectOn();
                }
                else
                {
                    DashboardSettings settings = CurrentManager.Get <DashboardSettings>(idDashboard);
                    if (settings == null)
                    {
                        View.DisplayDeletedDashboard();
                        View.SendUserAction(View.IdContainerCommunity, CurrentIdModule, idDashboard, action);
                        return;
                    }
                    else
                    {
                        try
                        {
                            DashboardSettings item = Service.SaveViewSettings(settings, dto);
                            if (item != null)
                            {
                                action = ModuleDashboard.ActionType.DashboardSettingsViewsSaved;
                                View.LoadWizardSteps(Service.GetAvailableSteps(WizardDashboardStep.HomepageSettings, idDashboard, item.Type, View.IdContainerCommunity));
                            }

                            //Per aggiornare gli switch...
                            InitView(View.PreloadIdDashboard, View.DashboardType, View.IdContainerCommunity, false);

                            View.DisplayMessage(action);
                        }
                        catch (DashboardException ex)
                        {
                            View.DisplayMessage(ex.ErrorType);
                        }
                    }
                }
                View.SendUserAction(View.IdContainerCommunity, CurrentIdModule, idDashboard, action);
            }
        }
Exemplo n.º 10
0
        public static void Initialize(DashboardSettings settings)
        {
            SiteTitle          = settings.SiteTitle;
            MonoscapeAccessKey = settings.MonoscapeAccessKey;
            MonoscapeSecretKey = settings.MonoscapeSecretKey;

            ApplicationGridEndPointURL = settings.ApplicationGridEndPointURL;
            LoadBalancerEndPointURL    = settings.LoadBalancerEndPointURL;
            FileServerEndPointURL      = settings.FileServerEndPointURL;
            CloudControllerEndPointURL = settings.CloudControllerEndPointURL;

            ApFileTransferSocketPort = settings.ApFileTransferSocketPort;
        }
Exemplo n.º 11
0
    public string[] GetDashboards_MainViewPage(string s)
    {
        this.InitializeCulture();

        string[] retMessage = new string[4];

        try
        {
            DashboardSettings    dashboardSetting    = UserSettingBusiness.GetDashboardSetting();
            DashboardSettingsObj dashboardSettingObj = new DashboardSettingsObj();

            if (dashboardSetting.Dashboard1 != null)
            {
                dashboardSettingObj.DashboardName1 = dashboardSetting.Dashboard1.Name;
            }
            if (dashboardSetting.Dashboard2 != null)
            {
                dashboardSettingObj.DashboardName2 = dashboardSetting.Dashboard2.Name;
            }
            if (dashboardSetting.Dashboard3 != null)
            {
                dashboardSettingObj.DashboardName3 = dashboardSetting.Dashboard3.Name;
            }
            if (dashboardSetting.Dashboard4 != null)
            {
                dashboardSettingObj.DashboardName4 = dashboardSetting.Dashboard4.Name;
            }
            retMessage[0] = GetLocalResourceObject("RetSuccessType").ToString();
            retMessage[1] = GetLocalResourceObject("OperationCompleted").ToString();
            retMessage[2] = "success";
            retMessage[3] = this.JsSerializer.Serialize(dashboardSettingObj);
            return(retMessage);
        }
        catch (UIValidationExceptions ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage);
            return(retMessage);
        }
        catch (UIBaseException ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage);
            return(retMessage);
        }
        catch (Exception ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage);
            return(retMessage);
        }
    }
Exemplo n.º 12
0
        public ActionResult Index()
        {
            var tasks = UserTasks.GetUserTask(UserID);

            var dashboard = new DashboardSettings
            {
                SiteUsers = IdentityDbContext.Entity.Users.Count(),
                Orders    = Carts.OrdersCount(),
                NewOrders = Carts.NewOrdersCount(),
                //TODO میزان سود محاسبه شود
                Profit = 34500.ToPrice("{0}"),
                Tasks  = tasks
            };

            return(View(dashboard));
        }
Exemplo n.º 13
0
        internal static void Initialize(MvcApplication mvcApplication)
        {
            AppSettingsReader reader   = new AppSettingsReader();
            DashboardSettings settings = new DashboardSettings();

            settings.SiteTitle                  = (string)reader.GetValue("SiteTitle", typeof(string));
            settings.MonoscapeAccessKey         = (string)reader.GetValue("MonoscapeAccessKey", typeof(string));
            settings.MonoscapeSecretKey         = (string)reader.GetValue("MonoscapeSecretKey", typeof(string));
            settings.ApplicationGridEndPointURL = (string)reader.GetValue("ApplicationGridEndPointURL", typeof(string));
            settings.FileServerEndPointURL      = (string)reader.GetValue("FileServerEndPointURL", typeof(string));
            settings.LoadBalancerEndPointURL    = (string)reader.GetValue("LoadBalancerEndPointURL", typeof(string));
            settings.CloudControllerEndPointURL = (string)reader.GetValue("CloudControllerEndPointURL", typeof(string));
            settings.ApFileTransferSocketPort   = (int)reader.GetValue("ApFileTransferSocketPort", typeof(int));

            Settings.Initialize(settings);
        }
Exemplo n.º 14
0
 public void Clone(long idDashboard, String cloneOf, DashboardType type, Int32 idCommunity, Boolean loadFromRecycleBin, OrderSettingsBy orderBy, Boolean ascending)
 {
     if (UserContext.isAnonymous)
     {
         View.DisplaySessionTimeout();
     }
     else
     {
         ModuleDashboard.ActionType action = ModuleDashboard.ActionType.DashboardSettingsClone;
         DashboardSettings          item   = Service.DashboardSettingsClone(idDashboard, cloneOf);
         if (item == null)
         {
             action = ModuleDashboard.ActionType.DashboardSettingsUnableToClone;
         }
         View.DisplayMessage(action);
         View.SendUserAction(idCommunity, CurrentIdModule, idDashboard, action);
         LoadSettings(type, idCommunity, loadFromRecycleBin, orderBy, ascending);
     }
 }
Exemplo n.º 15
0
        public DashboarQueryConsumer(ILogger log, IFlightControl flightControl, IHubContext <DashboardQueryHub> hubContext, IConfiguration configuration)
        {
            Log                       = log;
            FlightControl             = flightControl;
            Configuration             = configuration;
            Settings                  = Configuration.GetSection("DashboardSettings").Get <DashboardSettings>();
            DashBoardGw               = EndpointAddress.Create(Settings.DashboardgatewayQueue);
            _dashboardQueryHubContext = hubContext;
            #region Set_Handler_chain

            _barChart  = new BarChart();
            _lineChart = new LineChart();
            _pieChart  = new PieChart();
            _simplePie = new SimplePie();

            _barChart.SetSuccessor(_lineChart);
            _lineChart.SetSuccessor(_pieChart);
            _lineChart.SetSuccessor(_simplePie);

            #endregion
        }
Exemplo n.º 16
0
        public long GetTileDisplayOrder(long idTile, DashboardSettings dashboard, TileType type)
        {
            long result        = -1;
            long tDisplayOrder = (idTile <= 0) ? 0 : (from t in Manager.GetIQ <liteDashboardTileAssignment>()
                                                      where t.Deleted == BaseStatusDeleted.None && t.IdDashboard == dashboard.Id && idTile > 0 && t.Tile != null && t.Tile.Id == idTile select t.DisplayOrder).Skip(0).Take(1).ToList().FirstOrDefault();

            if (tDisplayOrder == 0)
            {
                var query = (from t in Manager.GetIQ <liteDashboardTileAssignment>()
                             where t.Deleted == BaseStatusDeleted.None && t.IdDashboard == dashboard.Id && t.Tile != null
                             select t);
                switch (dashboard.Type)
                {
                case DashboardType.AllCommunities:
                case DashboardType.Community:
                    break;

                case DashboardType.Portal:
                    switch (type)
                    {
                    case TileType.CommunityType:
                        query = query.Where(t => t.Tile.Type == type);
                        break;

                    default:
                        query = query.Where(t => t.Tile.Type != TileType.CommunityType);
                        break;
                    }
                    break;
                }
                return(query.Select(t => t.DisplayOrder).Max());
            }
            else
            {
                result = tDisplayOrder;
            }
            return(result);
        }
Exemplo n.º 17
0
    public string[] UpdateSettings_UserSettingsPage(string caller, string settingsState, string personnelLoadState, string personnelCountState, string PersonnelID, string PersonnelSearchTerms, string SettingsTerms)
    {
        this.InitializeCulture();

        string[]            retMessage    = new string[4];
        Caller              settingCaller = (Caller)Enum.Parse(typeof(Caller), this.StringBuilder.CreateString(caller));
        SettingsState       SS            = (SettingsState)Enum.Parse(typeof(SettingsState), this.StringBuilder.CreateString(settingsState));
        LoadState           PLS           = (LoadState)Enum.Parse(typeof(LoadState), this.StringBuilder.CreateString(personnelLoadState));
        PersonnelCountState PCS           = (PersonnelCountState)Enum.Parse(typeof(PersonnelCountState), this.StringBuilder.CreateString(personnelCountState));
        decimal             personnelID   = decimal.Parse(this.StringBuilder.CreateString(PersonnelID), CultureInfo.InvariantCulture);

        PersonnelSearchTerms = this.StringBuilder.CreateString(PersonnelSearchTerms);
        SettingsTerms        = this.StringBuilder.CreateString(SettingsTerms);


        try
        {
            AttackDefender.CSRFDefender(this.Page);
            switch (SS)
            {
            case SettingsState.EmailSMS:
                EmailSMSSettingsObj emailSMSSettingsObj = this.JsSerializer.Deserialize <EmailSMSSettingsObj>(SettingsTerms);
                bool IsSendEmail = bool.Parse(emailSMSSettingsObj.IsSendEmail);
                bool IsSendSMS   = bool.Parse(emailSMSSettingsObj.IsSendSMS);
                EmailSMSTransferState SendEmailState = (EmailSMSTransferState)Enum.Parse(typeof(EmailSMSTransferState), emailSMSSettingsObj.SendEmailState);
                EmailSMSTransferState SendSMSState   = (EmailSMSTransferState)Enum.Parse(typeof(EmailSMSTransferState), emailSMSSettingsObj.SendSMSState);
                int    EmailDay        = int.Parse(emailSMSSettingsObj.DailyEmailDay, CultureInfo.InvariantCulture);
                string DailyEmailTime  = emailSMSSettingsObj.DailyEmailHour + ":" + emailSMSSettingsObj.DailyEmailMinute;
                string HourlyEmailTime = emailSMSSettingsObj.HourlyEmailHour + ":" + emailSMSSettingsObj.HourlyEmailMinute;
                int    SMSDay          = int.Parse(emailSMSSettingsObj.DailySMSDay, CultureInfo.InvariantCulture);
                string DailySMSTime    = emailSMSSettingsObj.DailySMSHour + ":" + emailSMSSettingsObj.DailySMSMinute;
                string HourlySMSTime   = emailSMSSettingsObj.HourlySMSHour + ":" + emailSMSSettingsObj.HourlySMSMinute;

                EmailSettings emailSettings = new EmailSettings();
                emailSettings.Active = IsSendEmail;
                switch (SendEmailState)
                {
                case EmailSMSTransferState.Daily:
                    emailSettings.SendByDay = true;
                    break;

                case EmailSMSTransferState.Hourly:
                    emailSettings.SendByDay = false;
                    break;
                }
                emailSettings.DayCount   = EmailDay;
                emailSettings.TheDayHour = DailyEmailTime;
                emailSettings.TheHour    = HourlyEmailTime;

                SMSSettings smsSettings = new SMSSettings();
                smsSettings.Active = IsSendSMS;
                switch (SendSMSState)
                {
                case EmailSMSTransferState.Daily:
                    smsSettings.SendByDay = true;
                    break;

                case EmailSMSTransferState.Hourly:
                    smsSettings.SendByDay = false;
                    break;
                }
                smsSettings.DayCount   = SMSDay;
                smsSettings.TheDayHour = DailySMSTime;
                smsSettings.TheHour    = HourlySMSTime;


                switch (PCS)
                {
                case PersonnelCountState.Single:
                    switch (settingCaller)
                    {
                    case Caller.Personal:
                        this.UserSettingsBusiness.SaveEmailSetting(emailSettings);
                        this.UserSettingsBusiness.SaveSMSSetting(smsSettings);
                        break;

                    case Caller.Management:
                        this.UserSettingsBusiness.SaveEmailSetting(emailSettings, personnelID);
                        this.UserSettingsBusiness.SaveSMSSetting(smsSettings, personnelID);
                        break;

                    default:
                        break;
                    }
                    break;

                case PersonnelCountState.Group:
                    switch (PLS)
                    {
                    case LoadState.Normal:
                        this.UserSettingsBusiness.SaveEmailSetting(emailSettings, personnelID);
                        this.UserSettingsBusiness.SaveSMSSetting(smsSettings, personnelID);
                        break;

                    case LoadState.Search:
                        this.UserSettingsBusiness.SaveEmailSetting(emailSettings, PersonnelSearchTerms);
                        this.UserSettingsBusiness.SaveSMSSetting(smsSettings, PersonnelSearchTerms);
                        break;

                    case LoadState.AdvancedSearch:
                        this.UserSettingsBusiness.SaveEmailSetting(emailSettings, this.APSProv.CreateAdvancedPersonnelSearchProxy(PersonnelSearchTerms));
                        this.UserSettingsBusiness.SaveSMSSetting(smsSettings, this.APSProv.CreateAdvancedPersonnelSearchProxy(PersonnelSearchTerms));
                        break;
                    }
                    break;
                }
                break;

            case SettingsState.Dashboard:
                DashboardSettingsObj dashboardSettingsObj = this.JsSerializer.Deserialize <DashboardSettingsObj>(SettingsTerms);
                IList <Dashboards>   dashboardList        = DashboardBusiness.GetAll();

                decimal dashboardID1 = dashboardSettingsObj.DashboardID1 == "" ? 0 : Convert.ToDecimal(dashboardSettingsObj.DashboardID1, CultureInfo.InvariantCulture);
                decimal dashboardID2 = dashboardSettingsObj.DashboardID2 == "" ? 0 : Convert.ToDecimal(dashboardSettingsObj.DashboardID2, CultureInfo.InvariantCulture);
                decimal dashboardID3 = dashboardSettingsObj.DashboardID3 == "" ? 0 : Convert.ToDecimal(dashboardSettingsObj.DashboardID3, CultureInfo.InvariantCulture);
                decimal dashboardID4 = dashboardSettingsObj.DashboardID4 == "" ? 0 : Convert.ToDecimal(dashboardSettingsObj.DashboardID4, CultureInfo.InvariantCulture);

                DashboardSettings dashboardObj = new DashboardSettings();
                dashboardObj.Dashboard1 = dashboardList.SingleOrDefault(d => d.ID == dashboardID1);
                dashboardObj.Dashboard2 = dashboardList.SingleOrDefault(d => d.ID == dashboardID2);
                dashboardObj.Dashboard3 = dashboardList.SingleOrDefault(d => d.ID == dashboardID3);
                dashboardObj.Dashboard4 = dashboardList.SingleOrDefault(d => d.ID == dashboardID4);

                switch (PCS)
                {
                case PersonnelCountState.Single:
                    switch (settingCaller)
                    {
                    case Caller.Personal:
                        this.UserSettingsBusiness.SaveDashboardSetting(dashboardObj);

                        break;

                    case Caller.Management:
                        this.UserSettingsBusiness.SaveDashboardSetting(dashboardObj, personnelID);

                        break;

                    default:
                        break;
                    }
                    break;

                case PersonnelCountState.Group:
                    switch (PLS)
                    {
                    case LoadState.Normal:
                        this.UserSettingsBusiness.SaveDashboardSetting(dashboardObj, personnelID);

                        break;

                    case LoadState.Search:
                        this.UserSettingsBusiness.SaveDashboardSetting(dashboardObj, PersonnelSearchTerms);

                        break;

                    case LoadState.AdvancedSearch:
                        this.UserSettingsBusiness.SaveDashboardSetting(dashboardObj, this.APSProv.CreateAdvancedPersonnelSearchProxy(PersonnelSearchTerms));

                        break;
                    }
                    break;
                }
                break;

            case SettingsState.CollectiveRequestRegistType:
                OperatorCollectiveRequestRegistType operatorCollectiveRequestTypeObj = this.JsSerializer.Deserialize <OperatorCollectiveRequestRegistType>(SettingsTerms);
                CollectiveRequestRegistType         collectiveRequestRegistTypeObj   = (CollectiveRequestRegistType)Enum.Parse(typeof(CollectiveRequestRegistType), operatorCollectiveRequestTypeObj.CollectiveRequestRegistType);

                switch (PCS)
                {
                case PersonnelCountState.Single:
                    switch (settingCaller)
                    {
                    case Caller.Personal:
                        this.UserSettingsBusiness.SaveOperatorCollectiveRequestRegistType(collectiveRequestRegistTypeObj);

                        break;

                    case Caller.Management:
                        this.UserSettingsBusiness.SaveOperatorCollectiveRequestRegistType(collectiveRequestRegistTypeObj, personnelID);

                        break;

                    default:
                        break;
                    }
                    break;

                case PersonnelCountState.Group:
                    switch (PLS)
                    {
                    case LoadState.Normal:
                        this.UserSettingsBusiness.SaveOperatorCollectiveRequestRegistType(collectiveRequestRegistTypeObj, personnelID);

                        break;

                    case LoadState.Search:
                        this.UserSettingsBusiness.SaveOperatorCollectiveRequestRegistType(collectiveRequestRegistTypeObj, PersonnelSearchTerms);

                        break;

                    case LoadState.AdvancedSearch:
                        this.UserSettingsBusiness.SaveOperatorCollectiveRequestRegistType(collectiveRequestRegistTypeObj, this.APSProv.CreateAdvancedPersonnelSearchProxy(PersonnelSearchTerms));

                        break;
                    }
                    break;
                }
                break;
            }
            retMessage[0] = GetLocalResourceObject("RetSuccessType").ToString();
            retMessage[1] = GetLocalResourceObject("OperationCompleted").ToString();
            retMessage[2] = "success";
            retMessage[3] = SS.ToString();
            return(retMessage);
        }
        catch (UIValidationExceptions ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage);
            return(retMessage);
        }
        catch (UIBaseException ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage);
            return(retMessage);
        }
        catch (Exception ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage);
            return(retMessage);
        }
    }
Exemplo n.º 18
0
    public string[] GetSettings_UserSettingsPage(string caller, string PersonnelID)
    {
        this.InitializeCulture();

        string[] retMessage = new string[4];

        Caller        SettingsCaller       = (Caller)Enum.Parse(typeof(Caller), this.StringBuilder.CreateString(caller));
        decimal       personnelID          = decimal.Parse(this.StringBuilder.CreateString(PersonnelID), CultureInfo.InvariantCulture);
        List <object> SettingsBatchObjList = new List <object>();

        try
        {
            AttackDefender.CSRFDefender(this.Page);
            EmailSettings       emailSettings        = null;
            SMSSettings         smsSettings          = null;
            DashboardSettings   dashboardSettingsObj = null;
            EmailSMSSettingsObj emailSMSSettingsObj  = new EmailSMSSettingsObj();
            emailSMSSettingsObj.SettingType = "EmailSMS";
            CollectiveRequestRegistType collectiveRequestRegistTypeObj = CollectiveRequestRegistType.Business;
            switch (SettingsCaller)
            {
            case Caller.Personal:
                emailSettings                  = this.UserSettingsBusiness.GetEmailSetting();
                smsSettings                    = this.UserSettingsBusiness.GetSMSSetting();
                dashboardSettingsObj           = this.UserSettingsBusiness.GetDashboardSetting();
                collectiveRequestRegistTypeObj = this.UserSettingsBusiness.GetOperatorCollectiveRequestRegistTypeSetting();
                break;

            case Caller.Management:
                if (personnelID != 0)
                {
                    emailSettings                  = this.UserSettingsBusiness.GetEmailSetting(personnelID);
                    smsSettings                    = this.UserSettingsBusiness.GetSMSSetting(personnelID);
                    dashboardSettingsObj           = this.UserSettingsBusiness.GetDashboardSetting(personnelID);
                    collectiveRequestRegistTypeObj = this.UserSettingsBusiness.GetOperatorCollectiveRequestRegistTypeSetting(personnelID);
                }
                break;
            }

            emailSMSSettingsObj.IsSendEmail = emailSettings != null?emailSettings.Active.ToString().ToLower() : false.ToString().ToLower();

            emailSMSSettingsObj.SendEmailState = emailSettings != null?emailSettings.SendByDay?EmailSMSTransferState.Daily.ToString() : EmailSMSTransferState.Hourly.ToString() : EmailSMSTransferState.Daily.ToString();

            emailSMSSettingsObj.DailyEmailDay = emailSettings != null ? emailSettings.DayCount > 0 ? emailSettings.DayCount.ToString() : this.objEmailSMSSettingsDefaultTime.DailyDay : this.objEmailSMSSettingsDefaultTime.DailyDay;
            string DailyEmailTime  = emailSettings != null ? emailSettings.TheDayHour != string.Empty ? emailSettings.TheDayHour : this.objEmailSMSSettingsDefaultTime.DailyTime : this.objEmailSMSSettingsDefaultTime.DailyTime;
            string HourlyEmailTime = emailSettings != null ? emailSettings.TheHour != string.Empty ? emailSettings.TheHour : this.objEmailSMSSettingsDefaultTime.HourlyTime : this.objEmailSMSSettingsDefaultTime.HourlyTime;
            Dictionary <string, string> DailyEmailTimeDic  = this.GetTimeParts_UserSettings(DailyEmailTime);
            Dictionary <string, string> HourlyEmailTimeDic = this.GetTimeParts_UserSettings(HourlyEmailTime);
            emailSMSSettingsObj.DailyEmailHour    = DailyEmailTimeDic["Hour"];
            emailSMSSettingsObj.DailyEmailMinute  = DailyEmailTimeDic["Minute"];
            emailSMSSettingsObj.HourlyEmailHour   = HourlyEmailTimeDic["Hour"];
            emailSMSSettingsObj.HourlyEmailMinute = HourlyEmailTimeDic["Minute"];

            emailSMSSettingsObj.IsSendSMS = smsSettings != null?smsSettings.Active.ToString().ToLower() : false.ToString().ToLower();

            emailSMSSettingsObj.SendSMSState = smsSettings != null?smsSettings.SendByDay?EmailSMSTransferState.Daily.ToString() : EmailSMSTransferState.Hourly.ToString() : EmailSMSTransferState.Daily.ToString();

            emailSMSSettingsObj.DailySMSDay = smsSettings != null ? smsSettings.DayCount > 0 ? smsSettings.DayCount.ToString() : this.objEmailSMSSettingsDefaultTime.DailyDay : this.objEmailSMSSettingsDefaultTime.DailyDay;
            string DailySMSTime  = smsSettings != null ? smsSettings.TheDayHour != string.Empty ? smsSettings.TheDayHour : this.objEmailSMSSettingsDefaultTime.DailyTime : this.objEmailSMSSettingsDefaultTime.DailyTime;
            string HourlySMSTime = smsSettings != null ? smsSettings.TheHour != string.Empty ? smsSettings.TheHour : this.objEmailSMSSettingsDefaultTime.HourlyTime : this.objEmailSMSSettingsDefaultTime.HourlyTime;
            Dictionary <string, string> DailySMSTimeDic  = this.GetTimeParts_UserSettings(DailySMSTime);
            Dictionary <string, string> HourlySMSTimeDic = this.GetTimeParts_UserSettings(HourlySMSTime);
            emailSMSSettingsObj.DailySMSHour    = DailySMSTimeDic["Hour"];
            emailSMSSettingsObj.DailySMSMinute  = DailySMSTimeDic["Minute"];
            emailSMSSettingsObj.HourlySMSHour   = HourlySMSTimeDic["Hour"];
            emailSMSSettingsObj.HourlySMSMinute = HourlySMSTimeDic["Minute"];

            SettingsBatchObjList.Add(emailSMSSettingsObj);

            DashboardSettingsObj dashboardObj = new DashboardSettingsObj();
            dashboardObj.SettingType = "Dashboard";
            if (dashboardSettingsObj != null)
            {
                dashboardObj.DashboardID1 = dashboardSettingsObj.Dashboard1 != null?dashboardSettingsObj.Dashboard1.ID.ToString() : "0";

                dashboardObj.DashboardTitle1 = dashboardSettingsObj.Dashboard1 != null ? dashboardSettingsObj.Dashboard1.Title : "";

                dashboardObj.DashboardID2 = dashboardSettingsObj.Dashboard2 != null?dashboardSettingsObj.Dashboard2.ID.ToString() : "0";

                dashboardObj.DashboardTitle2 = dashboardSettingsObj.Dashboard2 != null ? dashboardSettingsObj.Dashboard2.Title : "";

                dashboardObj.DashboardID3 = dashboardSettingsObj.Dashboard3 != null?dashboardSettingsObj.Dashboard3.ID.ToString() : "0";

                dashboardObj.DashboardTitle3 = dashboardSettingsObj.Dashboard3 != null ? dashboardSettingsObj.Dashboard3.Title : "";

                dashboardObj.DashboardID4 = dashboardSettingsObj.Dashboard4 != null?dashboardSettingsObj.Dashboard4.ID.ToString() : "0";

                dashboardObj.DashboardTitle4 = dashboardSettingsObj.Dashboard4 != null ? dashboardSettingsObj.Dashboard4.Title : "";
            }
            else
            {
                dashboardObj.DashboardID1    = "0";
                dashboardObj.DashboardTitle1 = "";

                dashboardObj.DashboardID2    = "0";
                dashboardObj.DashboardTitle2 = "";

                dashboardObj.DashboardID3    = "0";
                dashboardObj.DashboardTitle3 = "";

                dashboardObj.DashboardID4    = "0";
                dashboardObj.DashboardTitle4 = "";
            }
            SettingsBatchObjList.Add(dashboardObj);
            MonthlyOperationSchemaObj monthlyOperationSchemaObj = new MonthlyOperationSchemaObj();
            monthlyOperationSchemaObj.Schema = ((MonthlyOperationSchema)MonthlyOperationSchemaHelper.InitializeMonthlyOperationSchema(this.Page)).ToString();
            SettingsBatchObjList.Add(monthlyOperationSchemaObj);
            OperatorCollectiveRequestRegistType collectiveRequestTypeObj = new OperatorCollectiveRequestRegistType();
            collectiveRequestTypeObj.SettingType = "CollectiveRequestRegistType";
            collectiveRequestTypeObj.CollectiveRequestRegistType = collectiveRequestRegistTypeObj.ToString();
            SettingsBatchObjList.Add(collectiveRequestTypeObj);
            retMessage[0] = GetLocalResourceObject("RetSuccessType").ToString();
            retMessage[1] = GetLocalResourceObject("OperationCompleted").ToString();
            retMessage[2] = "success";
            retMessage[3] = this.JsSerializer.Serialize(SettingsBatchObjList);
            return(retMessage);
        }
        catch (UIValidationExceptions ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage);
            return(retMessage);
        }
        catch (UIBaseException ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage);
            return(retMessage);
        }
        catch (Exception ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage);
            return(retMessage);
        }
    }
Exemplo n.º 19
0
 public DashboardCategory(DashboardSettings.Category settingsCategory)
 {
     Settings = settingsCategory;
     Index = Current.Settings.Dashboard.Categories.IndexOf(settingsCategory);
 }
Exemplo n.º 20
0
 public CachedDataProvider(DashboardSettings.Provider provider)
     : base(provider)
 {
 }
Exemplo n.º 21
0
 public string Serialize(DashboardSettings score)
 {
     return(base.Serialize(score));
 }