示例#1
0
        public async Task <IActionResult> SendNotificationAsync([FromBody] SendNotification model)
        {
            var vapidDetails = new VapidDetails(_settings.Subject, _settings.PublicKey, _settings.PrivateKey);

            var webPushClient = new WebPushClient();

            webPushClient.SetVapidDetails(vapidDetails);

            // send notification
            var payload = new PushNotificationPayload
            {
                Title   = "Push Demo Title",
                Body    = "Put some message in the body of the notification.",
                Icon    = "assets/cazton-c.png",
                Vibrate = new List <int> {
                    100, 50, 100
                }
            };

            try
            {
                var subscription = _pushSusbscriptions.GetAll().FirstOrDefault(x => x.Endpoint == model.Endpoint);

                if (subscription != null)
                {
                    await webPushClient.SendNotificationAsync(subscription, JsonConvert.SerializeObject(new { notification = payload }), vapidDetails);
                }
            }
            catch (WebPushException exception)
            {
                var statusCode = exception.StatusCode;
            }

            return(Ok());
        }
示例#2
0
 public void SendNotifications(object obj)
 {
     foreach (var plant in GetPlantsToWater())
     {
         SendNotification?.Invoke(this, new EventArgsSendNotifications(plant.UserId, plant.Name));
     }
 }
        public void given_two_payments_that_trigger_high_spending_verify_correct_message_set()
        {
            var mockDateTimeProvider = new MockIDateTimeProvider();
            var mockCurrentDate      = mockDateTimeProvider.ToReturn(new DateTime(2020, 04, 03));
            var currentDate          = mockDateTimeProvider.getDateTime();

            var payments = new List <Payment>
            {
                new Payment
                {
                    Id = 1,
                    TransactionDate = currentDate,
                    Category        = Category.Food,
                    Amount          = 200.00m,
                },

                new Payment
                {
                    Id = 1,
                    TransactionDate = new DateTime(2020, 03, 03),
                    Category        = Category.Food,
                    Amount          = 50.00m,
                }
            };

            var mockPaymentRepository = new MockPaymentRepository().WithThese(payments);
            var sendNotification      = new SendNotification();
            var spending = new Spending(mockPaymentRepository, new DetermineHighSpending(mockCurrentDate), sendNotification);

            spending.Trigger(1);

            var expectedMessage = "Hi, you spent $150.00 more on Food Category";

            Assert.Equal(expectedMessage, sendNotification.Message);
        }
示例#4
0
文件: Startup.cs 项目: jagolu/TFG-API
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ApplicationDBContext context)
        {
            app.UseCors("myCORS");
            app.UseStaticFiles();
            app.UseSpaStaticFiles();
            app.UseHttpsRedirection();
            app.UseAuthentication();


            app.UseSignalR(routes =>
            {
                routes.MapHub <ChatHub>("/chatter");
                routes.MapHub <NotificationHub>("/notificatter");
            });
            app.UseMvc(routes => {
                routes.MapRoute(
                    name: "default",
                    template: "{controller}/{action=Index}/{id?}");
            });


            EmailSender.Initialize(Configuration);
            TokenGenerator.Initialize(Configuration);
            PasswordHasher.Initialize(Configuration);
            SendNotification.Initialize(Configuration);
            KickChatNotification.Initialize(Configuration);
            DBInitializer.Initialize(context);

            app.UseSpa(spa => spa.Options.SourcePath = "webInterface");
        }
