예제 #1
0
 //Constructor For Starting Multicast For Group
 public Multicast(Models.Group group,int userId)
 {
     _computers = new List<Models.Computer>();
     _multicastSession = new Models.ActiveMulticastSession();
     _isOnDemand = false;
     _group = group;
     _userId = userId;
 }
예제 #2
0
 public static bool UpdateActiveMulticastSession(Models.ActiveMulticastSession activeMulticastSession)
 {
     using (var uow = new DAL.UnitOfWork())
     {
         uow.ActiveMulticastSessionRepository.Update(activeMulticastSession, activeMulticastSession.Id);
         return(uow.Save());
     }
 }
예제 #3
0
 //Constructor For Starting Multicast For Group
 public Multicast(Models.Group group, int userId)
 {
     _computers        = new List <Models.Computer>();
     _multicastSession = new Models.ActiveMulticastSession();
     _isOnDemand       = false;
     _group            = group;
     _userId           = userId;
 }
예제 #4
0
 //Constructor For Starting Multicast For On Demand
 public Multicast(Models.ImageProfile imageProfile, string clientCount, int userId)
 {
     _multicastSession = new Models.ActiveMulticastSession();
     _isOnDemand = true;
     _imageProfile = imageProfile;
     _clientCount = clientCount;
     _group = new Models.Group{ImageProfileId = _imageProfile.Id};
     _userId = userId;
     _multicastSession.ImageProfileId = imageProfile.Id;
 }
예제 #5
0
 //Constructor For Starting Multicast For On Demand
 public Multicast(Models.ImageProfile imageProfile, string clientCount, int userId)
 {
     _multicastSession = new Models.ActiveMulticastSession();
     _isOnDemand       = true;
     _imageProfile     = imageProfile;
     _clientCount      = clientCount;
     _group            = new Models.Group {
         ImageProfileId = _imageProfile.Id
     };
     _userId = userId;
     _multicastSession.ImageProfileId = imageProfile.Id;
 }
예제 #6
0
        public static void SendMulticastCompletedEmail(Models.ActiveMulticastSession session)
        {
            //Mail not enabled
            if (Settings.SmtpEnabled == "0")
            {
                return;
            }

            foreach (var user in BLL.User.SearchUsers("").Where(x => x.NotifyComplete == 1 && !string.IsNullOrEmpty(x.Email)))
            {
                if (session.UserId == user.Id)
                {
                    var mail = new Helpers.Mail
                    {
                        MailTo  = user.Email,
                        Body    = session.Name + " Multicast Task Has Completed.",
                        Subject = "Multicast Completed"
                    };
                    mail.Send();
                }
            }
        }
예제 #7
0
 public static bool AddActiveMulticastSession(Models.ActiveMulticastSession activeMulticastSession)
 {
     using (var uow = new DAL.UnitOfWork())
     {
         if (uow.ActiveMulticastSessionRepository.Exists(h => h.Name == activeMulticastSession.Name))
         {
             //Message.Text = "A Multicast Is Already Running For This Group";
             return(false);
         }
         uow.ActiveMulticastSessionRepository.Insert(activeMulticastSession);
         if (uow.Save())
         {
             //Message.Text = "Successfully Created Multicast";
             return(true);
         }
         else
         {
             //Message.Text = "Could Not Create Multicast";
             return(false);
         }
     }
 }