コード例 #1
0
 public GrowlNotifiactions(IStartupConfiguration startupConfiguration, Notifications notifications)
 {
     InitializeComponent();
     this.startupConfiguration = startupConfiguration;
     Notifications = notifications;
     NotificationsControl.DataContext = Notifications;
 }
コード例 #2
0
        public GrowlNotifiactions()
        {
            _notifications = new Notifications();
            _notificationsBuffer = new Notifications();

            InitializeComponent();
            NotificationsControl.DataContext = _notifications;
        }
コード例 #3
0
ファイル: App.xaml.cs プロジェクト: rcbdev/Notifications
 private void _notificationListener_OnNotification(object source, Notifications.Client.Event.NotificationEventArgs e)
 {
     Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, new Action(() =>
     {
         var window = new NotificationToast(e.Notification.Message, e.Notification.Title, e.Notification.Type, e.Notification.Url);
         window.Show();
     }));
 }
コード例 #4
0
        public NotificationsMenuItem(Notifications.NotificationsViewExtension notificationsExtension)
        {
            this.notificationsModel = notificationsExtension;
            InitializeComponent();

              var showItem = new MenuItem();
              showItem.Header = Properties.Resources.Display;
              showItem.Click += (o, e) =>
              {
                  //create a window to display the list of notificationsModels
                  var window = new NotificationsView(notificationsExtension);
                  window.Show();
              };

              var dismissItem = new MenuItem();
              dismissItem.Header = Properties.Resources.Dismiss;
              dismissItem.Click += (o, e) => { this.notificationsModel.Notifications.Clear(); };

              //set some defaults
              dismissItem.IsEnabled = false;
              showItem.IsEnabled = false;
              BadgeGrid.Visibility = Visibility.Hidden;

              this.MenuItem.Items.Add(showItem);
              this.MenuItem.Items.Add(dismissItem);

              //create our icon
                var color = new SolidColorBrush(Colors.LightGray);
                this.imageicon.Source = FontAwesome.WPF.ImageAwesome.CreateImageSource(FontAwesome.WPF.FontAwesomeIcon.ExclamationCircle, color);
          
            //create some bindings
            //attach the visibility of the badge and menuItems enabledState to the number of notifications without a binding...

            NotificationsChangeHandler = (o, e) => {
                if (this.notificationsModel.Notifications.Count > 0)
                {
                    BadgeGrid.Visibility = Visibility.Visible;
                    dismissItem.IsEnabled = true;
                    showItem.IsEnabled = true;
                }
                else
                {
                    BadgeGrid.Visibility = Visibility.Hidden;
                    dismissItem.IsEnabled = false;
                    showItem.IsEnabled = false;
                }
            };

            this.notificationsModel.Notifications.CollectionChanged += NotificationsChangeHandler;

            // create a binding between the label and the count of notifications
            var binding = new Binding();
            binding.Path = new PropertyPath("Notifications.Count");
            //dataContext is the extension
            CountLabel.DataContext = notificationsExtension;
            CountLabel.SetBinding(TextBlock.TextProperty, binding);

        }
コード例 #5
0
    protected void btnSendNotification_Click(object sender, EventArgs e)
    {
        Notifications objNotifications = new Notifications();
        objNotifications.BitIsActive = true;
        objNotifications.BitIsReaded = false;
        objNotifications.DtmDateCreated = DateTime.Now;
        objNotifications.DtmDateReaded = DateTime.MinValue;
        if (hfIsOrg.Value == "true")
        {
            objNotifications.IntFromOrganizationId = UserOrganizationId;
            objNotifications.IntToOrganizationId =Conversion.ParseInt( hfToId.Value);
            objNotifications.IntFromUserId = 0;
            objNotifications.IntToUserId = 0;
        }
        else
        {
            objNotifications.IntFromOrganizationId = 0;
            objNotifications.IntToOrganizationId =0 ;
            objNotifications.IntFromUserId = UserInfo.GetCurrentUserInfo().UserId;
            objNotifications.IntToUserId = Conversion.ParseInt(hfToId.Value);
        }
     
        objNotifications.IntParentNotificationId = 0;
        objNotifications.IntSourceId = 0;
     
     
        objNotifications.VchNotificationText = txtNotification.Text.Trim();
        txtNotification.Text = string.Empty;
        objNotifications.InsertUpdate();
        if (hfIsOrg.Value == "true")
        {
            int fromId = Conversion.ParseInt(hfToId.Value);
            lvmessages.DataSource = Notifications.getNotifications(0, 0, fromId, UserOrganizationId, false, true);
            lvmessages.DataBind();
        }
        else
        {
            int fromId = Conversion.ParseInt(hfToId.Value);
            lvmessages.DataSource = Notifications.getNotifications(fromId, UserInfo.GetCurrentUserInfo().UserId, 0, 0, false, true);
            lvmessages.DataBind();
        }
        lvmessagesmain.DataSource = Notifications.getAllNotifications(UserInfo.GetCurrentUserInfo().UserId, UserOrganizationId, false, true,10,1);
        lvmessagesmain.DataBind();
        lvmessagesmaindetail.DataSource = Notifications.getAllNotificationsReadUnread(UserInfo.GetCurrentUserInfo().UserId, UserOrganizationId,  true, 10, 1);
        lvmessagesmaindetail.DataBind();

    }
コード例 #6
0
    protected void lvmessagesmain_ItemCommand(object sender, ListViewCommandEventArgs e)
    {
        if (e.CommandName == "OpenPopupFromUser")
        {
            int fromId = (Conversion.ParseInt(e.CommandArgument));
            hfToId.Value = fromId.ToString();
            hfIsOrg.Value = "false";
            lvmessages.DataSource = Notifications.getNotifications(fromId, UserInfo.GetCurrentUserInfo().UserId, 0, 0, false, true);
            lvmessages.DataBind();
            dvpopupaddnotification.Visible = true;
        
        }else
            if (e.CommandName == "OpenPopupFromOrg")
            {
                int fromId = (Conversion.ParseInt(e.CommandArgument));
                hfToId.Value = fromId.ToString();
                hfIsOrg.Value = "true";
                lvmessages.DataSource = Notifications.getNotifications(0, 0, fromId, UserOrganizationId, false, true);
                lvmessages.DataBind();
                dvpopupaddnotification.Visible = true;

            }
            else

        if (e.CommandName == "MarkRead")
        {
            Notifications objNotifications = new Notifications(Conversion.ParseInt(e.CommandArgument));
            objNotifications.BitIsReaded = true;
            objNotifications.DtmDateReaded = DateTime.Now;
            objNotifications.InsertUpdate();
        }
        else
            if (e.CommandName == "Delete")
            {
                Notifications objNotifications = new Notifications(Conversion.ParseInt(e.CommandArgument));
                objNotifications.BitIsActive = false;
                objNotifications.InsertUpdate();
            }
      
        lvmessagesmain.DataSource = Notifications.getAllNotifications(UserInfo.GetCurrentUserInfo().UserId, UserOrganizationId, false, true,10,1);
        lvmessagesmain.DataBind();
        lvmessagesmaindetail.DataSource = Notifications.getAllNotificationsReadUnread(UserInfo.GetCurrentUserInfo().UserId, UserOrganizationId,  true, 10, 1);
        lvmessagesmaindetail.DataBind();
    }
コード例 #7
0
        public Notification CreateNotification(Notifications type, User user, User recentlyUser, Playlist recentlyPlaylist)
        {
            var notification = new Notification
            {
                NotificationType = type,
                User = user,
                RecentlyUser = recentlyUser,
                RecentlyPlaylist = recentlyPlaylist,
                NotificationDate = DateTime.Now
            };

            var notificationDto = new NotificationDto();
            Mapper.Map(notification, notificationDto); 
            notificationDto.Message = GetMessage(notification);

            List<long> list = user.Followers.Select(s => s.Id).ToList();

            _notificationHub.SendNotification(user.Id, notificationDto, list);

            return notification;
        }
コード例 #8
0
        private static void OnLoad(EventArgs args)
        {
            if (player.ChampionName != ChampName)
            {
                return;
            }

            Notifications.AddNotification("PewPewTristana Loaded!", 5000);

            //Ability Information - Range - Variables.
            Q = new Spell(SpellSlot.Q, 585);

            //RocketJump Settings
            W = new Spell(SpellSlot.W, 900);
            W.SetSkillshot(0.25f, 150, 1200, false, SkillshotType.SkillshotCircle);

            E = new Spell(SpellSlot.E, 630);
            R = new Spell(SpellSlot.R, 630);


            Config    = new Menu("PewPewTristana", "Tristana", true);
            Orbwalker = new Orbwalking.Orbwalker(Config.AddSubMenu(new Menu("[PPT]: Orbwalker", "Orbwalker")));
            TargetSelector.AddToMenu(Config.AddSubMenu(new Menu("[PPT]: Target Selector", "Target Selector")));

            //COMBOMENU

            var combo   = Config.AddSubMenu(new Menu("[PPT]: Combo Settings", "Combo Settings"));
            var harass  = Config.AddSubMenu(new Menu("[PPT]: Harass Settings", "Harass Settings"));
            var drawing = Config.AddSubMenu(new Menu("[PPT]: Draw Settings", "Draw"));


            combo.SubMenu("[Q] Settings").AddItem(new MenuItem("UseQ", "Use Q").SetValue(true));
            combo.SubMenu("[Q] Settings").AddItem(new MenuItem("QonE", "Use [Q] if target has [E] debuff").SetValue(false));


            combo.SubMenu("[W] Settings").AddItem(new MenuItem("UseW", "Not Supported"));

            combo.SubMenu("[E] Settings").AddItem(new MenuItem("UseE", "Use Explosive Charge").SetValue(true));

            combo.SubMenu("[R] Settings").AddItem(new MenuItem("UseR", "Use R").SetValue(true));
            combo.SubMenu("[R] Settings").AddItem(new MenuItem("UseRE", "Use ER [FINISHER]").SetValue(true));
            combo.SubMenu("[R] Settings").AddItem(new MenuItem("manualr", "Cast R on your target").SetValue(new KeyBind('R', KeyBindType.Press)));



            combo.SubMenu("Item Settings").AddItem(new MenuItem("useGhostblade", "Use Youmuu's Ghostblade").SetValue(true));
            combo.SubMenu("Item Settings").AddItem(new MenuItem("UseBOTRK", "Use Blade of the Ruined King").SetValue(true));
            combo.SubMenu("Item Settings").AddItem(new MenuItem("eL", "  Enemy HP Percentage").SetValue(new Slider(80, 100, 0)));
            combo.SubMenu("Item Settings").AddItem(new MenuItem("oL", "  Own HP Percentage").SetValue(new Slider(65, 100, 0)));
            combo.SubMenu("Item Settings").AddItem(new MenuItem("UseBilge", "Use Bilgewater Cutlass").SetValue(true));
            combo.SubMenu("Item Settings").AddItem(new MenuItem("HLe", "  Enemy HP Percentage").SetValue(new Slider(80, 100, 0)));
            combo.SubMenu("Summoner Settings").AddItem(new MenuItem("UseIgnite", "Use Ignite").SetValue(true));


            //LANECLEARMENU
            Config.SubMenu("[PPT]: Laneclear Settings").AddItem(new MenuItem("laneQ", "Use Q").SetValue(true));
            Config.SubMenu("[PPT]: Laneclear Settings").AddItem(new MenuItem("laneE", "Use E").SetValue(true));
            Config.SubMenu("[PPT]: Laneclear Settings").AddItem(new MenuItem("eturret", "Use E on turrets").SetValue(true));
            Config.SubMenu("[PPT]: Laneclear Settings").AddItem(new MenuItem("laneclearmana", "Mana Percentage").SetValue(new Slider(30, 100, 0)));
            Config.SubMenu("[PPT]: Laneclear Settings").AddItem(new MenuItem("levelclear", "Don't use abilities till level").SetValue(new Slider(8, 18, 1)));

            //JUNGLEFARMMENU
            Config.SubMenu("[PPT]: Jungle Settings").AddItem(new MenuItem("jungleQ", "Use Q").SetValue(true));
            Config.SubMenu("[PPT]: Jungle Settings").AddItem(new MenuItem("jungleE", "Use E").SetValue(true));
            Config.SubMenu("[PPT]: Jungle Settings").AddItem(new MenuItem("jungleclearmana", "Mana Percentage").SetValue(new Slider(30, 100, 0)));

            drawing.AddItem(new MenuItem("Draw_Disabled", "Disable All Spell Drawings").SetValue(false));
            drawing.SubMenu("Misc Drawings").AddItem(new MenuItem("drawRtoggle", "Draw R finisher toggle").SetValue(true));
            drawing.SubMenu("Misc Drawings").AddItem(new MenuItem("drawtargetcircle", "Draw Orbwalker target circle").SetValue(true));

            drawing.AddItem(new MenuItem("Qdraw", "Draw Q Range").SetValue(new Circle(true, Color.Orange)));
            drawing.AddItem(new MenuItem("Wdraw", "Draw W Range").SetValue(new Circle(true, Color.DarkOrange)));
            drawing.AddItem(new MenuItem("Edraw", "Draw E Range").SetValue(new Circle(true, Color.AntiqueWhite)));
            drawing.AddItem(new MenuItem("Rdraw", "Draw R Range").SetValue(new Circle(true, Color.LawnGreen)));
            drawing.AddItem(new MenuItem("CircleThickness", "Circle Thickness").SetValue(new Slider(1, 30, 0)));

            harass.AddItem(new MenuItem("harassQ", "Use Q").SetValue(true));
            harass.AddItem(new MenuItem("harassE", "Use E").SetValue(true));
            harass.AddItem(new MenuItem("harassmana", "Mana Percentage").SetValue(new Slider(30, 100, 0)));

            drawing.AddItem(new MenuItem("disable.dmg", "Fully Disable Damage Indicator").SetValue(false));
            drawing.AddItem(new MenuItem("dmgdrawer", "[Damage Indicator]:", true).SetValue(new StringList(new[] { "Custom", "Common" }, 1)));

            Config.SubMenu("[PPT]: Misc Settings").AddItem(new MenuItem("interrupt", "Interrupt Spells").SetValue(true));
            Config.SubMenu("[PPT]: Misc Settings").AddItem(new MenuItem("antigap", "Antigapcloser").SetValue(true));
            Config.SubMenu("[PPT]: Misc Settings").AddItem(new MenuItem("AntiRengar", "Anti-Rengar Leap").SetValue(true));
            Config.SubMenu("[PPT]: Misc Settings").AddItem(new MenuItem("AntiKhazix", "Anti-Khazix Leap").SetValue(true));

            Config.AddToMainMenu();

            Drawing.OnDraw        += OnDraw;
            Obj_AI_Base.OnLevelUp += TristRange;
            Game.OnUpdate         += Game_OnGameUpdate;
            Drawing.OnEndScene    += OnEndScene;
            Interrupter2.OnInterruptableTarget += Interrupter2_OnInterruptableTarget;
            AntiGapcloser.OnEnemyGapcloser     += AntiGapCloser_OnEnemyGapcloser;
            GameObject.OnCreate += GameObject_OnCreate;
        }