示例#5
0
        /// <summary>
        /// Manages the action when the maker of a group leaves it
        /// </summary>
        /// <param name="members">All the members of the group</param>
        /// <param name="maker">The group-maker role</param>
        /// <param name="admin">The group-admin role</param>
        /// <param name="normal">The group-normal role</param>
        /// <param name="leave">True if the maker has leaved the group, false otherwise</param>
        /// <param name="_context">The database context</param>
        /// <param name="hub">The notification hub</param>
        public static async Task manageQuitMaker(List <UserGroup> members, Role maker, Role admin, Role normal, bool leave, ApplicationDBContext _context, IHubContext <NotificationHub> hub)
        {
            List <UserGroup> adminMembers  = members.Where(m => m.role == admin).OrderBy(d => d.dateRole).ToList();
            List <UserGroup> normalMembers = members.Where(m => m.role == normal).OrderBy(d => d.dateJoin).ToList();
            UserGroup        newMaster;

            if (adminMembers.Count() != 0) //The older admin in the group will become in the group maker
            {
                newMaster = adminMembers.First();
            }
            else //If there isn't any admin, the older member in the group will become in the group make
            {
                newMaster = normalMembers.First();
            }

            newMaster.role     = maker;
            newMaster.dateRole = DateTime.Today;

            _context.Update(newMaster);
            _context.SaveChanges();

            _context.Entry(newMaster).Reference("User").Load();
            _context.Entry(newMaster).Reference("Group").Load();
            Home.Util.GroupNew.launch(newMaster.User, newMaster.Group, null, Home.Models.TypeGroupNew.MAKE_MAKER_GROUP, leave, _context);
            Home.Util.GroupNew.launch(newMaster.User, newMaster.Group, null, Home.Models.TypeGroupNew.MAKE_MAKER_USER, leave, _context);
            await SendNotification.send(hub, newMaster.Group.name, newMaster.User, Alive.Models.NotificationType.MAKE_MAKER, _context);
        }
示例#6
0
        /// <summary>
        /// Pay a group his weekly pay (only if is the correct day)
        /// </summary>
        /// <param name="_context">The database context</param>
        /// <param name="hub">The notification hub</param>
        public static void pay(ApplicationDBContext _context, IHubContext <NotificationHub> hub)
        {
            DayOfWeek today = DateTime.Now.DayOfWeek;
            int       day   = DateTime.Now.DayOfYear;
            int       year  = DateTime.Now.Year;


            _context.Group.ToList().ForEach(group =>
            {
                if (today != group.dateCreated.DayOfWeek)
                {
                    return;
                }
                if (day == group.dateCreated.DayOfYear && year == group.dateCreated.Year)
                {
                    return;
                }

                _context.Entry(group).Collection("users").Load();
                int moreCoins = group.weeklyPay;
                Areas.Home.Util.GroupNew.launch(null, group, null, Areas.Home.Models.TypeGroupNew.PAID_PLAYERS_GROUPS, false, _context);

                group.users.ToList().ForEach(async u =>
                {
                    u.coins += moreCoins;
                    _context.Entry(u).Reference("User").Load();
                    User recv = u.User;

                    Areas.Home.Util.GroupNew.launch(recv, group, null, Areas.Home.Models.TypeGroupNew.PAID_PLAYERS_USER, false, _context);
                    await SendNotification.send(hub, group.name, recv, Areas.Alive.Models.NotificationType.PAID_GROUPS, _context);
                });
            });

            _context.SaveChanges();
        }
