public BllEvent UpdateStatusAndSendOutEvent(BllEvent Event, BllUser updater)
        {
            try
            {
                var datetime = DateTime.Now;
                Event.StatusLib.SelectedEntities.Last().Date = datetime;
                using (ServiceDB serviceDB = new ServiceDB())
                {
                    IUnitOfWork      uow     = new UnitOfWork(serviceDB);
                    StatusLibService service = new StatusLibService(uow);
                    Event.StatusLib = service.Update(Event.StatusLib);

                    UserLibService userservice = new UserLibService(uow);
                    Event.RecieverLib = userservice.Update(Event.RecieverLib);

                    new Thread(() =>
                    {
                        UpdateEventWithUsers(Event, updater);
                    }).Start();
                    return(Event);
                }
            }
            catch (Exception ex)
            {
                LogWriter.WriteMessage("UpdateStatusAndSendOutEvent", ex.Message + ex.InnerException, updater.Fullname);
                return(Event);
            }
        }
예제 #2
0
 public EventMapper(IUnitOfWork uow)
 {
     this.uow            = uow;
     attributeLibService = new AttributeLibService(uow);
     statusLibService    = new StatusLibService(uow);
     userLibService      = new UserLibService(uow);
     filepathLibService  = new FilepathLibService(uow);
     userService         = new UserService(uow);
     eventTypeService    = new EventTypeService(uow);
 }
 public void UpdateRecieversAndSendOnEvent(BllEvent Event, List <BllUser> newRecievers)
 {
     try
     {
         using (ServiceDB serviceDB = new ServiceDB())
         {
             IUnitOfWork    uow         = new UnitOfWork(serviceDB);
             UserLibService userservice = new UserLibService(uow);
             Event.RecieverLib = AddUsersToLib(Event.RecieverLib, newRecievers);
             Event.RecieverLib = userservice.Update(Event.RecieverLib);
             new Thread(() =>
             {
                 InvokeEventWithUsers(Event, newRecievers);
                 UpdateEventWithRecieversExceptUsers(Event, newRecievers);
             }).Start();
         }
     }
     catch (Exception ex)
     {
         LogWriter.WriteMessage("UpdateRecieversAndSendOutEvent", ex.Message + ex.InnerException, "");
     }
 }
        public BllEvent UpdateAcceptedUsersAndSendOutEvent(BllEvent Event, BllUser updater)
        {
            try
            {
                using (ServiceDB serviceDB = new ServiceDB())
                {
                    IUnitOfWork    uow         = new UnitOfWork(serviceDB);
                    UserLibService userservice = new UserLibService(uow);
                    Event.RecieverLib = userservice.Update(Event.RecieverLib);

                    new Thread(() =>
                    {
                        UpdateEventWithUsers(Event, updater);
                    }).Start();
                    return(Event);
                }
            }
            catch (Exception ex)
            {
                LogWriter.WriteMessage("UpdateAcceptedUsersAndSendOutEvent", ex.Message + ex.InnerException, updater.Fullname);
                return(Event);
            }
        }