コード例 #9
0
 /// <inheritdoc />
 void IServerModuleStateContext.LogNotification(IModuleNotification notification)
 {
     Notifications.Add(notification);
 }
コード例 #10
0
ファイル: StrategyViewModel.cs プロジェクト: lulzzz/tradeview
 private void ClearNotifications(object param)
 {
     Notifications.Clear();
 }
コード例 #11
0
 protected bool IsAValidOperation()
 {
     return(!Notifications.HasNotifications(NotificationType.Error));
 }
コード例 #12
0
ファイル: Program.cs プロジェクト: Challangerr/scripts
 private static void WelcomeMessage()
 {
     Notifications.AddNotification(ChampionName + " Loaded!", 4000);
 }
コード例 #13
0
        static void Game_OnGameLoad()
        {
            if (player.ChampionName != ChampName)
            {
                return;
            }

            Notifications.AddNotification("JustTrundle - [V.1.0.2.0]", 8000);
            Chat.Print("JustTrundle Loaded!");

            //Ability Information - Range - Variables.
            Q = new Spell(SpellSlot.Q, 125f);
            W = new Spell(SpellSlot.W, 900f);
            E = new Spell(SpellSlot.E, 1000f);
            E.SetSkillshot(.5f, 188f, 1600f, false, SkillshotType.SkillshotCircle);
            R = new Spell(SpellSlot.R, 700f);

            //Menu
            Config = new Menu(player.ChampionName, player.ChampionName, true);
            Config.AddSubMenu(new Menu("Orbwalking", "Orbwalking"));

            var targetSelectorMenu = new Menu("Target Selector", "Target Selector");

            TargetSelector.AddToMenu(targetSelectorMenu);
            Config.AddSubMenu(targetSelectorMenu);

            Orbwalker = new Orbwalking.Orbwalker(Config.SubMenu("Orbwalking"));

            //Combo
            Config.AddSubMenu(new Menu("Combo", "Combo"));
            Config.SubMenu("Combo").AddItem(new MenuItem("UseQ", "Use Q").SetValue(true));
            Config.SubMenu("Combo").AddItem(new MenuItem("UseW", "Use W").SetValue(true));
            Config.SubMenu("Combo").AddItem(new MenuItem("UseE", "Use E").SetValue(true));
            Config.SubMenu("Combo").AddItem(new MenuItem("UseR", "Use R").SetValue(true));
            Config.SubMenu("Combo").AddItem(new MenuItem("manualr", "Cast R Manual").SetValue(new KeyBind('R', KeyBindType.Press)));
            Config.SubMenu("Combo").AddItem(new MenuItem("DontUlt", "Dont Use R On"));
            Config.SubMenu("Combo").AddItem(new MenuItem("sep0", "======"));
            foreach (var enemy in ObjectManager.Get <AIHeroClient>().Where(hero => hero.IsEnemy))
            {
                Config.SubMenu("Combo").AddItem(new MenuItem("DontUlt" + enemy.BaseSkinName, enemy.BaseSkinName, true).SetValue(false));
            }
            Config.SubMenu("Combo").AddItem(new MenuItem("sep1", "======"));

            //Harass
            Config.AddSubMenu(new Menu("Harass", "Harass"));
            Config.SubMenu("Harass").AddItem(new MenuItem("hQ", "Use Q").SetValue(true));
            Config.SubMenu("Harass").AddItem(new MenuItem("hW", "Use W").SetValue(true));
            Config.SubMenu("Harass").AddItem(new MenuItem("hE", "Use E").SetValue(true));
            Config.SubMenu("Harass").AddItem(new MenuItem("harassmana", "Mana Percentage").SetValue(new Slider(30, 0, 100)));

            //Item
            Config.AddSubMenu(new Menu("Item", "Item"));
            Config.SubMenu("Item").AddItem(new MenuItem("useGhostblade", "Use Youmuu's Ghostblade").SetValue(true));
            Config.SubMenu("Item").AddItem(new MenuItem("UseBOTRK", "Use Blade of the Ruined King").SetValue(true));
            Config.SubMenu("Item").AddItem(new MenuItem("eL", "  Enemy HP Percentage").SetValue(new Slider(80, 0, 100)));
            Config.SubMenu("Item").AddItem(new MenuItem("oL", "  Own HP Percentage").SetValue(new Slider(65, 0, 100)));
            Config.SubMenu("Item").AddItem(new MenuItem("UseBilge", "Use Bilgewater Cutlass").SetValue(true));
            Config.SubMenu("Item").AddItem(new MenuItem("HLe", "  Enemy HP Percentage").SetValue(new Slider(80, 0, 100)));
            Config.SubMenu("Item").AddItem(new MenuItem("UseIgnite", "Use Ignite").SetValue(true));

            //Laneclear
            Config.AddSubMenu(new Menu("Clear", "Clear"));
            Config.SubMenu("Clear").AddItem(new MenuItem("laneQ", "Use Q").SetValue(true));
            Config.SubMenu("Clear").AddItem(new MenuItem("laneW", "Use W").SetValue(true));
            Config.SubMenu("Clear").AddItem(new MenuItem("laneE", "Use E").SetValue(true));
            Config.SubMenu("Clear").AddItem(new MenuItem("laneclearmana", "Mana Percentage").SetValue(new Slider(30, 0, 100)));

            //Draw
            Config.AddSubMenu(new Menu("Draw", "Draw"));
            Config.SubMenu("Draw").AddItem(new MenuItem("Draw_Disabled", "Disable All Spell Drawings").SetValue(false));
            Config.SubMenu("Draw").AddItem(new MenuItem("Qdraw", "Draw Q Range").SetValue(true));
            Config.SubMenu("Draw").AddItem(new MenuItem("Wdraw", "Draw W Range").SetValue(true));
            Config.SubMenu("Draw").AddItem(new MenuItem("Edraw", "Draw E Range").SetValue(true));
            Config.SubMenu("Draw").AddItem(new MenuItem("Rdraw", "Draw R Range").SetValue(true));

            //Misc
            Config.AddSubMenu(new Menu("Misc", "Misc"));
            Config.SubMenu("Misc").AddItem(new MenuItem("Ksq", "Killsteal with Q").SetValue(false));
            Config.SubMenu("Misc").AddItem(new MenuItem("DrawD", "Damage Indicator").SetValue(true));
            Config.SubMenu("Misc").AddItem(new MenuItem("interrupt", "Interrupt Spells").SetValue(true));
            Config.SubMenu("Misc").AddItem(new MenuItem("antigap", "AntiGapCloser").SetValue(true));

            Config.AddToMainMenu();
            Drawing.OnDraw     += OnDraw;
            Game.OnUpdate      += Game_OnGameUpdate;
            Drawing.OnEndScene += OnEndScene;
            Interrupter2.OnInterruptableTarget += Interrupter2_OnInterruptableTarget;
            AntiGapcloser.OnEnemyGapcloser     += AntiGapcloser_OnEnemyGapcloser;
        }
コード例 #14
0
 private void howComeICannotConnectToMyDatabaseToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Notifications.ShowInformationMessage(
         "The issue is probably because your computer's IP is not whitelisted in your database.");
 }