示例#7
0
 // Token: 0x06000033 RID: 51 RVA: 0x00007D10 File Offset: 0x00007D10
 private void paint_Click(object sender, EventArgs e)
 {
     SendNotification.Alert("Theme Updated!", 0);
     this.drag.BackColor                = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.AA_switch.CheckedOnColor      = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.topmost_switch.CheckedOnColor = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.rpc_switch.CheckedOnColor     = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.exit.BackColor                = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.exit.OnHoverBaseColor         = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.exit.OnHoverBorderColor       = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.exit.OnPressedColor           = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.realtime.OnHoverBaseColor     = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.realtime.OnHoverBorderColor   = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.realtime.OnPressedColor       = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.paint.OnHoverBaseColor        = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.paint.OnHoverBorderColor      = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.paint.OnPressedColor          = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.text.OnHoverBaseColor         = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.text.OnHoverBorderColor       = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.text.OnPressedColor           = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.reset_rgb.OnHoverBaseColor    = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.reset_rgb.OnHoverBorderColor  = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.reset_rgb.OnPressedColor      = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.title.OnHoverBaseColor        = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.title.OnHoverBorderColor      = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.title.OnPressedColor          = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.discord.OnHoverBaseColor      = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.discord.OnHoverBorderColor    = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.discord.OnPressedColor        = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.killrblx.OnHoverBaseColor     = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.killrblx.OnHoverBorderColor   = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.killrblx.OnPressedColor       = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.UpdateTheme = true;
 }
        public SendNotificationViewModel()
        {
            var temp = new SendNotification();

            temp.lstPlaces = PlaceService.GetPlaces();
            temp.Sent      = DateTime.Now;
            Notification   = temp;
        }
        public IHttpActionResult PostDonHang(DonHang donHang)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var giadonhang = new GiaDonHang();
            var khachhang  = db.KhachHang.SingleOrDefault(x => x.Id == donHang.KhachHangId);

            donHang.DonHangChiTiets.Count();

            donHang.ThoiGianDat = DateTime.Now;
            donHang.DaNhan      = false;
            db.DonHang.Add(donHang);
            db.SaveChanges();
            db.Entry(donHang).State = EntityState.Modified;
            donHang.Ma           = donHang.Id.ToString();
            giadonhang.DonHangId = donHang.Id;
            var    ncu      = db.NhaCungUng.SingleOrDefault(x => x.Id == donHang.NCUId);
            double tongtien = 0;

            string     donhangchitiet = "";
            List <int> list           = new List <int>();
            var        m = db.DonHangChiTiet.Where(x => x.DonHangId == donHang.Id);
            long       n = m.Count();

            foreach (DonHangChiTiet x in m)
            {
                list.Add(x.Id);
            }
            for (int i = 0; i < list.Count(); i++)
            {
                tongtien = tongtien + db.DonHangChiTiet.Find(list[i]).Gia;
            }
            giadonhang.TongTien  = tongtien;
            giadonhang.PhiDichVu = 5000;
            db.GiaDonHang.Add(giadonhang);
            db.SaveChanges();
            for (int i = 0; i < list.Count(); i++)
            {
                donhangchitiet = donhangchitiet + "Tên thực phẩm:" + db.DonHangChiTiet.Find(list[i]).TenThucPham +
                                 "\nSố lượng:" + db.DonHangChiTiet.Find(list[i]).SoLuong + "/kg" +
                                 "\nGiá tiền:" + db.DonHangChiTiet.Find(list[i]).Gia + "/VND" + "\n";
            }
            string noidung = "";

            noidung = "Đơn hàng " + donHang.Id + " từ khách hàng có mã là: " + khachhang.Id + "\nVới đơn hàng như sau:\n" + donhangchitiet + "Tổng số tiền là: " + tongtien +
                      "Khách hàng yêu cầu thực phẩm được mua ở: Siêu thị A";
            FindShipper.LookingForShipper(donHang.X, donHang.Y, noidung, "YeuCauNhanDonHang-" + donHang.Id, donHang.Id, khachhang.Id);
            string noidung1 = "Bạn vừa đặt thành công đơn hàng:\n" +
                              "Họ tên: " + khachhang.Ten +
                              "\nChi tiết sản phẩm:\n" + donhangchitiet +
                              "Tổng số tiền là: " + tongtien +
                              "\nYêu cầu thực phẩm được mua ở: Siêu thị A";

            SendNotification.SendNotifications(noidung1, "DatHangThanhCong", khachhang.Id);
            return(Json(donHang.Id));
        }
示例#10
0
 // Token: 0x06000034 RID: 52 RVA: 0x000082DC File Offset: 0x000082DC
 private void text_Click(object sender, EventArgs e)
 {
     SendNotification.Alert("Text Updated!", 0);
     this.gunaLabel1.ForeColor = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.gunaLabel2.ForeColor = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     ((KrakenX)this.f).scriptlist.ForeColor = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.topmost_label.ForeColor           = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.killrblx.ForeColor = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
 }
示例#11
0
        public Task HandleAsync(EventCreated @event)
        {
            var sendNotification = new SendNotification("*****@*****.**", @event.Name);

            Console.WriteLine($"Sending SendNotification command: {@event.Name} {@event.Description}");
            _clientBus.PublishAsync(sendNotification, default(Guid),
                                    cfg => cfg.WithExchange(ex => ex.WithName("Commands")).WithRoutingKey("sendnotification.#"));
            return(Task.CompletedTask);
        }
示例#12
0
 // Token: 0x06000036 RID: 54 RVA: 0x00008B30 File Offset: 0x00008B30
 private void title_Click(object sender, EventArgs e)
 {
     SendNotification.Alert("Title Updated!", 0);
     this.watermark.ForeColor = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     ((KrakenX)this.f).watermark.ForeColor = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     ((KrakenX)this.f).exit.ForeColor      = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     ((KrakenX)this.f).minimize.ForeColor  = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.exit.ForeColor = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
 }
示例#13
0
 private static void send_notification(string send_to, string message_text)
 {
     SendNotification
     .from(BombaliConfiguration.settings.email_from)
     .to(send_to)
     .with_subject("Bombali")
     .with_message(message_text)
     .and_use_notification_host(BombaliConfiguration.settings.smtp_host);
 }
示例#14
0
        //
        // ────────────────────────────────────────────────────────────────────────────────────
        //   :::::: P R I V A T E   F U N C T I O N S : :  :   :    :     :        :          :
        // ────────────────────────────────────────────────────────────────────────────────────
        //

        /// <summary>
        /// Send the news to group and user and the notification to the user
        /// </summary>
        /// <param name="targetUser">The member of the group that has been blocked/unblocked</param>
        /// <param name="group">The group where the member has been blocked/unblocked</param>
        /// <param name="makeUnmake">True if the user has been blocked, false otherwise</param>
        private async Task sendMessages(UserGroup targetUser, Group group, bool makeUnmake)
        {
            _context.Entry(targetUser).Reference("User").Load();
            //Send home news
            Home.Util.GroupNew.launch(targetUser.User, group, null, Home.Models.TypeGroupNew.BLOCK_USER_USER, makeUnmake, _context);
            Home.Util.GroupNew.launch(targetUser.User, group, null, Home.Models.TypeGroupNew.BLOCK_USER_GROUP, makeUnmake, _context);
            //Send notifications
            NotificationType typeNotification = makeUnmake ? NotificationType.BLOCKED : NotificationType.UNBLOCKED;
            await SendNotification.send(_notificationsHub, group.name, targetUser.User, typeNotification, _context);
        }