コード例 #15
0
        /// <summary>
        /// DoThisAllTheTime()
        /// This method is used to sync the text file with the database. Every minute it checks whether
        /// new sensor readings have been written to the text files and if new readings occured then those readings
        /// will be added to the database.
        ///
        /// While the new readings are being written to the database it also checks to see if the readings
        /// are still within the specified critical ranges. If the readings fall outside of the critical
        /// range then an email is send to notify the users.
        /// </summary>
        public void DoThisAllTheTime()
        {
            int               currentfrequency  = 0;
            Sensor            sensor            = new Sensor();
            List <Sensor>     allSensors        = sensor.getAllSensors();
            FrequencySettings frequencySettings = new FrequencySettings();

            currentfrequency = frequencySettings.getFrequency() * 60; // change to seconds

            while (continueThread)
            {
                //you need to use Invoke because the new thread can't access the UI elements directly
                MethodInvoker mi = delegate() { this.Text = DateTime.Now.ToString(); };
                this.Invoke(mi);

                if (second % 60 == 0) // write sensor readings in database from textfile each minute
                {
                    foreach (Sensor item in allSensors)
                    {
                        SensorReading reading = new SensorReading();
                        reading.newSensorReading(item);
                    }
                }

                if (second % currentfrequency == 0)
                {
                    foreach (Sensor item in allSensors)
                    {
                        List <SensorReading> allReadings = new List <SensorReading>(); // retrieve a list of sensor readings in 24 hour period

                        SensorReading reading = new SensorReading();
                        allReadings = reading.getDayReadings(item);

                        List <SensorReading> readingInTimeInterval = new List <SensorReading>();
                        Notifications        notify = new Notifications();
                        decimal topValue            = notify.getTopvalue(item.SensorID);
                        decimal bottomValue         = notify.getBottomValue(item.SensorID);

                        foreach (SensorReading read in allReadings)
                        {
                            int time = read.Date.Minute;
                            if (time % (currentfrequency / 60) == 0)
                            {
                                readingInTimeInterval.Add(read);
                            }
                        }

                        foreach (SensorReading readInInterval in readingInTimeInterval)
                        {
                            if (readInInterval.ReadingVal < bottomValue)
                            {
                                Contact       contact   = new Contact();
                                List <string> allEmails = contact.getEmailsToReceiveNotification(item.SensorID); // get list of emails for this sensor

                                foreach (string mail in allEmails)
                                {
                                    notify.mailNotifcation(mail, item.Location, item.SensorName, "Bottom", (bottomValue - readInInterval.ReadingVal));
                                }
                            }

                            if (readInInterval.ReadingVal > topValue)
                            {
                                Contact       contact   = new Contact();
                                List <string> allEmails = contact.getEmailsToReceiveNotification(item.SensorID); // get list of emails for this sensor

                                foreach (string mail in allEmails)
                                {
                                    notify.mailNotifcation(mail, item.Location, item.SensorName, "Top", (readInInterval.ReadingVal - topValue));
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #16
0
ファイル: CheckVersion.cs プロジェクト: pvtPyle/AramBuddy
        public static void Init()
        {
            try
            {
                Logger.Send("Checking For Updates..");
                var size = Drawing.Width <= 1280 || Drawing.Height <= 720 ? 10F : 40F;
                text = new Text("ARAMBUDDY OUTDATED! PLEASE UPDATE!", new Font("Euphemia", size, FontStyle.Bold)) { Color = Color.White };
                var WebClient = new WebClient();
                WebClient.DownloadStringTaskAsync(UpdateMsgPath);
                WebClient.DownloadStringCompleted += delegate(object sender, DownloadStringCompletedEventArgs args)
                {
                    if (args.Cancelled || args.Error != null)
                    {
                        Logger.Send("Failed to get update Message.", Logger.LogLevel.Warn);
                        Logger.Send("Wrong response, or request was cancelled.", Logger.LogLevel.Warn);
                        Logger.Send(args.Error?.InnerException?.Message, Logger.LogLevel.Warn);
                        return;
                    }

                    UpdateMsg = args.Result;

                    WebClient.Dispose();
                };

                var WebClient2 = new WebClient();
                WebClient2.DownloadStringTaskAsync(WebVersionPath);
                WebClient2.DownloadStringCompleted += delegate(object sender, DownloadStringCompletedEventArgs args)
                {
                    if (args.Cancelled || args.Error != null)
                    {
                        Logger.Send("Failed to check live version.", Logger.LogLevel.Warn);
                        Logger.Send("Wrong response, or request was cancelled.", Logger.LogLevel.Warn);
                        Logger.Send(args.Error?.InnerException?.Message, Logger.LogLevel.Warn);
                        return;
                    }
                    if (args.Cancelled)
                    {
                        Logger.Send("Wrong response, or request was cancelled.", Logger.LogLevel.Warn);
                        Logger.Send(args.Error?.InnerException?.Message, Logger.LogLevel.Warn);
                        Console.WriteLine(args.Result);
                    }
                    if (!args.Result.Contains(CurrentVersion.ToString()))
                    {
                        Drawing.OnEndScene += delegate
                        {
                            text.Position = new Vector2(Drawing.Width * 0.01f, Drawing.Height * 0.1f);
                            text.Draw();
                        };
                        Outdated = true;
                        Logger.Send("Update available for AramBuddy!", Logger.LogLevel.Warn);
                        Logger.Send("Update Log: " + UpdateMsg);
                    }
                    else
                    {
                        Logger.Send("AramBuddy is updated to the latest version!");
                    }
                    WebClient2.Dispose();
                };

                Game.OnTick += delegate
                {
                    if (UpdateMsg != string.Empty && !Sent && Outdated)
                    {
                        Chat.Print("<b>AramBuddy: Update available for AramBuddy!</b>");
                        Chat.Print("<b>AramBuddy Update Log: " + UpdateMsg + "</b>");
                        Notifications.Show(new SimpleNotification("ARAMBUDDY OUTDATED", "Update Log: " + UpdateMsg), 25000);
                        Sent = true;
                    }
                };
            }
            catch (Exception ex)
            {
                Logger.Send("Update check failed!", ex, Logger.LogLevel.Error);
            }
        }
コード例 #17
0
        /// <summary>
        /// Processes the submit.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <param name="entity">The entity.</param>
        /// <returns></returns>
        protected ActionResult ProcessSubmit(UserEditorModel model, User entity)
        {
            Mandate.ParameterNotNull(model, "model");

            //bind it's data
            model.BindModel(this);

            //if there's model errors, return the view
            if (!ModelState.IsValid)
            {
                AddValidationErrorsNotification();
                return(View("Edit", model));
            }

            //persist the data
            using (var uow = Hive.Create <ISecurityStore>())
            {
                // Map the user
                if (entity == null)
                {
                    //map to new entity, set default date values
                    model.LastPasswordChangeDate = DateTime.UtcNow;
                    model.LastActivityDate       = DateTime.UtcNow;
                    model.LastLoginDate          = DateTime.UtcNow;
                    entity = BackOfficeRequestContext.Application.FrameworkContext.TypeMappers.Map <UserEditorModel, User>(model);
                }
                else
                {
                    //map to existing entity
                    BackOfficeRequestContext.Application.FrameworkContext.TypeMappers.Map(model, entity);
                }

                uow.Repositories.AddOrUpdate(entity);

                // Remove any removed user groups
                foreach (var relation in uow.Repositories.GetParentRelations(entity.Id, FixedRelationTypes.UserGroupRelationType)
                         .Where(x => !model.UserGroups.Contains(x.SourceId)))
                {
                    uow.Repositories.RemoveRelation(relation);
                }

                // Add any new user groups
                var existingRelations = uow.Repositories.GetParentRelations(entity.Id, FixedRelationTypes.UserGroupRelationType).Select(x => x.SourceId).ToArray();
                foreach (var userGroupId in model.UserGroups.Where(x => !existingRelations.Contains(x)))
                {
                    uow.Repositories.AddRelation(new Relation(FixedRelationTypes.UserGroupRelationType, userGroupId, entity.Id));
                }

                uow.Complete();

                //we may have changed the user data, so we need to ensure that the latest user data exists in the Identity object so we'll re-issue a forms auth ticket here
                if (HttpContext.User.Identity.Name.InvariantEquals(entity.Username))
                {
                    HttpContext.CreateUmbracoAuthTicket(entity);
                }

                Notifications.Add(new NotificationMessage(
                                      "User.Save.Message".Localize(this),
                                      "User.Save.Title".Localize(this),
                                      NotificationType.Success));

                //add path for entity for SupportsPathGeneration (tree syncing) to work
                GeneratePathsForCurrentEntity(uow.Repositories.GetEntityPaths <TypedEntity>(entity.Id, FixedRelationTypes.DefaultRelationType));

                return(RedirectToAction("Edit", new { id = entity.Id }));
            }
        }
コード例 #18
0
 public ErrorList(NotificationType type)
 {
     notificationsError = new List <NotificationError>();
     notifications      = NotificationFactory.getInstance().getNotificationType(type);
 }
コード例 #19
0
        protected CommandInfo ParseCommand(Alachisoft.NCache.Common.Protobuf.Command command, ClientManager clientManager, string cacheId)
        {
            CommandInfo cmdInfo     = new CommandInfo();
            int         packageSize = 0;
            int         index       = 0;
            string      version     = string.Empty;
            NCache      nCache      = clientManager.CmdExecuter as NCache;

            Caching.Cache cache = nCache.Cache;
            Hashtable     queryInfoHashtable = null;
            Hashtable     tagHashtable       = null;
            Hashtable     namedTagHashtable  = null;

            try
            {
                switch (command.type)
                {
                case Alachisoft.NCache.Common.Protobuf.Command.Type.ADD_BULK:
                    Alachisoft.NCache.Common.Protobuf.BulkAddCommand bulkAddCommand = command.bulkAddCommand;
                    packageSize = bulkAddCommand.addCommand.Count;

                    cmdInfo.Keys    = new string[packageSize];
                    cmdInfo.Entries = new CacheEntry[packageSize];
                    cmdInfo.OnDsItemsAddedCallback = (short)bulkAddCommand.datasourceItemAddedCallbackId;
                    cmdInfo.ProviderName           = bulkAddCommand.providerName.Length == 0 ? null : bulkAddCommand.providerName;
                    cmdInfo.RequestId         = bulkAddCommand.requestId;
                    cmdInfo.ClientLastViewId  = command.clientLastViewId;
                    cmdInfo.IntendedRecipient = command.intendedRecipient;

                    cmdInfo.returnVersion = bulkAddCommand.returnVersions;

                    foreach (Alachisoft.NCache.Common.Protobuf.AddCommand addCommand in bulkAddCommand.addCommand)
                    {
                        cmdInfo.Keys[index] = addCommand.key;
                        cmdInfo.ClientID    = addCommand.clientID;

                        BitSet flag = BitSet.CreateAndMarkInUse(clientManager.CacheFakePool, NCModulesConstants.SocketServer);
                        flag.Data = ((byte)addCommand.flag);
                        if (index == 0)
                        {
                            cmdInfo.Flag = flag;
                        }

                        object value = cache.SocketServerDataService.GetCacheData(addCommand.data.ToArray(), cmdInfo.Flag);

                        cmdInfo.Entries[index]            = CacheEntry.CreateCacheEntry(clientManager.CacheTransactionalPool, value, Alachisoft.NCache.Caching.Util.ProtobufHelper.GetExpirationHintObj(clientManager.CacheTransactionalPool, null, addCommand.absExpiration, addCommand.sldExpiration, addCommand.isResync, serailizationContext), PriorityEvictionHint.Create(clientManager.CacheTransactionalPool, (CacheItemPriority)addCommand.priority));
                        cmdInfo.Entries[index].Flag.Data |= flag.Data;

                        Notifications notification = null;
                        if ((short)addCommand.updateCallbackId != -1 || (short)addCommand.removeCallbackId != -1 || cmdInfo.OnDsItemsAddedCallback != -1)
                        {
                            notification = new Notifications(!string.IsNullOrEmpty(cmdInfo.ClientID) ? cmdInfo.ClientID : clientManager.ClientID,
                                                             Convert.ToInt32(cmdInfo.RequestId),
                                                             (short)addCommand.removeCallbackId,
                                                             (short)addCommand.updateCallbackId,
                                                             (short)(cmdInfo.RequestId == -1 ? -1 : 0),
                                                             cmdInfo.OnDsItemsAddedCallback,
                                                             (EventDataFilter)(addCommand.updateDataFilter != -1 ? (int)addCommand.updateDataFilter : (int)EventDataFilter.None),
                                                             (EventDataFilter)(addCommand.removeDataFilter != -1 ? (int)addCommand.removeDataFilter : (int)EventDataFilter.None)
                                                             );
                            cmdInfo.Entries[index].Notifications = notification;
                        }

                        cmdInfo.onUpdateCallbackId = (short)addCommand.updateCallbackId;
                        if (!String.IsNullOrEmpty(cmdInfo.Group))
                        {
                            cmdInfo.Entries[index].GroupInfo = new GroupInfo(cmdInfo.Group, cmdInfo.SubGroup, cmdInfo.type);
                        }

                        version = command.version;
                        if (queryInfoHashtable != null)
                        {
                            if (cmdInfo.Entries[index].QueryInfo == null)
                            {
                                cmdInfo.Entries[index].QueryInfo = new Hashtable();
                            }
                            cmdInfo.Entries[index].QueryInfo.Add("query-info", queryInfoHashtable);
                        }
                        cmdInfo.Entries[index].MarkInUse(NCModulesConstants.SocketServer);
                        index++;

                        if (addCommand?.PoolManager != null)
                        {
                            addCommand.PoolManager.GetProtobufAddCommandPool()?.Return(addCommand);
                        }
                    }

                    break;

                case Alachisoft.NCache.Common.Protobuf.Command.Type.INSERT_BULK:
                    Alachisoft.NCache.Common.Protobuf.BulkInsertCommand bulkInsertCommand = command.bulkInsertCommand;

                    packageSize = bulkInsertCommand.insertCommand.Count;

                    cmdInfo.Keys    = new string[packageSize];
                    cmdInfo.Entries = new CacheEntry[packageSize];

                    cmdInfo.OnDsItemsAddedCallback = (short)bulkInsertCommand.datasourceUpdatedCallbackId;
                    cmdInfo.ProviderName           = bulkInsertCommand.providerName.Length == 0 ? null : bulkInsertCommand.providerName;
                    cmdInfo.RequestId         = bulkInsertCommand.requestId;
                    cmdInfo.ClientLastViewId  = command.clientLastViewId;
                    cmdInfo.IntendedRecipient = command.intendedRecipient;

                    cmdInfo.returnVersion = bulkInsertCommand.returnVersions;

                    foreach (Alachisoft.NCache.Common.Protobuf.InsertCommand insertCommand in bulkInsertCommand.insertCommand)
                    {
                        cmdInfo.Keys[index] = insertCommand.key;
                        cmdInfo.ClientID    = insertCommand.clientID;
                        BitSet flag = BitSet.CreateAndMarkInUse(clientManager.CacheFakePool, NCModulesConstants.SocketServer);
                        flag.Data = ((byte)insertCommand.flag);
                        if (index == 0)
                        {
                            cmdInfo.Flag = flag;
                        }
                        object value = cache.SocketServerDataService.GetCacheData(insertCommand.data.ToArray(), cmdInfo.Flag);

                        cmdInfo.Entries[index]            = CacheEntry.CreateCacheEntry(clientManager.CacheTransactionalPool, value, Alachisoft.NCache.Caching.Util.ProtobufHelper.GetExpirationHintObj(clientManager.CacheTransactionalPool, null, insertCommand.absExpiration, insertCommand.sldExpiration, insertCommand.isResync, serailizationContext), PriorityEvictionHint.Create(clientManager.CacheTransactionalPool, (CacheItemPriority)insertCommand.priority));
                        cmdInfo.Entries[index].Flag.Data |= flag.Data;

                        Notifications notification = null;
                        if (insertCommand.updateCallbackId != -1 || insertCommand.removeCallbackId != -1 || cmdInfo.OnDsItemsAddedCallback != -1)
                        {
                            notification = new Notifications(!string.IsNullOrEmpty(cmdInfo.ClientID) ? cmdInfo.ClientID : clientManager.ClientID,
                                                             Convert.ToInt32(cmdInfo.RequestId),
                                                             (short)insertCommand.removeCallbackId,
                                                             (short)insertCommand.updateCallbackId,
                                                             (short)(cmdInfo.RequestId == -1 ? -1 : 0),
                                                             cmdInfo.OnDsItemsAddedCallback,
                                                             (EventDataFilter)(insertCommand.updateDataFilter != -1 ? (int)insertCommand.updateDataFilter : (int)EventDataFilter.None),
                                                             (EventDataFilter)(insertCommand.removeDataFilter != -1 ? (int)insertCommand.removeDataFilter : (int)EventDataFilter.None)
                                                             );
                            cmdInfo.Entries[index].Notifications = notification;
                        }

                        cmdInfo.onUpdateCallbackId = (short)insertCommand.updateCallbackId;

                        if (!String.IsNullOrEmpty(cmdInfo.Group))
                        {
                            cmdInfo.Entries[index].GroupInfo = new GroupInfo(cmdInfo.Group, cmdInfo.SubGroup, cmdInfo.type);
                        }



                        version = command.version;

                        if (queryInfoHashtable != null)
                        {
                            if (cmdInfo.Entries[index].QueryInfo == null)
                            {
                                cmdInfo.Entries[index].QueryInfo = new Hashtable();
                            }
                            cmdInfo.Entries[index].QueryInfo.Add("query-info", queryInfoHashtable);
                        }

                        if (tagHashtable != null)
                        {
                            if (cmdInfo.Entries[index].QueryInfo == null)
                            {
                                cmdInfo.Entries[index].QueryInfo = new Hashtable();
                            }
                            cmdInfo.Entries[index].QueryInfo.Add("tag-info", tagHashtable);
                        }

                        cmdInfo.Entries[index].MarkInUse(NCModulesConstants.SocketServer);
                        index++;

                        if (insertCommand?.PoolManager != null)
                        {
                            insertCommand.PoolManager.GetProtobufInsertCommandPool()?.Return(insertCommand);
                        }
                    }

                    break;
                }
            }
            finally
            {
            }
            return(cmdInfo);
        }
コード例 #20
0
ファイル: Program.cs プロジェクト: qksckdah/LeagueSharp2
        private static void Game_OnGameLoad(EventArgs args)
        {
            if (Player.ChampionName != "Jax")
            {
                return;
            }

            Q = new Spell(SpellSlot.Q, 680f);
            W = new Spell(SpellSlot.W);
            E = new Spell(SpellSlot.E);
            R = new Spell(SpellSlot.R);

            Q.SetTargetted(0.50f, 75f);

            SpellList.Add(Q);
            SpellList.Add(W);
            SpellList.Add(E);
            SpellList.Add(R);

            igniteSlot = Player.GetSpellSlot("SummonerDot");

            //Create the menu
            Config = new Menu("xQx | Jax", "Jax", true);

            var targetSelectorMenu = new Menu("Target Selector", "Target Selector");

            TargetSelector.AddToMenu(targetSelectorMenu);
            Config.AddSubMenu(targetSelectorMenu);

            AssassinManager = new AssassinManager();

            Config.AddSubMenu(new Menu("Orbwalking", "Orbwalking"));
            Orbwalker = new Orbwalking.Orbwalker(Config.SubMenu("Orbwalking"));
            Orbwalker.SetAttack(true);

            // Combo
            Config.AddSubMenu(new Menu("Combo", "Combo"));
            Config.SubMenu("Combo")
            .AddItem(new MenuItem("ComboUseQMinRange", "Min. Q Range").SetValue(new Slider(250, (int)Q.Range)));
            Config.SubMenu("Combo")
            .AddItem(
                new MenuItem("ComboActive", "Combo!").SetValue(new KeyBind(Config.Item("Orbwalk").GetValue <KeyBind>().Key, KeyBindType.Press)).SetFontStyle(FontStyle.Regular, SharpDX.Color.GreenYellow));

            // Harass
            Config.AddSubMenu(new Menu("Harass", "Harass"));
            Config.SubMenu("Harass").AddItem(new MenuItem("UseQHarass", "Use Q").SetValue(true));
            Config.SubMenu("Harass")
            .AddItem(new MenuItem("UseQHarassDontUnderTurret", "Don't Under Turret Q").SetValue(true));
            Config.SubMenu("Harass").AddItem(new MenuItem("UseWHarass", "Use W").SetValue(true));
            Config.SubMenu("Harass").AddItem(new MenuItem("UseEHarass", "Use E").SetValue(true));
            Config.SubMenu("Harass")
            .AddItem(
                new MenuItem("HarassMode", "Harass Mode: ").SetValue(
                    new StringList(new[] { "Q+W", "Q+E", "Default" })));
            Config.SubMenu("Harass")
            .AddItem(new MenuItem("HarassMana", "Min. Mana Percent: ").SetValue(new Slider(50, 100, 0)));
            Config.SubMenu("Harass")
            .AddItem(
                new MenuItem("HarassActive", "Harass").SetValue(new KeyBind("C".ToCharArray()[0], KeyBindType.Press)).SetFontStyle(FontStyle.Regular, SharpDX.Color.GreenYellow));

            // Lane Clear
            Config.AddSubMenu(new Menu("LaneClear", "LaneClear"));
            Config.SubMenu("LaneClear").AddItem(new MenuItem("UseQLaneClear", "Use Q").SetValue(false));
            Config.SubMenu("LaneClear")
            .AddItem(new MenuItem("UseQLaneClearDontUnderTurret", "Don't Under Turret Q").SetValue(true));
            Config.SubMenu("LaneClear").AddItem(new MenuItem("UseWLaneClear", "Use W").SetValue(false));
            Config.SubMenu("LaneClear").AddItem(new MenuItem("UseELaneClear", "Use E").SetValue(false));
            Config.SubMenu("LaneClear")
            .AddItem(new MenuItem("LaneClearMana", "Min. Mana Percent: ").SetValue(new Slider(50, 100, 0)));
            Config.SubMenu("LaneClear")
            .AddItem(
                new MenuItem("LaneClearActive", "LaneClear").SetValue(new KeyBind("V".ToCharArray()[0], KeyBindType.Press)).SetFontStyle(FontStyle.Regular, SharpDX.Color.GreenYellow));

            // Jungling Farm
            Config.AddSubMenu(new Menu("JungleFarm", "JungleFarm"));
            Config.SubMenu("JungleFarm").AddItem(new MenuItem("UseQJungleFarm", "Use Q").SetValue(true));
            Config.SubMenu("JungleFarm").AddItem(new MenuItem("UseWJungleFarm", "Use W").SetValue(false));
            Config.SubMenu("JungleFarm").AddItem(new MenuItem("UseEJungleFarm", "Use E").SetValue(false));
            Config.SubMenu("JungleFarm")
            .AddItem(new MenuItem("JungleFarmMana", "Min. Mana Percent: ").SetValue(new Slider(50, 100, 0)));

            Config.SubMenu("JungleFarm")
            .AddItem(
                new MenuItem("JungleFarmActive", "JungleFarm").SetValue(
                    new KeyBind("V".ToCharArray()[0], KeyBindType.Press)).SetFontStyle(FontStyle.Regular, SharpDX.Color.GreenYellow));;

            // Extra
            var misc = new Menu("Misc", "Misc");

            Config.AddSubMenu(misc);
            misc.AddItem(new MenuItem("InterruptSpells", "Interrupt Spells").SetValue(true));
            misc.AddItem(new MenuItem("Misc.AutoW", "Auto Hit W if possible").SetValue(true));

            // Drawing
            Config.AddSubMenu(new Menu("Drawings", "Drawings"));
            Config.SubMenu("Drawings")
            .AddItem(
                new MenuItem("DrawQRange", "Q range").SetValue(
                    new Circle(true, System.Drawing.Color.FromArgb(255, 255, 255, 255))));
            Config.SubMenu("Drawings")
            .AddItem(
                new MenuItem("DrawQMinRange", "Min. Q range").SetValue(
                    new Circle(true, System.Drawing.Color.GreenYellow)));
            Config.SubMenu("Drawings")
            .AddItem(
                new MenuItem("DrawWard", "Ward Range").SetValue(
                    new Circle(false, System.Drawing.Color.FromArgb(255, 255, 255, 255))));

            /* [ Damage After Combo ] */
            var dmgAfterComboItem = new MenuItem("DamageAfterCombo", "Damage After Combo").SetValue(true);

            Config.SubMenu("Drawings").AddItem(dmgAfterComboItem);

            Utility.HpBarDamageIndicator.DamageToUnit = GetComboDamage;
            Utility.HpBarDamageIndicator.Enabled      = dmgAfterComboItem.GetValue <bool>();
            dmgAfterComboItem.ValueChanged           += delegate(object sender, OnValueChangeEventArgs eventArgs)
            {
                Utility.HpBarDamageIndicator.Enabled = eventArgs.GetNewValue <bool>();
            };

            Config.AddItem(
                new MenuItem("Ward", "Ward Jump / Flee").SetValue(new KeyBind('A', KeyBindType.Press)).SetFontStyle(FontStyle.Regular, SharpDX.Color.GreenYellow));
            Config.AddToMainMenu();

            map = new Map();

            Game.OnUpdate  += Game_OnUpdate;
            Drawing.OnDraw += Drawing_OnDraw;
            Obj_AI_Base.OnProcessSpellCast     += Obj_AI_Base_OnProcessSpellCast;
            Interrupter2.OnInterruptableTarget += Interrupter2_OnInterruptableTarget;
            Orbwalking.BeforeAttack            += OrbwalkingBeforeAttack;

            Notifications.AddNotification(String.Format("{0} Loaded", ChampionName), 4000);
        }
コード例 #21
0
    /// <summary>
    /// use to send notification
    /// </summary>
    /// <param name="DeliveryID"></param>
    /// <param name="NotificationSendToID"></param>
    /// <param name="IsAccepted"></param>
    private void SendNotification(int DeliveryID, int NotificationSendToID, bool IsAccepted)
    {

        Delivery ObjDelivery = new Delivery(DeliveryID);

        Notifications objNotifications = new Notifications();
        objNotifications.BitIsActive = true;
        objNotifications.BitIsReaded = false;
        objNotifications.DtmDateCreated = DateTime.Now;
        objNotifications.DtmDateReaded = DateTime.MinValue;
        objNotifications.IntFromOrganizationId = UserOrganizationId;
        objNotifications.IntFromUserId = 0;
        objNotifications.IntNotificationId = 0;
        objNotifications.IntParentNotificationId = 0;
        objNotifications.IntSourceId = 0;
        objNotifications.IntToUserId = 0;

        if (NotificationSendToID == ObjDelivery.OrganizationShipToId)
        {
            objNotifications.IntToOrganizationId = ObjDelivery.OrganizationShipToId;
            if (IsAccepted)
                objNotifications.VchNotificationText = "Delivery '" + txtDeliveryName.Text.Trim() + "'  Ship From  '" + ObjDelivery.OrganizationName + "' To '" + ObjDelivery.OrganizationShipTo + "'  is accepted";
            else
                objNotifications.VchNotificationText = "Delivery '" + txtDeliveryName.Text.Trim() + "'  Ship From  '" + ObjDelivery.OrganizationName + "' To '" + ObjDelivery.OrganizationShipTo + "'  is rejected";
        }
        else if (NotificationSendToID == ObjDelivery.OrganizationTransporterId)
        {
            objNotifications.IntToOrganizationId = ObjDelivery.OrganizationTransporterId;
            if (IsAccepted)
                objNotifications.VchNotificationText = "Delivery '" + txtDeliveryName.Text.Trim() + "'  Ship From  '" + ObjDelivery.OrganizationName + "' To '" + ObjDelivery.OrganizationTransporter + "' is accepted by Transporter '" + ObjDelivery.OrganizationTransporter+"'";
            else
                objNotifications.VchNotificationText = "Delivery '" + txtDeliveryName.Text.Trim() + "'  Ship From  '" + ObjDelivery.OrganizationName + "' To '" + ObjDelivery.OrganizationTransporter + "' is rejected by Transporter '" + ObjDelivery.OrganizationTransporter + "'";
        }

        objNotifications.InsertUpdate();
    }
コード例 #22
0
        private void Create_Click(object sender, EventArgs e)
        {
            var ps = Security.PortalSecurity.Instance;

            txtGroupName.Text = ps.InputFilter(txtGroupName.Text, Security.PortalSecurity.FilterFlag.NoScripting);
            txtGroupName.Text = ps.InputFilter(txtGroupName.Text, Security.PortalSecurity.FilterFlag.NoMarkup);

            txtDescription.Text = ps.InputFilter(txtDescription.Text, Security.PortalSecurity.FilterFlag.NoScripting);
            txtDescription.Text = ps.InputFilter(txtDescription.Text, Security.PortalSecurity.FilterFlag.NoMarkup);
            if (RoleController.Instance.GetRoleByName(PortalId, txtGroupName.Text) != null)
            {
                lblInvalidGroupName.Visible = true;
                return;
            }


            var modRoles = new List <RoleInfo>();
            var modUsers = new List <UserInfo>();

            foreach (ModulePermissionInfo modulePermissionInfo in ModulePermissionController.GetModulePermissions(ModuleId, TabId))
            {
                if (modulePermissionInfo.PermissionKey == "MODGROUP" && modulePermissionInfo.AllowAccess)
                {
                    if (modulePermissionInfo.RoleID > int.Parse(Globals.glbRoleNothing))
                    {
                        modRoles.Add(RoleController.Instance.GetRoleById(PortalId, modulePermissionInfo.RoleID));
                    }
                    else if (modulePermissionInfo.UserID > Null.NullInteger)
                    {
                        modUsers.Add(UserController.GetUserById(PortalId, modulePermissionInfo.UserID));
                    }
                }
            }

            var roleInfo = new RoleInfo()
            {
                PortalID     = PortalId,
                RoleName     = txtGroupName.Text,
                Description  = txtDescription.Text,
                SecurityMode = SecurityMode.SocialGroup,
                Status       = RoleStatus.Approved,
                IsPublic     = rdAccessTypePublic.Checked
            };
            var userRoleStatus = RoleStatus.Pending;

            if (GroupModerationEnabled)
            {
                roleInfo.Status = RoleStatus.Pending;
                userRoleStatus  = RoleStatus.Pending;
            }
            else
            {
                userRoleStatus = RoleStatus.Approved;
            }

            var objModulePermissions = new ModulePermissionCollection(CBO.FillCollection(DataProvider.Instance().GetModulePermissionsByModuleID(ModuleId, -1), typeof(ModulePermissionInfo)));

            if (ModulePermissionController.HasModulePermission(objModulePermissions, "MODGROUP"))
            {
                roleInfo.Status = RoleStatus.Approved;
                userRoleStatus  = RoleStatus.Approved;
            }

            var roleGroupId = DefaultRoleGroupId;

            if (roleGroupId < Null.NullInteger)
            {
                roleGroupId = Null.NullInteger;
            }
            roleInfo.RoleGroupID = roleGroupId;

            roleInfo.RoleID = RoleController.Instance.AddRole(roleInfo);
            roleInfo        = RoleController.Instance.GetRoleById(PortalId, roleInfo.RoleID);

            var groupUrl = Globals.NavigateURL(GroupViewTabId, "", new String[] { "groupid=" + roleInfo.RoleID.ToString() });

            if (groupUrl.StartsWith("http://") || groupUrl.StartsWith("https://"))
            {
                const int startIndex = 8;                 // length of https://
                groupUrl = groupUrl.Substring(groupUrl.IndexOf("/", startIndex, StringComparison.InvariantCultureIgnoreCase));
            }
            roleInfo.Settings.Add("URL", groupUrl);

            roleInfo.Settings.Add("GroupCreatorName", UserInfo.DisplayName);
            roleInfo.Settings.Add("ReviewMembers", chkMemberApproved.Checked.ToString());

            RoleController.Instance.UpdateRoleSettings(roleInfo, true);
            if (inpFile.PostedFile != null && inpFile.PostedFile.ContentLength > 0)
            {
                IFileManager   _fileManager   = FileManager.Instance;
                IFolderManager _folderManager = FolderManager.Instance;
                var            rootFolderPath = PathUtils.Instance.FormatFolderPath(PortalSettings.HomeDirectory);

                IFolderInfo groupFolder = _folderManager.GetFolder(PortalSettings.PortalId, "Groups/" + roleInfo.RoleID);
                if (groupFolder == null)
                {
                    groupFolder = _folderManager.AddFolder(PortalSettings.PortalId, "Groups/" + roleInfo.RoleID);
                }
                if (groupFolder != null)
                {
                    var fileName = Path.GetFileName(inpFile.PostedFile.FileName);
                    var fileInfo = _fileManager.AddFile(groupFolder, fileName, inpFile.PostedFile.InputStream, true);
                    roleInfo.IconFile = "FileID=" + fileInfo.FileId;
                    RoleController.Instance.UpdateRole(roleInfo);
                }
            }

            var notifications = new Notifications();


            RoleController.Instance.AddUserRole(PortalId, UserId, roleInfo.RoleID, userRoleStatus, true, Null.NullDate, Null.NullDate);
            if (roleInfo.Status == RoleStatus.Pending)
            {
                //Send notification to Group Moderators to approve/reject group.
                notifications.AddGroupNotification(Constants.GroupPendingNotification, GroupViewTabId, ModuleId, roleInfo, UserInfo, modRoles, modUsers);
            }
            else
            {
                //Send notification to Group Moderators informing of new group.
                notifications.AddGroupNotification(Constants.GroupCreatedNotification, GroupViewTabId, ModuleId, roleInfo, UserInfo, modRoles, modUsers);

                //Add entry to journal.
                GroupUtilities.CreateJournalEntry(roleInfo, UserInfo);
            }

            Response.Redirect(Globals.NavigateURL(GroupViewTabId, "", new String[] { "groupid=" + roleInfo.RoleID.ToString() }));
        }
コード例 #23
0
    protected void lvmessagesmain_ItemCommand(object sender, ListViewCommandEventArgs e)
    {

        if (e.CommandName == "MarkRead")
        {
            Notifications objNotifications = new Notifications(Conversion.ParseInt(e.CommandArgument));
            objNotifications.BitIsReaded = true;
            objNotifications.DtmDateReaded = DateTime.Now;
            objNotifications.InsertUpdate();
            DataSet ds = Notifications.getAllNotifications(UserInfo.GetCurrentUserInfo().UserId, UserOrganizationId, false, true, 100000, 1);
            int count = ds.Tables[0].Rows.Count;
            if (count == 0) lblnotficationcount.Text = "";
            else lblnotficationcount.Text = count.ToString();
        }
        else
            if (e.CommandName == "Delete")
            {
                Notifications objNotifications = new Notifications(Conversion.ParseInt(e.CommandArgument));
                objNotifications.BitIsActive = false;
                objNotifications.InsertUpdate();
            }

        lvmessagesmain.DataSource = Notifications.getAllNotifications(UserInfo.GetCurrentUserInfo().UserId, UserOrganizationId, false, true, 5, 1);
        lvmessagesmain.DataBind();
    }
コード例 #24
0
        public override async Task SmuggleAsync(DatabaseSmugglerOperationState state, CancellationToken cancellationToken)
        {
            using (var actions = Destination.DocumentDeletionActions())
            {
                if (Source.SupportsDocumentDeletions == false)
                {
                    return;
                }

                if (Options.OperateOnTypes.HasFlag(DatabaseItemType.Documents) == false)
                {
                    await Source.SkipDocumentDeletionsAsync(cancellationToken).ConfigureAwait(false);

                    return;
                }

                var maxEtag = _maxEtags.LastDocDeleteEtag?.IncrementBy(1);

                List <KeyValuePair <string, Etag> > deletions = null;
                try
                {
                    deletions = await Source
                                .ReadDocumentDeletionsAsync(state.LastDocDeleteEtag, maxEtag, cancellationToken)
                                .ConfigureAwait(false);
                }
                catch (Exception e)
                {
                    if (Options.IgnoreErrorsAndContinue == false)
                    {
                        throw;
                    }

                    Notifications.ShowProgress(DatabaseSmugglerMessages.DocumentDeletions_Read_Failure, e.Message);
                }

                if (deletions == null || deletions.Count == 0)
                {
                    return;
                }

                var lastEtag = state.LastDocDeleteEtag;

                foreach (var deletion in deletions)
                {
                    Notifications.OnDocumentDeletionRead(this, deletion.Key);

                    try
                    {
                        await actions
                        .WriteDocumentDeletionAsync(deletion.Key, cancellationToken)
                        .ConfigureAwait(false);
                    }
                    catch (Exception e)
                    {
                        if (Options.IgnoreErrorsAndContinue == false)
                        {
                            throw;
                        }

                        Notifications.ShowProgress(DatabaseSmugglerMessages.DocumentDeletions_Write_Failure, deletion.Key, e.Message);
                    }

                    Notifications.OnDocumentDeletionWrite(this, deletion.Key);

                    lastEtag = deletion.Value;
                }

                state.LastDocDeleteEtag = lastEtag;
            }
        }
コード例 #25
0
        public IRequest Marshall(CreatePipelineRequest createPipelineRequest)
        {
            IRequest request = new DefaultRequest(createPipelineRequest, "AmazonElasticTranscoder");
            string   target  = "EtsCustomerService.CreatePipeline";

            request.Headers["X-Amz-Target"] = target;

            request.Headers["Content-Type"] = "application/x-amz-json-1.0";
            request.HttpMethod = "POST";
            string uriResourcePath = "2012-09-25/pipelines";

            request.ResourcePath = uriResourcePath;


            using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
            {
                JsonWriter writer = new JsonWriter(stringWriter);
                writer.WriteObjectStart();

                if (createPipelineRequest != null && createPipelineRequest.IsSetName())
                {
                    writer.WritePropertyName("Name");
                    writer.Write(createPipelineRequest.Name);
                }
                if (createPipelineRequest != null && createPipelineRequest.IsSetInputBucket())
                {
                    writer.WritePropertyName("InputBucket");
                    writer.Write(createPipelineRequest.InputBucket);
                }
                if (createPipelineRequest != null && createPipelineRequest.IsSetOutputBucket())
                {
                    writer.WritePropertyName("OutputBucket");
                    writer.Write(createPipelineRequest.OutputBucket);
                }
                if (createPipelineRequest != null && createPipelineRequest.IsSetRole())
                {
                    writer.WritePropertyName("Role");
                    writer.Write(createPipelineRequest.Role);
                }

                if (createPipelineRequest != null)
                {
                    Notifications notifications = createPipelineRequest.Notifications;
                    if (notifications != null)
                    {
                        writer.WritePropertyName("Notifications");
                        writer.WriteObjectStart();
                        if (notifications != null && notifications.IsSetProgressing())
                        {
                            writer.WritePropertyName("Progressing");
                            writer.Write(notifications.Progressing);
                        }
                        if (notifications != null && notifications.IsSetCompleted())
                        {
                            writer.WritePropertyName("Completed");
                            writer.Write(notifications.Completed);
                        }
                        if (notifications != null && notifications.IsSetWarning())
                        {
                            writer.WritePropertyName("Warning");
                            writer.Write(notifications.Warning);
                        }
                        if (notifications != null && notifications.IsSetError())
                        {
                            writer.WritePropertyName("Error");
                            writer.Write(notifications.Error);
                        }
                        writer.WriteObjectEnd();
                    }
                }

                if (createPipelineRequest != null)
                {
                    PipelineOutputConfig contentConfig = createPipelineRequest.ContentConfig;
                    if (contentConfig != null)
                    {
                        writer.WritePropertyName("ContentConfig");
                        writer.WriteObjectStart();
                        if (contentConfig != null && contentConfig.IsSetBucket())
                        {
                            writer.WritePropertyName("Bucket");
                            writer.Write(contentConfig.Bucket);
                        }
                        if (contentConfig != null && contentConfig.IsSetStorageClass())
                        {
                            writer.WritePropertyName("StorageClass");
                            writer.Write(contentConfig.StorageClass);
                        }

                        if (contentConfig != null && contentConfig.Permissions != null && contentConfig.Permissions.Count > 0)
                        {
                            List <Permission> permissionsList = contentConfig.Permissions;
                            writer.WritePropertyName("Permissions");
                            writer.WriteArrayStart();

                            foreach (Permission permissionsListValue in permissionsList)
                            {
                                writer.WriteObjectStart();
                                if (permissionsListValue != null && permissionsListValue.IsSetGranteeType())
                                {
                                    writer.WritePropertyName("GranteeType");
                                    writer.Write(permissionsListValue.GranteeType);
                                }
                                if (permissionsListValue != null && permissionsListValue.IsSetGrantee())
                                {
                                    writer.WritePropertyName("Grantee");
                                    writer.Write(permissionsListValue.Grantee);
                                }

                                if (permissionsListValue != null && permissionsListValue.Access != null && permissionsListValue.Access.Count > 0)
                                {
                                    List <string> accessList = permissionsListValue.Access;
                                    writer.WritePropertyName("Access");
                                    writer.WriteArrayStart();

                                    foreach (string accessListValue in accessList)
                                    {
                                        writer.Write(StringUtils.FromString(accessListValue));
                                    }

                                    writer.WriteArrayEnd();
                                }
                                writer.WriteObjectEnd();
                            }
                            writer.WriteArrayEnd();
                        }
                        writer.WriteObjectEnd();
                    }
                }

                if (createPipelineRequest != null)
                {
                    PipelineOutputConfig thumbnailConfig = createPipelineRequest.ThumbnailConfig;
                    if (thumbnailConfig != null)
                    {
                        writer.WritePropertyName("ThumbnailConfig");
                        writer.WriteObjectStart();
                        if (thumbnailConfig != null && thumbnailConfig.IsSetBucket())
                        {
                            writer.WritePropertyName("Bucket");
                            writer.Write(thumbnailConfig.Bucket);
                        }
                        if (thumbnailConfig != null && thumbnailConfig.IsSetStorageClass())
                        {
                            writer.WritePropertyName("StorageClass");
                            writer.Write(thumbnailConfig.StorageClass);
                        }

                        if (thumbnailConfig != null && thumbnailConfig.Permissions != null && thumbnailConfig.Permissions.Count > 0)
                        {
                            List <Permission> permissionsList = thumbnailConfig.Permissions;
                            writer.WritePropertyName("Permissions");
                            writer.WriteArrayStart();

                            foreach (Permission permissionsListValue in permissionsList)
                            {
                                writer.WriteObjectStart();
                                if (permissionsListValue != null && permissionsListValue.IsSetGranteeType())
                                {
                                    writer.WritePropertyName("GranteeType");
                                    writer.Write(permissionsListValue.GranteeType);
                                }
                                if (permissionsListValue != null && permissionsListValue.IsSetGrantee())
                                {
                                    writer.WritePropertyName("Grantee");
                                    writer.Write(permissionsListValue.Grantee);
                                }

                                if (permissionsListValue != null && permissionsListValue.Access != null && permissionsListValue.Access.Count > 0)
                                {
                                    List <string> accessList = permissionsListValue.Access;
                                    writer.WritePropertyName("Access");
                                    writer.WriteArrayStart();

                                    foreach (string accessListValue in accessList)
                                    {
                                        writer.Write(StringUtils.FromString(accessListValue));
                                    }

                                    writer.WriteArrayEnd();
                                }
                                writer.WriteObjectEnd();
                            }
                            writer.WriteArrayEnd();
                        }
                        writer.WriteObjectEnd();
                    }
                }

                writer.WriteObjectEnd();

                string snippet = stringWriter.ToString();
                request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
            }


            return(request);
        }
コード例 #26
0
 protected override void RunPreSaveValidationCore()
 {
     Notifications.AddError("Cannot save an empty soul - Please change the soul type");
     base.RunPreSaveValidationCore();
 }
コード例 #27
0
 private void Start()
 {
     notifScript  = this;
     text         = GetComponent <TextMeshProUGUI>();
     text.enabled = false;
 }
コード例 #28
0
        public ScrollContentPresenter()
        {
            InitializeScrollContentPresenter();

            Notifications.ObserveDidLiveScroll(this, OnLiveScroll);
        }
コード例 #29
0
 /// <summary>
 /// This method adds a new notification to this exception instance according to the
 /// specified parameter, and retrieves this exception object.
 /// </summary>
 /// <param name="notification">Business operation notification</param>
 /// <returns>This exception object</returns>
 /// <remarks>
 /// This method can be used directly in throw statement.
 /// </remarks>
 public BusinessOperationException AddNotification(NotificationItem notification)
 {
     EnsureNotifications();
     Notifications.Add(notification);
     return(this);
 }
コード例 #30
0
        public NativeScrollContentPresenter()
        {
            Notifications.ObserveDidLiveScroll(this, OnLiveScroll);

            DrawsBackground = false;
        }
コード例 #31
0
ファイル: TranscoderUtility.cs プロジェクト: Walliee/vTweet-2
    public static void Transcode(string inputS3Key,string outputS3Key, string bucketName)
    {
        var email = "*****@*****.**";

            // Create a topic the the pipeline to used for notifications
            var topicArn = CreateTopic(email);

            // Create the IAM role for the pipeline
            var role = CreateIamRole();

            var etsClient = new AmazonElasticTranscoderClient();

            var notifications = new Notifications()
            {
                Completed = topicArn,
                Error = topicArn,
                Progressing = topicArn,
                Warning = topicArn
            };

            // Create the Elastic Transcoder pipeline for transcoding jobs to be submitted to.
            //var pipeline = etsClient.CreatePipeline(new CreatePipelineRequest
            //{
            //    Name = "MyVideos" + UNIQUE_POSTFIX,
            //    InputBucket = bucketName,
            //    OutputBucket = bucketName,
            //    Notifications = notifications,
            //    Role = role.Arn
            //}).Pipeline;
            var listPipeLines = etsClient.ListPipelines();
            var pipeline=listPipeLines.Pipelines[0];

            // Create a job to transcode the input file
            etsClient.CreateJob(new CreateJobRequest
            {
                PipelineId = pipeline.Id,
                Input = new JobInput
                {
                    AspectRatio = "auto",
                    Container = "auto",
                    FrameRate = "auto",
                    Interlaced = "auto",
                    Resolution = "auto",
                    Key = inputS3Key
                },
                Output =( new CreateJobOutput
                {
                    ThumbnailPattern = "",
                    Rotate = "0",
                    // Generic 720p: Go to http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/create-job.html#PresetId to see a list of some
                    // of the support presets or call the ListPresets operation to get the full list of available presets
                    PresetId = "1351620000000-100010",
                    Key = outputS3Key.Substring(0,outputS3Key.LastIndexOf("."))+".mp4"

                })
            });
    }
コード例 #32
0
 public GrowlNotifications(IApplicationConfiguration applicationConfiguration, Notifications notifications)
 {
     InitializeComponent();
     this.applicationConfiguration         = applicationConfiguration;
     this.Notifications                    = notifications;
     this.NotificationsControl.DataContext = this.Notifications;
 }
コード例 #33
0
ファイル: Notifications.cs プロジェクト: imann24/Beauty
 // Use this for initialization
 void Start()
 {
     Instance = this;
 }
コード例 #34
0
ファイル: Portfolio.cs プロジェクト: Noorivandi/SeatShare
 protected virtual void ClearNavigationProperties()
 {
     Instruments.Clear();
     Notifications.Clear();
 }
コード例 #35
0
    private void SendNotification(int LoadId)
    {

        Loads loadObject = new Loads(LoadId);

        Notifications objNotifications = new Notifications();
        objNotifications.BitIsActive = true;
        objNotifications.BitIsReaded = false;
        objNotifications.DtmDateCreated = DateTime.Now;
        objNotifications.DtmDateReaded = DateTime.MinValue;
        objNotifications.IntFromOrganizationId = UserOrganizationId;
        objNotifications.IntFromUserId = 0;
        objNotifications.IntNotificationId = 0;
        objNotifications.IntParentNotificationId = 0;
        objNotifications.IntSourceId = 0;
        objNotifications.IntToOrganizationId = Conversion.ParseInt(hidOrgID.Value);
        objNotifications.IntToUserId = 0;
        objNotifications.VchNotificationText = "Load  " + txtLoadnumber.Text.Trim() + "  Ship From  " + loadObject.TransferOrganization + " To " + loadObject.HaulerOrganization + " .";
        objNotifications.InsertUpdate();
    }
コード例 #36
0
        /// <summary>
        /// Add To Notifications
        /// </summary>
        /// <param name="id"></param>
        /// <param name="notType"></param>
        public void addToNotifications(int id, int notType)
        {
            var photo = db.Photo.Find(id);

            Notifications not = new Notifications();
            not.NOT_U_Id = photo.PH_US_Id;
            not.NOT_NT_Id = notType;
            not.NOT_PH_Id = id;
            not.NOT_Leido = false;
            not.NOT_Date = DateTime.Now;
            if (notType == 1)
            {
                not.NOT_Description = Session["UserName"].ToString() + Session["UserLastname"].ToString() + " Ha marcado como favorita una foto tuya";
            }
            else if (notType == 2)
            {
                not.NOT_Description = Session["UserName"].ToString() + Session["UserLastname"].ToString() + " Ha comprado una foto tuya";
            }
            else if (notType == 3)
            {
                not.NOT_Description = Session["UserName"].ToString() + Session["UserLastname"].ToString() + " Ha indicado que le gusta una foto tuya";
            }

            try
            {
                db.Notifications.Add(not);

                var noti = db.Notifications.Where(n => n.NOT_U_Id == photo.PH_US_Id && n.NOT_Leido == false);
                Session["Notifications"] = noti.Count();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                RedirectToAction("ErrorPage", "Error");
            }
        }
コード例 #37
0
 private void Publish(Notifications.Notification notification)
 {
     this._exchangePublisher.Publish(notification.TypeName, JsonConvert.SerializeObject(notification));
 }
コード例 #38
0
        public async Task<ActionResult> ExternalLoginConfirmation(ExternalLoginConfirmationViewModel model, string returnUrl)
        {
            if (User.Identity.IsAuthenticated)
            {
                return RedirectToAction("Index", "Manage");
            }

            if (ModelState.IsValid)
            {
                // Get the information about the user from the external login provider
                var info = await AuthenticationManager.GetExternalLoginInfoAsync();
                if (info == null)
                {
                    return View("ExternalLoginFailure");
                }
                var user = new ApplicationUser
                {
                    UserName = model.Username,
                    Email = model.Email,

                };
               
                var result = await UserManager.CreateAsync(user);
                if (result.Succeeded)
                {
                    result = await UserManager.AddLoginAsync(user.Id, info.Login);
                    if (model.SignupAS == "1")
                    {
                        var roleresult = UserManager.AddToRole(user.Id, Status.Student);
                        Student stu = new Student();
                        stu.StudentID = new Guid(user.Id);
                        stu.DateCreated = DateTime.Today;
                        Random rnd = new Random();
                        int filename = rnd.Next(1, 4);
                        stu.ProfileImage = "/Profiles/default/" + filename + ".png";
                        stu.Username = user.UserName;
                        _dbContext.Students.Add(stu);

                        Notifications notify = new Notifications();
                        notify.ID = Guid.NewGuid();
                        notify.isRead = false;
                        notify.Message = "/Profiles/default/admin.png^Admin^You have successfully created your account. You can click ask question to post your first question.";
                        notify.UserName = stu.Username;
                        notify.postedTime = DateTime.Now;
                        _dbContext.notifications.Add(notify);

                        Notifications notify2 = new Notifications();
                        notify2.ID = Guid.NewGuid();
                        notify2.isRead = false;
                        notify2.Message = "/Profiles/default/admin.png^Admin^We now have Arabic Language support as well.";
                        notify2.UserName = stu.Username;
                        notify2.postedTime = DateTime.Now;
                        _dbContext.notifications.Add(notify2);

                        _dbContext.SaveChanges();

                    }
                    else
                    {
                        var roleresult = UserManager.AddToRole(user.Id, Status.Tutor);
                        Tutor tutor = new Tutor();
                        tutor.DateOfBirth = DateTime.Today;
                        tutor.TutorID = new Guid(user.Id);
                        tutor.DateCreated = DateTime.Today;
                        tutor.IsCompletedProfile = false;
                        tutor.Username = user.UserName;
                        Random rnd = new Random();
                        int filename = rnd.Next(1, 4);
                        tutor.ProfileImage = "/Profiles/default/" + filename + ".png";
                        _dbContext.Tutors.Add(tutor);

                        Notifications notify = new Notifications();
                        notify.ID = Guid.NewGuid();
                        notify.isRead = false;
                        notify.Message = "/Profiles/default/admin.png^Admin^Please complete your profile so that you have full access.";
                        notify.UserName = tutor.Username;
                        notify.postedTime = DateTime.Now;
                        _dbContext.notifications.Add(notify);

                        _dbContext.SaveChanges();
                    }


                    if (result.Succeeded)
                    {
                        await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false);
                       
                        return RedirectToLocal(returnUrl);
                    }
                }
                AddErrors(result);
            }

            ViewBag.ReturnUrl = returnUrl;
            return View(model);
        }
コード例 #39
0
    private void SendNotificationForReject(int LoadId)
    {

        Loads loadObject = new Loads(LoadId);

        Notifications objNotifications = new Notifications();
        objNotifications.BitIsActive = true;
        objNotifications.BitIsReaded = false;
        objNotifications.DtmDateCreated = DateTime.Now;
        objNotifications.DtmDateReaded = DateTime.MinValue;
        objNotifications.IntFromOrganizationId = UserOrganizationId;
        objNotifications.IntFromUserId = 0;
        objNotifications.IntNotificationId = 0;
        objNotifications.IntParentNotificationId = 0;
        objNotifications.IntSourceId = 0;
        objNotifications.IntToOrganizationId = loadObject.OrganizationId;
        objNotifications.IntToUserId = 0;
        objNotifications.VchNotificationText = "Load " + loadObject.LoadNumber + "that sent from " + loadObject.TransferOrganization + " to " + loadObject.HaulerOrganization + " Rejected because " + txtNotes.Text.Trim();
        objNotifications.InsertUpdate();
    }
コード例 #40
0
        protected IActionResult RequestResponse(HttpStatusCode httpStatusCode, string uri = null, bool isError = false, object result = null)
        {
            if (IsAValidOperation() && !isError)
            {
                if (httpStatusCode == HttpStatusCode.Created)
                {
                    return(Created(uri, new
                    {
                        success = true,
                        data = result,
                        notifications = Notifications.GetNotifications(NotificationType.Info)
                    }));
                }

                if (httpStatusCode == HttpStatusCode.NotFound)
                {
                    return(Created(uri, new
                    {
                        success = true,
                        data = result
                    }));
                }

                if (httpStatusCode == HttpStatusCode.NoContent)
                {
                    return(Created(uri, new
                    {
                        success = true,
                        data = result
                    }));
                }

                return(Ok(new
                {
                    success = true,
                    data = result,
                    notifications = Notifications.GetNotifications(NotificationType.Info)
                }));
            }

            switch (httpStatusCode)
            {
            case HttpStatusCode.UnprocessableEntity:
                return(UnprocessableEntity(new
                {
                    success = false,
                    errors = result ?? Notifications.GetNotifications(NotificationType.Error)
                }));

            case HttpStatusCode.NotFound:
                return(NotFound(new
                {
                    success = false,
                    errors = result ?? Notifications.GetNotifications(NotificationType.Error)
                }));

            case HttpStatusCode.Conflict:
                return(NotFound(new
                {
                    success = false,
                    errors = result ?? Notifications.GetNotifications(NotificationType.Error)
                }));

            case HttpStatusCode.Unauthorized:
                return(Unauthorized());

            case HttpStatusCode.InternalServerError:
                return(new InternalServerError(result));

            default:
                return(BadRequest(new
                {
                    success = false,
                    errors = result ?? Notifications.GetNotifications(NotificationType.Error)
                }));
            }
        }
コード例 #41
0
        private void OnObjAiBaseTeleport(Obj_AI_Base sender, EloBuddy.SDK.Events.Teleport.TeleportEventArgs args)
        {
            try
            {
                //var packet = Packet.S2C.Teleport.Decoded(sender, args);
                var teleport = _teleportObjects.FirstOrDefault(r => r.Hero.NetworkId == sender.NetworkId);
                if (teleport != null)
                {
                    var duration = args.Duration;
                    if (args.Type == TeleportType.Recall)
                    {
                        duration = teleport.Hero.HasBuff("exaltedwithbaronnashor") ? 4000 : 8000;
                        if (LeagueSharp.Common.Utility.Map.GetMap().Type == LeagueSharp.Common.Utility.Map.MapType.CrystalScar)
                        {
                            duration = 4500;
                        }
                    }
                    if (args.Type == TeleportType.Shen)
                    {
                        duration = 3000;
                    }
                    if (args.Type == TeleportType.TwistedFate)
                    {
                        duration = 1500;
                    }
                    if (args.Type == TeleportType.Teleport)
                    {
                        duration = 4000;
                    }
                    teleport.Duration   = duration;
                    teleport.LastStatus = args.Status;
                    teleport.LastType   = args.Type;

                    if (args.Status == TeleportStatus.Finish)
                    {
                        if (Menu.Item(Name + "NotificationFinished").GetValue <bool>())
                        {
                            Notifications.AddNotification(teleport.Hero.ChampionName + " Finished.", 5000)
                            .SetTextColor(Color.GreenYellow);
                        }
                        if (Menu.Item(Name + "ChatFinished").GetValue <bool>())
                        {
                            Chat.Print(
                                string.Format("<font color='#8ACC25'>Finished: {0}</font>", teleport.Hero.ChampionName));
                        }
                    }

                    if (args.Status == TeleportStatus.Abort)
                    {
                        if (Menu.Item(Name + "NotificationAborted").GetValue <bool>())
                        {
                            Notifications.AddNotification(teleport.Hero.ChampionName + " Aborted.", 5000)
                            .SetTextColor(Color.Orange);
                        }
                        if (Menu.Item(Name + "ChatAborted").GetValue <bool>())
                        {
                            Chat.Print(
                                string.Format("<font color='#CC0000'>Aborted: {0}</font>", teleport.Hero.ChampionName));
                        }
                    }

                    if (args.Status == TeleportStatus.Start)
                    {
                        if (Menu.Item(Name + "NotificationStarted").GetValue <bool>())
                        {
                            Notifications.AddNotification(teleport.Hero.ChampionName + " Started.", 5000)
                            .SetTextColor(Color.White);
                        }
                        if (Menu.Item(Name + "ChatStarted").GetValue <bool>())
                        {
                            Chat.Print(string.Format("<font color='#FFFFFF'>Started: {0}</font>", teleport.Hero.ChampionName));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
コード例 #42
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Option,Image")] ChooseUs chooseUs, IFormFile Img)
        {
            var user = await _userManager.GetUserAsync(User);

            if (user == null)
            {
                return(RedirectToAction(nameof(AccountController.Login), "Account"));
            }
            if (id != chooseUs.ID)
            {
                return(NotFound());
            }

            if (Img == null)
            {
                if (chooseUs != null)
                {
                    var notification = new Notifications();
                    TempData["sms"]      = "Se han guardado los cambios correctamente";
                    ViewBag.sms          = TempData["sms"];
                    notification.Detalle = ViewBag.sms;
                    notification.Section = "Motivos para elegirnos";
                    notification.Tipo    = "check";
                    notification.Time    = DateTime.Now;
                    notification         = _empleadosData.AddNotification(notification);
                    _context.Update(chooseUs);
                    _context.SaveChanges();
                    return(RedirectToAction(nameof(Index)));
                }
            }
            else
            {
                var image = Img.FileName;

                try
                {
                    if (image != null)
                    {
                        var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/images", Img.FileName);

                        using (var stream = new FileStream(path, FileMode.Create))
                        {
                            await Img.CopyToAsync(stream);
                        }
                        var notification = new Notifications();
                        chooseUs.Image       = Img.FileName;
                        TempData["sms"]      = "Se han guardado los cambios correctamente";
                        ViewBag.sms          = TempData["sms"];
                        notification.Detalle = ViewBag.sms;
                        notification.Section = "Motivos para elegirnos";
                        notification.Tipo    = "check";
                        notification.Time    = DateTime.Now;
                        notification         = _empleadosData.AddNotification(notification);

                        _context.Update(chooseUs);
                        await _context.SaveChangesAsync();
                    }
                }

                catch (DbUpdateConcurrencyException)
                {
                    if (!ChooseUsExists(chooseUs.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(chooseUs));
        }
コード例 #43
0
        private void UseSpells(bool useQ, bool useW, bool useE, bool useR, string source)
        {
//            if (source == "Harass" && !ManaManager.HasMana(source))
//                return;

            var range         = E.IsReady() ? E.Range : R.Range;
            var focusSelected = menu.Item("selected", true).GetValue <bool>();

            var target = TargetSelector.GetTarget(range, TargetSelector.DamageType.Magical);

            //     if (target != null)
            //          throw new NotImplementedException() ;
            if (TargetSelector.GetSelectedTarget() != null)
            {
                if (focusSelected && TargetSelector.GetSelectedTarget().Distance(Player.ServerPosition) < range)
                {
                    target = TargetSelector.GetSelectedTarget();
                }
            }

            bool hasMana = ManaManager.FullManaCast();
            bool waitW   = menu.Item("waitW", true).GetValue <bool>();

            var dmg = GetComboDamage(target);

            ItemManager.Target = target;

            //see if killable
            if (dmg > target.Health - 50)
            {
                ItemManager.KillableTarget = true;
            }

            ItemManager.UseTargetted = true;

            if (useW && target != null && Player.Distance(target.Position) <= W.Range && W.IsReady())
            {
                PredictionOutput pred = Prediction.GetPrediction(target, 1.25f);
                if (pred.Hitchance >= HitChance.High && W.IsReady())
                {
                    W.Cast(pred.CastPosition);
                }
            }

            if (useE && target != null && E.IsReady() && Player.Distance(target.Position) < E.Range)
            {
                if (!waitW || W.IsReady())
                {
                    CastE(target);
                    return;
                }
            }

            if (useQ && Q.IsReady() && Player.Distance(target.Position) <= Q.Range)
            {
                Notifications.AddNotification("sdgdfgdsgsdfg", 100);
                Q.CastOnUnit(target);
            }

            //R
            if (target != null && R.IsReady())
            {
                useR = rTarget(target) && useR;
                if (useR)
                {
                    CastR(target, dmg);
                }
            }
        }
コード例 #44
0
        /// <summary>
        /// Game Loaded Method
        /// </summary>
        private void OnGameLoad(EventArgs args)
        {
            //Load reached
            Game.PrintChat("<font color = \"#FFB6C1\"> Test </font> Test2 <font color = \"#00FFFF\"> Test3 </font>");
            Notifications.AddNotification("Test3", 2000);


            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            if (Player.ChampionName.ToLower() != "veigar") // check if the current champion is supported
            {
                return;                                    // stop programm
            }
            InitializeSpells();

            InitializeMenu();
            LoadChampionMenu();



            // set spells prediction values, not used on Nunu
            // Method Spell.SetSkillshot(float delay, float width, float speed, bool collision, SkillshotType type)
            // Q.SetSkillshot(0.25f, 80f, 1800f, false, SkillshotType.SkillshotLine);

            /*           Q = new Spell(SpellSlot.Q, 125); // create Q spell with a range of 125 units
             *         W = new Spell(SpellSlot.W, 700); // create W spell with a range of 700 units
             *         E = new Spell(SpellSlot.E, 550); // create E spell with a range of 550 units
             *         R = new Spell(SpellSlot.R, 650); // create R spell with a range of 650 units
             */
            // create Dfg item id 3128 and range of 750 units
            // Constructor Items.Item(int id, float range)
            //            Dfg = new Items.Item(3128, 750); // or use ItemId enum
            //            Dfg = new Items.Item((int)ItemId.Deathfire_Grasp, 750);



            // Menu.AddItem(MenuItem item) returns added MenuItem
            // Constructor MenuItem(string name, string displayName)
            // .SetValue(true) on/off button
//            spellMenu.AddItem(new MenuItem("useQ", "Use Q").SetValue(true));
//            spellMenu.AddItem(new MenuItem("useW", "Use W").SetValue(true));
//            spellMenu.AddItem(new MenuItem("useE", "Use E").SetValue(true));
//            spellMenu.AddItem(new MenuItem("useR", "Use R to Farm Stacks").SetValue(false));



            // create MenuItem 'ConsumeHealth' as Slider
            // Constructor Slider(int value, int min, int max)
//            spellMenu.AddItem(new MenuItem("ConsumeHealth", "Consume below HP").SetValue(new Slider(40, 1, 100)));

            // subscribe to Drawing event
            Drawing.OnDraw += Drawing_OnDraw;

            // subscribe to Update event gets called every game update around 10ms
            Game.OnUpdate += Game_OnGameUpdate;



            // print text in local chat
            Game.PrintChat("OnLoad complete");
            Notifications.AddNotification("OnLoad complete", 2000);
        }
コード例 #45
0
        public async Task<ActionResult> RegisterTutor(TutorRegisterModel model)
        {
            if (ModelState.IsValid)
            {
                var user = new ApplicationUser { UserName = model.UserName, Email = model.Email };
                var result = await UserManager.CreateAsync(user, model.Password);
            
                if (result.Succeeded)
                {
                    var roleresult = UserManager.AddToRole(user.Id, "Tutor");
                    await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false);
                    Tutor tutor = Mapper.Map<TutorRegisterModel, Tutor>(model);
                    tutor.TutorID = new Guid(user.Id);
                    tutor.DateCreated = DateTime.Today;
                    tutor.IsCompletedProfile = false;
                    tutor.Username = user.UserName;
                    Random rnd = new Random();
                    int filename = rnd.Next(1, 4);
                    tutor.ProfileImage = "/Profiles/default/"+filename+".png";
                    _dbContext.Tutors.Add(tutor);
                    _dbContext.SaveChanges();

                    Notifications notify = new Notifications();
                    notify.ID = Guid.NewGuid();
                    notify.isRead = false;
                    notify.Message = "/Profiles/default/admin.png^Admin^Please complete your profile so that you have full access.";
                    notify.UserName = tutor.Username;
                    notify.postedTime = DateTime.Now;
                    _dbContext.notifications.Add(notify);
                    _dbContext.SaveChanges();
                    // For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=320771
                    // Send an email with this link
                    // string code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id);
                    // var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
                    // await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking <a href=\"" + callbackUrl + "\">here</a>");

                    return RedirectToAction("Index", "Tutors");
                }
                else
                {
                    var userE= _dbContext.Users.Where(c => c.Email == model.Email).FirstOrDefault();
                    var userU = _dbContext.Users.Where(c => c.UserName == model.UserName).FirstOrDefault();
                    if (userE != null)
                        ModelState.AddModelError("", "Email already exists.");
                    if(userU!=null)
                        ModelState.AddModelError("", "Username already exists.");
                    ViewBag.error = "registerT";
                    return View("../Home/Index", model);
                }
               
            }

            // If we got this far, something failed, redisplay form
            // return View("Index",model);
            return RedirectToAction("Index", "Home");
        }
コード例 #46
0
ファイル: PluginLoader.cs プロジェクト: uio25371555/LSharp
        public PluginLoader()
        {
            if (!_loaded)
            {
                var webRequest = WebRequest.Create(@"https://raw.githubusercontent.com/xSalice/LSharp/master/xSaliceResurrected/version.txt");

                using (var response = webRequest.GetResponse())
                    using (var content = response.GetResponseStream())
                        if (content != null)
                        {
                            using (var reader = new StreamReader(content))
                            {
                                var strContent = reader.ReadToEnd();

                                Notifications.AddNotification("Latest Version: " + strContent, 10000);
                                Notifications.AddNotification("Version Loaded: " + Assembly.GetExecutingAssembly().GetName().Version, 10000);
                                if (strContent != Assembly.GetExecutingAssembly().GetName().Version.ToString())
                                {
                                    Notifications.AddNotification("Please Update Assembly!!!");
                                }
                            }
                        }

                switch (ObjectManager.Player.ChampionName.ToLower())
                {
                case "ahri":
                    new Ahri();
                    _loaded = true;
                    break;

                case "akali":
                    new Akali();
                    _loaded = true;
                    break;

                case "cassiopeia":
                    new Cassiopeia();
                    _loaded = true;
                    break;

                case "ashe":
                    _loaded = true;
                    new Ashe();
                    break;

                case "azir":
                    new Azir();
                    _loaded = true;;
                    break;

                case "chogath":
                    new Chogath();
                    _loaded = true;
                    break;

                case "corki":
                    new Corki();
                    _loaded = true;
                    break;

                case "ekko":
                    new Ekko();
                    _loaded = true;
                    break;

                case "ezreal":
                    new Ezreal();
                    _loaded = true;
                    break;

                case "fiora":
                    new Fiora();
                    _loaded = true;
                    break;

                case "irelia":
                    new Irelia();
                    _loaded = true;
                    break;

                case "karthus":
                    new Karthus();
                    _loaded = true;
                    break;

                case "katarina":
                    new Katarina();
                    _loaded = true;
                    break;

                case "kogmaw":
                    new KogMaw();
                    _loaded = true;
                    break;

                case "lissandra":
                    new Lissandra();
                    _loaded = true;
                    break;

                case "lucian":
                    new Lucian();
                    _loaded = true;
                    break;

                case "jayce":
                    new Jayce();
                    _loaded = true;
                    break;

                case "orianna":
                    new Orianna();
                    _loaded = true;
                    break;

                case "rumble":
                    new Rumble();
                    _loaded = true;
                    break;

                case "syndra":
                    new Syndra();
                    _loaded = true;
                    break;

                case "viktor":
                    new Viktor();
                    _loaded = true;
                    break;

                case "vladimir":
                    new Vladimir();
                    _loaded = true;
                    break;

                case "urgot":
                    new Urgot();
                    _loaded = true;
                    break;

                case "zyra":
                    new Zyra();
                    _loaded = true;
                    break;

                /*
                 * case "anivia":
                 *  new Anivia();
                 *  loaded = true;
                 *  Game.PrintChat("<font color = \"#FFB6C1\">xSalice's " + ObjectManager.Player.ChampionName + " Loaded!</font>");
                 *  break;
                 * case "annie":
                 *  new Annie();
                 *  loaded = true;
                 *  Game.PrintChat("<font color = \"#FFB6C1\">xSalice's " + ObjectManager.Player.ChampionName + " Loaded!</font>");
                 *  break;
                 * case "blitzcrank":
                 *  new Blitzcrank();
                 *  loaded = true;
                 *  Game.PrintChat("<font color = \"#FFB6C1\">xSalice's " + ObjectManager.Player.ChampionName + " Loaded!</font>");
                 *  break;
                 * case "fizz":
                 *  new Fizz();
                 *  loaded = true;
                 *  Game.PrintChat("<font color = \"#FFB6C1\">xSalice's " + ObjectManager.Player.ChampionName + " Loaded!</font>");
                 *  break;
                 * case "veigar":
                 *  new Veigar();
                 *  loaded = true;
                 *  Game.PrintChat("<font color = \"#FFB6C1\">xSalice's " + ObjectManager.Player.ChampionName + " Loaded!</font>");
                 *  break;
                 * case "velkoz":
                 *  new Velkoz();
                 *  loaded = true;
                 *  Game.PrintChat("<font color = \"#FFB6C1\">xSalice's " + ObjectManager.Player.ChampionName + " Loaded!</font>");
                 *  break;
                 * case "yasuo":
                 *  new Yasuo();
                 *  loaded = true;
                 *  Game.PrintChat("<font color = \"#FFB6C1\">xSalice's " + ObjectManager.Player.ChampionName + " Loaded!</font>");
                 *  break;
                 * case "zed":
                 *  new Zed();
                 *  loaded = true;
                 *  Game.PrintChat("<font color = \"#FFB6C1\">xSalice's " + ObjectManager.Player.ChampionName + " Loaded!</font>");
                 *  break;
                 */
                default:
                    Notifications.AddNotification(ObjectManager.Player.ChampionName + " not supported!!", 10000);
                    break;
                }
            }
        }
コード例 #47
0
    private void SendNotification(int invoiceId)
    {

        try
        {
            Invoice objInvoice = new Invoice(invoiceId);

            Notifications objNotifications = new Notifications();
            objNotifications.BitIsActive = true;
            objNotifications.BitIsReaded = false;
            objNotifications.DtmDateCreated = DateTime.Now;
            objNotifications.DtmDateReaded = DateTime.MinValue;
            objNotifications.IntFromOrganizationId = UserOrganizationId;
            objNotifications.IntFromUserId = 0;
            objNotifications.IntNotificationId = 0;
            objNotifications.IntParentNotificationId = 0;
            objNotifications.IntSourceId = 0;
            objNotifications.IntToOrganizationId = objInvoice.Organizationid;
            objNotifications.IntToUserId = 0;
            objNotifications.VchNotificationText = "Invoice with Invoice Number " + objInvoice.InvoiceNumber + " has been paid by " + objInvoice.OrganizationForName;
            objNotifications.InsertUpdate();
        }
        catch (Exception ex)
        {
            new SqlLog().InsertSqlLog(0, "ViewInvoice.SendNotification", ex);
        }
    }
コード例 #48
0
ファイル: Frm_Ban.cs プロジェクト: thachgiasoft/QuanLyNhaHang
        private void btn_LuuLai_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            string error    = "";
            bool   isUpdate = false;
            bool   KiemTra  = false;

            if (_listUpdate.Count > 0)
            {
                foreach (int id in _listUpdate)
                {
                    Ban ban = new Ban();
                    ban.id_ban     = int.Parse(gridView1.GetRowCellValue(id, "id_ban").ToString());
                    ban.tenban     = gridView1.GetRowCellValue(id, "tenban").ToString();
                    ban.id_loaiban = int.Parse(gridView1.GetRowCellValue(id, "id_loaiban").ToString());
                    ban.trangthai  = gridView1.GetRowCellValue(id, "trangthai").ToString();
                    if (_ban_Bll.KiemTraBan(ban))
                    {
                        if (_ban_Bll.KiemTraBanTonTai(ban.tenban, ban.id_ban) == 1)
                        {
                            _ban_Bll.CapNhatBan(ban);
                            isUpdate = true;
                        }
                        else
                        {
                            if (error == "")
                            {
                                error = ban.tenban;
                            }
                            else
                            {
                                error += " | " + ban.tenban;
                            }
                        }
                    }
                    else
                    {
                        KiemTra = true;
                    }
                }
            }
            if (isUpdate == true)
            {
                if (error.Length == 0)
                {
                    Notifications.Success("Cập dữ liệu thành công.");
                }
                else
                {
                    Notifications.Error("Có lỗi xảy ra khi cập nhật dữ liệu. Các bàn chưa được cập nhật (" + error + "). Lỗi: Tên bàn đã tồn tại.");
                }
            }
            else if (KiemTra == true)
            {
                Notifications.Error("Có lỗi xảy ra khi cập nhật dữ liệu. Lỗi: Dữ liệu không được rỗng.");
            }
            else
            {
                Notifications.Error("Có lỗi xảy ra khi cập nhật dữ liệu. Lỗi: Tên bàn đã tồn tại.");
            }
            btn_LuuLai.Enabled = false;
            LoadDataSource();
        }
コード例 #49
0
    protected void lvmessagesmain_ItemCommand(object sender, ListViewCommandEventArgs e)
    {
       
                if (e.CommandName == "MarkRead")
                {
                    Notifications objNotifications = new Notifications(Conversion.ParseInt(e.CommandArgument));
                    objNotifications.BitIsReaded = true;
                    objNotifications.DtmDateReaded = DateTime.Now;
                    objNotifications.InsertUpdate();
                }
                else
                    if (e.CommandName == "Delete")
                    {
                        Notifications objNotifications = new Notifications(Conversion.ParseInt(e.CommandArgument));
                        objNotifications.BitIsActive = false;
                        objNotifications.InsertUpdate();
                    }

        lvmessagesmain.DataSource = Notifications.getAllNotifications(UserInfo.GetCurrentUserInfo().UserId, UserOrganizationId, false, true, 10, 1);
        lvmessagesmain.DataBind();
    }
        public ActionResult Save(
            int eventId,
            int portalId,
            int tabId,
            int groupId,
            string name,
            string details,
            DateTime startTime,
            DateTime endTime,
            string street,
            string city,
            string region,
            string postalCode,
            string country,
            int maxAttendees,
            bool enableRsvp,
            bool showGuestList)
        {
            try
            {
                var objSecurity = new PortalSecurity();

                name = GetFilteredValue(objSecurity, name);
                details = GetFilteredValue(objSecurity, details);
                street = GetFilteredValue(objSecurity, street);
                city = GetFilteredValue(objSecurity, city);
                region = GetFilteredValue(objSecurity, region);
                postalCode = GetFilteredValue(objSecurity, postalCode);
                country = GetFilteredValue(objSecurity, country);

                if (string.IsNullOrEmpty(name)) return Json(new { Result = "failure" });

                var objEvent = new EventInfo
                    {
                        EventId = eventId,
                        PortalId = portalId,
                        GroupId = groupId,
                        Name = name,
                        Details = details,
                        StartTime = startTime,
                        EndTime = endTime,
                        Street = street,
                        City = city,
                        Region = region,
                        Country = country,
                        PostalCode = postalCode,
                        MaxAttendees = maxAttendees,
                        EnableRSVP = enableRsvp,
                        ShowGuestList = showGuestList,
                        CreatedByUserId = UserInfo.UserID,
                        CreatedOnDate = DateTime.Now,
                        LastModifiedByUserId = UserInfo.UserID,
                        LastModifiedOnDate = DateTime.Now
                    };

                var controller = new SocialEventsController();
                if (eventId != Null.NullInteger) controller.UpdateEvent(objEvent);
                else eventId = controller.AddEvent(objEvent);

                objEvent.EventId = eventId; //for add event;

                var url = DotNetNuke.Common.Globals.NavigateURL(tabId, "", "eventid=" + eventId);
                if (groupId > Null.NullInteger) url = DotNetNuke.Common.Globals.NavigateURL(tabId, "", "eventid=" + eventId, "groupid=" + groupId);

                var cntJournal = new Journal();
                cntJournal.AddSocialEventCreateToJournal(objEvent, tabId, objEvent.Name, objEvent.PortalId, objEvent.CreatedByUserId, url);

                var subject = "New Event Invitation";
                var body = "<a href=\"" + url + "\" >" + objEvent.Name + "</a>";

                var cntNotifications = new Notifications();
                cntNotifications.EventInvite(objEvent, objEvent.PortalId, tabId, subject, body);

                var response = new { EventId = eventId, Result = "success" };
                return Json(response);
            }
            catch (Exception ex)
            {
                Exceptions.LogException(ex);

                var response = new { Result = "failure", ex.Message };
                return Json(response);
            }
        }