示例#15
0
        /// <summary>
        /// Sends the notification to the receiver
        /// </summary>
        /// <param name="user">The maker of the dm</param>
        /// <param name="recv">The receiver of the dm</param>
        /// <param name="title">The dm just created</param>
        private async Task sendNotification(User user, User recv, DirectMessageTitle title)
        {
            bool isAdmin = user.role == RoleManager.getAdmin(_context);

            NotificationType type     = isAdmin ? NotificationType.OPEN_DM_FROM_ADMIN : NotificationType.OPEN_DM_FROM_USER;
            String           recvName = isAdmin ? "" : recv.nickname;

            EmailSender.sendOpenCreateDMNotification(recv.email, recv.nickname, title.title);
            await SendNotification.send(_hub, recvName, recv, type, _context);
        }
        /// <summary>
        /// Kick a user out from the group
        /// </summary>
        /// <param name="order">The info to kick a user from the group</param>
        /// See <see cref="Areas.GroupManage.Models.KickUser"/> to know the param structure
        /// <returns>The updated group page</returns>
        /// See <see cref="Areas.GroupManage.Models.GroupPage"/> to know the response structure
        public async System.Threading.Tasks.Task <IActionResult> removeUserAsync([FromBody] KickUser order)
        {
            User user = TokenUserManager.getUserFromToken(HttpContext, _context); //The user who tries to kick the user from the group

            if (!user.open)
            {
                return(BadRequest(new { error = "YoureBanned" }));
            }
            if (AdminPolicy.isAdmin(user, _context))
            {
                return(BadRequest("notAllowed"));
            }
            UserGroup targetUser = new UserGroup();
            Group     group      = new Group();

            if (!GroupAdminFuncionlities.checkFuncionality(user, ref group, order.groupName, ref targetUser, order.publicId, _context, GroupAdminFuncionality.REMOVE_USER, false))
            {
                return(BadRequest());
            }
            if (!group.open)
            {
                return(BadRequest(new { error = "GroupBanned" }));
            }

            try
            {
                _context.Entry(targetUser).Reference("User").Load();
                User sendNew      = targetUser.User;
                Guid targetUserid = targetUser.User.id;
                await QuitUserFromGroup.quitUser(targetUser, _context, _notificationHub);

                await KickChatNotification.sendKickMessageAsync(group.name, targetUser.User.publicid, _chatHub);

                InteractionManager.manageInteraction(targetUser.User, group, interactionType.KICKED, _context);

                using (var scope = _scopeFactory.CreateScope())
                {
                    var dbContext = scope.ServiceProvider.GetRequiredService <ApplicationDBContext>();
                    group = dbContext.Group.Where(g => g.name == order.groupName).First();
                    User recv = dbContext.User.Where(u => u.id == targetUserid).First();
                    user = dbContext.User.Where(u => u.id == user.id).First();

                    Home.Util.GroupNew.launch(sendNew, group, null, Home.Models.TypeGroupNew.KICK_USER_USER, false, dbContext);
                    Home.Util.GroupNew.launch(sendNew, group, null, Home.Models.TypeGroupNew.KICK_USER_GROUP, false, dbContext);
                    await SendNotification.send(_notificationHub, group.name, recv, NotificationType.KICKED_GROUP, dbContext);

                    return(Ok(GroupPageManager.GetPage(user, group, dbContext)));
                }
            }
            catch (Exception)
            {
                return(StatusCode(500));
            }
        }
示例#17
0
        /// <summary>
        /// Send room notification
        /// </summary>
        /// <param name="room">The room.</param>
        /// <param name="message">The message.</param>
        /// <param name="notifyRoom">if set to <c>true</c> [notify room].</param>
        /// <param name="format">The format.</param>
        /// <param name="color">The color.</param>
        /// <returns>Task&lt;IResponse&lt;System.Boolean&gt;&gt;.</returns>
        public async Task <IResponse <bool> > SendNotificationAsync(string room, string message, bool notifyRoom = true, MessageFormat format = MessageFormat.Html, MessageColor color = MessageColor.Gray)
        {
            var notification = new SendNotification
            {
                Color   = color,
                Message = message,
                Notify  = notifyRoom,
                Format  = format
            };

            return(await SendNotificationAsync(room, notification));
        }
示例#18
0
        public EntityDeleted(T entity)
        {
            this.Entity = entity;

            CommandResult    cmd   = new CommandResult();
            SendNotification nofiy = new SendNotification(cmd);

            nofiy.Notify += (sender, args) =>
            {
                System.Diagnostics.Debug.Write(sender);
            };
        }
示例#19
0
        //
        // ────────────────────────────────────────────────────────────────────────────────────
        //   :::::: P R I V A T E   F U N C T I O N S : :  :   :    :     :        :          :
        // ────────────────────────────────────────────────────────────────────────────────────
        //

        /// <summary>
        /// Send the news and the notifications to the group and the new admin
        /// </summary>
        /// <param name="target"></param>
        /// <param name="group"></param>
        /// <param name="makeUnmake"></param>
        /// <returns></returns>
        private async Task sendNews(UserGroup target, Group group, bool makeUnmake)
        {
            //Send home news
            _context.Entry(target).Reference("User").Load();
            User targetUser = target.User;

            Home.Util.GroupNew.launch(targetUser, group, null, Home.Models.TypeGroupNew.MAKE_ADMIN_USER, makeUnmake, _context);
            Home.Util.GroupNew.launch(targetUser, group, null, Home.Models.TypeGroupNew.MAKE_ADMIN_GROUP, makeUnmake, _context);
            //Send notifications
            NotificationType typeNotification = makeUnmake ? NotificationType.MAKE_ADMIN : NotificationType.UNMAKE_ADMIN;
            await SendNotification.send(_hub, group.name, targetUser, typeNotification, _context);
        }
示例#20
0
 private void Form1_Load(object sender, EventArgs e)
 {
     // Show - or Hide...
     this.Show();
     // Encapsulate the setTextBox1 Method in Delegate SendNotification...
     sendNotification = new SendNotification(setTextBox1);
     // Set Text Box Value...
     this.toolStripStatusLabel1.Text = "Enabling Update Services...";
     // Set Text Box Value...
     this.toolStripStatusLabel2.Text = "";
     // Lets check Windows is up to that task...
     EnableServicesWorker.RunWorkerAsync();
 }
示例#21
0
 // Token: 0x06000035 RID: 53 RVA: 0x000083FC File Offset: 0x000083FC
 private void reset_rgb_Click(object sender, EventArgs e)
 {
     SendNotification.Alert("Theme Reset!", 0);
     this.r_trackbar.Value                  = 0;
     this.g_trackbar.Value                  = 243;
     this.b_trackbar.Value                  = 153;
     this.gunaLabel1.ForeColor              = Color.White;
     this.gunaLabel2.ForeColor              = Color.White;
     this.gunaLabel3.ForeColor              = Color.White;
     this.gunaLabel4.ForeColor              = Color.White;
     this.gunaLabel5.ForeColor              = Color.White;
     ((KrakenX)this.f).minimize.ForeColor   = Color.White;
     ((KrakenX)this.f).exit.ForeColor       = Color.White;
     ((KrakenX)this.f).watermark.ForeColor  = Color.White;
     this.killrblx.ForeColor                = Color.White;
     ((KrakenX)this.f).scriptlist.ForeColor = Color.White;
     this.topmost_label.ForeColor           = Color.White;
     this.color_picker.BaseColor            = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.drag.BackColor                = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.AA_switch.CheckedOnColor      = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.topmost_switch.CheckedOnColor = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.rpc_switch.CheckedOnColor     = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.exit.BackColor                = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.exit.OnHoverBaseColor         = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.exit.OnHoverBorderColor       = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.exit.OnPressedColor           = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.realtime.OnHoverBaseColor     = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.realtime.OnHoverBorderColor   = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.realtime.OnPressedColor       = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.paint.OnHoverBaseColor        = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.paint.OnHoverBorderColor      = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.paint.OnPressedColor          = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.text.OnHoverBaseColor         = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.text.OnHoverBorderColor       = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.text.OnPressedColor           = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.reset_rgb.OnHoverBaseColor    = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.reset_rgb.OnHoverBorderColor  = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.reset_rgb.OnPressedColor      = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.title.OnHoverBaseColor        = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.title.OnHoverBorderColor      = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.title.OnPressedColor          = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.watermark.ForeColor           = Color.White;
     this.exit.ForeColor                = Color.White;
     this.discord.OnHoverBaseColor      = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.discord.OnHoverBorderColor    = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.discord.OnPressedColor        = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.killrblx.OnHoverBaseColor     = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.killrblx.OnHoverBorderColor   = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.killrblx.OnPressedColor       = Color.FromArgb(this.r_trackbar.Value, this.g_trackbar.Value, this.b_trackbar.Value);
     this.Reset = true;
 }
示例#22
0
        public async override Task <OperationResult <string> > SendCodeAsync(string content, string to, CancellationToken cancellationToken)
        {
            SendNotification notif = new SendNotification();
            var emailSetting       = await unitOfWork.SettingRepository.Get <AddEmailSetting>(SettingEnum.EmailSetting.EnumToString(), cancellationToken);

            NotificationEmail emailSend = new NotificationEmail(notif);

            //   var sendEmail = await emailSend.Send(emailSetting.Result.From, "Email Confirm Code", content, emailSetting.Result.Username, emailSetting.Result.Password,MailboxAddress, emailSetting.Result.Port, emailSetting.Result.SmtpServer);
            if (true)
            {
                return(OperationResult <string> .BuildSuccessResult("Success Send Email"));
            }
            return(OperationResult <string> .BuildFailure("Fail Send Email"));
        }
示例#23
0
    [WebMethod]// רשימת כול האירועים בSQL
    public List <Event> NotificationTimer()

    {
        SendNotification userEvents = new SendNotification();

        List <Event> listMsg = userEvents.GetUserEvent();

        foreach (var msg in listMsg)
        {
            SendNotificationToUser(msg.description, msg.title, msg.RengUser);// האירועים שהגיעו SQL נשלחים למכשירים
        }

        return(listMsg);
    }
示例#24
0
        public override async Task <OperationResult <string> > SendCodeAsync(string content, string to, CancellationToken cancellationToken)
        {
            SendNotification notif = new SendNotification();
            var smsSetting         = await unitOfWork.SettingRepository.Get <AddSMSSetting>(SettingEnum.SMSSetting.EnumToString(), cancellationToken);

            NotificationSms smsSend = new NotificationSms(notif);
            var             sendSms = await smsSend.Send(smsSetting.Result.LineNumber, smsSetting.Result.userApikey, to, content, smsSetting.Result.secretKey);

            if (sendSms.Success)
            {
                return(OperationResult <string> .BuildSuccessResult("Success Send SMS"));
            }
            return(OperationResult <string> .BuildFailure("Fail Send SMS"));
        }
示例#25
0
        /// <summary>
        /// Send the news and notifications to the group members
        /// </summary>
        /// <param name="group">The group which has been banned or unbanned</param>
        /// <param name="ban">True if the group has been banned, false otherwise</param>
        private void sendNews(Group group, bool ban)
        {
            _context.Entry(group).Collection("users").Load();

            group.users.ToList().ForEach(async u =>
            {
                _context.Entry(u).Reference("User").Load();
                User recv = u.User;
                Home.Util.GroupNew.launch(recv, group, null, Home.Models.TypeGroupNew.BAN_GROUP, ban, _context);

                NotificationType type = ban ? NotificationType.BAN_GROUP : NotificationType.UNBAN_GROUP;
                await SendNotification.send(_hub, group.name, recv, type, _context);
            });
        }
示例#26
0
        // Token: 0x06000064 RID: 100 RVA: 0x0000B79C File Offset: 0x0000B79C
        public DllInjectionResult Inject(string sProcName, string sDllPath)
        {
            bool flag  = !File.Exists(sDllPath);
            bool flag2 = flag;
            DllInjectionResult result;

            if (flag2)
            {
                SendNotification.Alert("DLL is missing, turn off your antivirus!", 2);
                result = DllInjectionResult.DllNotFound;
            }
            else
            {
                uint      num       = 0U;
                Process[] processes = Process.GetProcesses();
                for (int i = 0; i < processes.Length; i++)
                {
                    bool flag3 = processes[i].ProcessName == sProcName;
                    bool flag4 = flag3;
                    if (flag4)
                    {
                        num = (uint)processes[i].Id;
                        break;
                    }
                }
                bool flag5 = num == 0U;
                bool flag6 = flag5;
                if (flag6)
                {
                    MessageBox.Show("Roblox Isn't Open!", "Kraken");
                    result = DllInjectionResult.GameProcessNotFound;
                }
                else
                {
                    bool flag7 = !this.bInject(num, sDllPath);
                    bool flag8 = flag7;
                    if (flag8)
                    {
                        MessageBox.Show("Injection Failed!", "Kraken");
                        result = DllInjectionResult.InjectionFailed;
                    }
                    else
                    {
                        result = DllInjectionResult.Success;
                    }
                }
            }
            return(result);
        }
        /// <summary>
        /// Launch the news for the group and for the members on it
        /// </summary>
        /// <param name="u">The user who has launch the fb</param>
        /// <param name="group">The group where the new fb has been launched</param>
        /// <param name="fb">The fb that has been launched</param>
        private void launchNews(User u, Group group, FootballBet fb)
        {
            _context.Entry(group).Collection("users").Load();
            Home.Util.GroupNew.launch(null, group, fb, Home.Models.TypeGroupNew.LAUNCH_FOOTBALLBET_GROUP, false, _context);

            group.users.Where(g => !g.blocked).ToList().ForEach(async ug =>
            {
                _context.Entry(ug).Reference("User").Load();
                bool isLauncher = ug.userid == u.id;
                User recv       = ug.User;

                Home.Util.GroupNew.launch(recv, group, fb, Home.Models.TypeGroupNew.LAUNCH_FOOTBALLBET_USER, isLauncher, _context);
                await SendNotification.send(_hub, group.name, recv, Alive.Models.NotificationType.NEW_FOOTBALLBET, _context);
            });
        }
 // Token: 0x06000043 RID: 67 RVA: 0x0000B42C File Offset: 0x0000B42C
 public static void KillRoblox()
 {
     try
     {
         foreach (Process process in Process.GetProcessesByName("RobloxPlayerBeta"))
         {
             process.Kill();
         }
         SendNotification.Alert("Roblox Killed!", 0);
     }
     catch
     {
         SendNotification.Alert("Couldn't Kill Roblox!", 2);
     }
 }
示例#29
0
        public bool ForgotPassword(CoreUserLoginModel email)
        {
            User userExist = db.Users.Where(p => p.Email == email.Email).FirstOrDefault();

            if (userExist != null)
            {
                SendNotification notify = new SendNotification();
                notify.SendMailForgotPassword(userExist.Email, userExist.Name, userExist.Password, "Forgot Password");
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#30
0
        public override async Task <OperationResult <string> > SendCodeAsync(string content, string to, CancellationToken cancellationToken)
        {
            SendNotification notif = new SendNotification();
            var smsSetting         = await unitOfWork.SettingRepository.Get <AddSMSSetting>(SettingEnum.SMSSetting.EnumToString(), cancellationToken);

            var emailSetting = await unitOfWork.SettingRepository.Get <AddEmailSetting>(SettingEnum.EmailSetting.EnumToString(), cancellationToken);

            NotificationSms   smsSend   = new NotificationSms(notif);
            NotificationEmail emailSend = new NotificationEmail(smsSend);
            var sendSms = await smsSend.Send(smsSetting.Result.LineNumber, smsSetting.Result.userApikey, to, content, smsSetting.Result.secretKey);

            if (sendSms.Success)
            {
                // var sendEmail = await emailSend.Send(emailSetting.Result.From, "Email Confirm Code", content, emailSetting.Result.Username, emailSetting.Result.Password, to, emailSetting.Result.Port, emailSetting.Result.SmtpServer);
            }
            return(OperationResult <string> .BuildFailure("Fail Send SMS"));
        }