Esempio n. 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            var meetingService = new MeetingService(_unitOfWork, _unitOfWork);

            if (Venue == String.Empty)
            {
                MessageBox.Show("Введите место встречи!");
                return;
            }

            var meetingDate = GenerateDate(dtpDate.Value, dtpBeginning.Value);
            var duration    = GenerateDuration(dtpBeginning.Value, dtpEnding.Value);

            if (duration < 0)
            {
                MessageBox.Show("Выберите правильное время!");
                return;
            }
            _meeting.Date = meetingDate;
            _meeting.DurationInMinutes = duration;
            _meeting.Venue             = Venue;

            meetingService.UpdateMeeting(_meeting);

            try
            {
                _unitOfWork.Commit();
                MessageBox.Show("Успешно добавлена!");
            }
            catch (Exception exception)
            {
                _unitOfWork.Rollback();
                MessageBox.Show("Что-то пошло не так");
            }
        }
Esempio n. 2
0
        public ActionResult DeleteConfirmed(int id)
        {
            MeetingService service = new MeetingService(_moneyRepository, _mdb);

            service.Delete(id);
            return(PartialView("TablesPartial"));
        }
Esempio n. 3
0
        protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
        {
            _container = container;

            var configuration = new HostConfiguration()
            {
                UrlReservations = { CreateAutomatically = true }
            };

            container.Register(configuration);

            //register dependencies

            IRepository <User>    userRepository    = new UserRepository(_mongoEndpoint);
            IRepository <Meeting> meetingRepository = new MeetingRepository(_mongoEndpoint);

            IUserService    userService    = new UserService(userRepository);
            IMeetingService meetingService = new MeetingService(meetingRepository, userService);

            container.Register(userService);
            container.Register(meetingService);

            pipelines.AfterRequest += (ctx) =>
            {
                ctx.Response.Headers.Add("Access-Control-Allow-Origin", "*");
                ctx.Response.Headers.Add("Access-Control-Allow-Methods", "POST,GET,PUT,DELETE,OPTIONS");
                ctx.Response.Headers.Add("Access-Control-Allow-Headers", "Accept, Origin, Content-type,Authorization");
            };

            base.ApplicationStartup(container, pipelines);
        }
Esempio n. 4
0
        //public AddChangeMeeting(long meetingId, int commissionId)
        //{
        //    InitializeComponent();
        //    _meetingId = meetingId;
        //    _commissionId = commissionId;
        //}

        private void AddChangeMeeting_Load(object sender, EventArgs e)
        {
            var commissionService = new CommissionService(_unitOfWork, _unitOfWork);
            var meetingService    = new MeetingService(_unitOfWork, _unitOfWork);

            if (_commissionId != 0)
            {
                SetMembersAndCommission(commissionService);
            }

            if (_meetingId != 0)
            {
                _meeting = meetingService.GetMeetingById(_meetingId);

                _commissionId = _meeting.Commission.Id;
                SetMembersAndCommission(commissionService);

                Venue              = _meeting.Venue;
                dtpDate.Value      = _meeting.Date;
                dtpBeginning.Value = _meeting.Date;
                dtpEnding.Value    = _meeting.Date.AddMinutes(_meeting.DurationInMinutes);
                SetDatasourcesToNull();
                lbxMeetingMembers.DataSource = _meeting.Participants;
                lbxMembers.DataSource        = GetMembersExceptMeeting();
            }
            else
            {
                _meeting = meetingService.SetMeetingForCommission(DateTime.Now, "Temporary", 0, _commissionId);
            }
        }
Esempio n. 5
0
 public void setUp()
 {
     try
     {
         testUser = new User
         {
             Id                   = "f93e4146-0ef5-45fb-8088-d1150e91dea3",
             Email                = "*****@*****.**",
             EmailConfirmed       = true,
             PasswordHash         = "badpasswordhash",
             SecurityStamp        = "stamp",
             PhoneNumber          = "87654321",
             PhoneNumberConfirmed = true,
             TwoFactorEnabled     = false,
             LockoutEndDateUtc    = DateTime.Today,
             LockoutEnabled       = false,
             AccessFailedCount    = 3,
             UserName             = "******",
             FirstName            = "John",
             LastName             = "Doe",
             Address              = "Downing Street",
             ApiKey               = "apistuff",
         };
         db = new UserDB();
         ms = new MeetingService();
     }
     catch
     {
         throw new Exception();
     }
 }
Esempio n. 6
0
        private void UpdateGrids()
        {
            if (_context != null)
            {
                _context = new DumaContext(Resources.ConnectionString);
            }
            var unitOfWork        = new UnitOfWork(_context);
            var commissionService = new CommissionService(unitOfWork, unitOfWork);
            var membershipService = new MembershipService(unitOfWork, unitOfWork);
            var meetingService    = new MeetingService(unitOfWork, unitOfWork);

            dgvCommissions.DataSource = null;
            dgvMembers.DataSource     = null;
            dgvMeetings.DataSource    = null;

            var members     = membershipService.GetAllMembers();
            var commissions = commissionService.GetAllCommissions();
            var meetings    = meetingService.GetAllMeetings();

            dgvCommissions.DataSource = commissions;
            dgvMembers.DataSource     = members;
            dgvMeetings.DataSource    = meetings;

            unitOfWork.Commit();
        }
Esempio n. 7
0
        public JsonResult Delete_organizor(int meetingID)
        {
            //调用服务
            Status status = new MeetingService().deleteMultipe(meetingID);

            return(Json(new RespondModel(status, ""), JsonRequestBehavior.AllowGet));
        }
Esempio n. 8
0
 public JsonResult Add_organizor(AddMeetingModel addMeetingModel)
 {
     if (ModelState.IsValid)
     {
         MeetingInfo     meeting         = addMeetingModel.meeting;
         MeetingService  service         = new MeetingService();
         DelegateService delegateService = new DelegateService();
         Status          status          = Status.SUCCESS;
         //调用服务
         if ((status = service.create(ref meeting)) == Status.SUCCESS)
         {
             DeviceService            deviceService = new DeviceService();
             List <DeviceForDelegate> devices       = null;
             status = deviceService.getAllForDelegate(
                 meeting.meetingToStartTime,
                 meeting.meetingStartedTime,
                 out devices);
             status = delegateService.createMultiple(devices, meeting.meetingID, addMeetingModel.delegates);
             if (status != Status.SUCCESS)
             {
                 service.deleteMultipe(meeting.meetingID);
             }
         }
         return(Json(new RespondModel(status, ""), JsonRequestBehavior.AllowGet));
     }
     else
     {
         return(Json(
                    new RespondModel(
                        Status.ARGUMENT_ERROR,
                        ModelStateHelper.errorMessages(ModelState)),
                    JsonRequestBehavior.AllowGet));
     }
 }
        private MeetingService CreateMeetingService()
        {
            var userId  = Guid.Parse(User.Identity.GetUserId());
            var service = new MeetingService(userId);

            return(service);
        }
Esempio n. 10
0
        public void PersistTheCreatedMeeting()
        {
            MeetingService service = CreateService();

            Meeting meeting = service.CreateMeeting(facilitatorId);

            Assert.That(meeting, Is.EqualTo(service.GetMeetingById(meeting.Id)));
        }
 public MeetingsController(IUserService userService,
                           MeetingService meetingService,
                           RoomService roomService)
 {
     _userService    = userService;
     _meetingService = meetingService;
     _roomService    = roomService;
 }
Esempio n. 12
0
        public void Service_is_created()
        {
            var mockLogger      = new Mock <ILogger>();
            var mockHistoryRepo = new Mock <IHistoryRepository>();
            var sut             = new MeetingService(mockLogger.Object, mockHistoryRepo.Object);

            Assert.IsInstanceOf <MeetingService>(sut);
        }
Esempio n. 13
0
        public async void GetOnlineMeeting_NoMeetingId_ThrowsArgumentException()
        {
            // Arrange
            var meetingService = new MeetingService(new Mock <IGraphServiceClient>().Object);

            // Act & Assert
            await Assert.ThrowsAsync <ArgumentException>(async() => await meetingService.GetOnlineMeetingInfo(null, "userId", "accessToken"));
        }
Esempio n. 14
0
        public void ThrowsAnExceptionWhenTheMeetingDoesNotExists()
        {
            MeetingService service   = CreateService();
            Guid           meetingId = Guid.NewGuid();
            Guid           userId    = Guid.NewGuid();

            Assert.Throws <NonExistentMeetingException>(() => service.JoinTheMeeting(meetingId, userId));
        }
Esempio n. 15
0
 public bool HasPermission(MeetingService.Permissions permission)
 {
     if (_currentUser.Role == null)
     {
         return false;
     }
     return HasPermission(_currentUser.Role.RolePermissions, permission);
 }
Esempio n. 16
0
        public ActionResult Organizor()
        {
            List <TipMeeting> meetings = null;
            //调用服务
            Status status = new MeetingService().getAll(out meetings);

            return(View(meetings));
        }
Esempio n. 17
0
        public void Setup()
        {
            InMemoryMeetingRepository      meetingRepository          = new InMemoryMeetingRepository();
            FakeTemplateQuestionRepository questionTemplateRepository = new FakeTemplateQuestionRepository();
            MeetingService meetingService = new MeetingService(meetingRepository, questionTemplateRepository);

            meetingAppService = new MeetingAppService(meetingService);
            questionTemplates = questionTemplateRepository.GetAll();
        }
 public EventController(EasyMeetingDbContext db, ILogger <Meeting> loger, IMapper mapper, MeetingService meetingService, ParticipiantService participiantService, IEmailService emailService)
 {
     _db                  = db ?? throw new ArgumentNullException(nameof(db));
     _loger               = loger ?? throw new ArgumentNullException(nameof(loger));
     _mapper              = mapper ?? throw new ArgumentNullException(nameof(mapper));
     _meetingService      = meetingService ?? throw new ArgumentNullException(nameof(meetingService));
     _participiantService = participiantService ?? throw new ArgumentNullException(nameof(participiantService));
     _emailService        = emailService ?? throw new ArgumentNullException(nameof(emailService));
 }
Esempio n. 19
0
        public void CreateMeetingWithTheFirstQuestionBeingTheCurrent()
        {
            MeetingService service = CreateService();

            Meeting meeting = service.CreateMeeting(facilitatorId);

            Assert.That(meeting.Questions.First(), Is.EqualTo(meeting.CurrentQuestion));
            Assert.True(meeting.CurrentQuestion.IsTheCurrent);
        }
Esempio n. 20
0
 public async Task GetSkypeResourceUrlAsync_Tetst()
 {
     var service0 = new SkypeBootstraper(new HttpClient(), new SkypeOption()
     {
         DiscoverServer = "http://lyncdiscoverinternal.scrbg.com/"
     });
     var service = new MeetingService(service0, new HttpClient());
     // await service.CreateOnlineMeetingAsync("测试", "描述");
 }
Esempio n. 21
0
        public void CreateMeetingWithFacilitatorAndQuestions()
        {
            MeetingService service = CreateService();

            Meeting meeting = service.CreateMeeting(facilitatorId);

            Assert.That(meeting, Is.Not.Null);
            Assert.IsTrue(meeting.UserIsTheFacilitator(facilitatorId));
            Assert.That(meeting.Questions, Is.Not.Null.And.Not.Empty);
        }
Esempio n. 22
0
        public PartialViewResult PartialMeeting(string provider, int id)
        {
            var model = new PartialMeetingModel {
                Topic   = $"{provider.ToTitleCase()} meeting",
                Meeting = MeetingService.CreateMeeting(provider),
                //ConversationId = id
            };

            return(PartialView($"_Meeting{provider}", model));
        }
Esempio n. 23
0
        public BookingController(IHttpContextAccessor httpContextAccessor, ISecurityService securityService)
        {
            Session = httpContextAccessor.HttpContext.Session;

            _meetingService  = new MeetingService();
            _attendeeService = new AttendeeService();
            service          = securityService;

            email = Session.GetString("account");
        }
Esempio n. 24
0
        public void JoinTheMeetingWhenTheUserIsNotParticipatingTheMeeting()
        {
            MeetingService service = CreateService();
            Meeting        meeting = service.CreateMeeting(facilitatorId);
            Guid           userId  = Guid.NewGuid();

            service.JoinTheMeeting(meeting.Id, userId);

            Assert.True(meeting.UserIsParticipating(userId));
        }
        public void EnableAnswersOfTheCurrentQuestionWhenTheUserIsTheFacilitator()
        {
            MeetingService service = CreateService();
            Meeting        meeting = service.CreateMeeting(facilitatorId);


            service.EnableAnswersOfTheCurrentQuestion(meeting.Id, facilitatorId);


            Assert.True(meeting.CurrentQuestion.IsUpForAnswer);
        }
        public void DispatchEventWhenTheUserIsTheFacilitator()
        {
            MeetingService service = CreateService();
            Meeting        meeting = service.CreateMeeting(facilitatorId);


            service.EnableAnswersOfTheCurrentQuestion(meeting.Id, facilitatorId);


            Assert.True(FakeHandler.MeetingWasNotified(meeting.Id));
        }
Esempio n. 27
0
        public void NotJoinTheMeetingWhenTheUserIsAlreadyParticipatingTheMeeting()
        {
            MeetingService service = CreateService();
            Meeting        meeting = service.CreateMeeting(facilitatorId);
            Guid           userId  = Guid.NewGuid();

            service.JoinTheMeeting(meeting.Id, userId);
            service.JoinTheMeeting(meeting.Id, userId);

            Assert.That(meeting.NumberOfParticipants, Is.EqualTo(1));
        }
Esempio n. 28
0
 public async Task <List <MeetingDto> > GetAllMeetings()
 {
     try
     {
         return(await MeetingService.GetAllMeetings());
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         throw;
     }
 }
Esempio n. 29
0
 public async Task <MeetingDto> GetMeetingById(int meetingId)
 {
     try
     {
         return(await MeetingService.GetMeetingById(meetingId));
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         throw;
     }
 }
Esempio n. 30
0
 public void tearDown()
 {
     try
     {
         ms = null;
         m  = null;
     }
     catch
     {
         throw new Exception();
     }
 }
Esempio n. 31
0
 public LearnerController(MeetingService meetingService,
                          LearnerMeetingService learnerMeetingService,
                          FeedbackLearnerTeacherService feedbackLearnerTeacherService,
                          LearnerService learnerService,
                          TeacherService teacherService)
 {
     _meetingService                = meetingService;
     _learnerMeetingService         = learnerMeetingService;
     _feedbackLearnerTeacherService = feedbackLearnerTeacherService;
     _learnerService                = learnerService;
     _teacherService                = teacherService;
 }
Esempio n. 32
0
 public ServiceList(string url, ResponseToken token)
 {
     this.eventService = new EventService(url, token);
     this.categoryService = new CategoryService(url, token);
     this.clubService = new ClubService(url, token);
     this.userService = new UserService(url, token);
     this.ticketService = new TicketService(url, token);
     this.meetingService = new MeetingService(url, token);
     this.invoiceService = new InvoiceService(url, token);
     this.groupService = new GroupService(url, token);
     this.expenseService = new ExpenseService(url, token);
     this.emailService = new EmailService(url, token);
     this.depositService = new DepositService(url, token);
     this.customFieldService = new CustomFieldService(url, token);
     this.taskService = new TaskService(url, token);
     this.contactService = new ContactService(url, token);
 }
Esempio n. 33
0
 public bool HasPermission(int userPermission, MeetingService.Permissions permission)
 {
     return EnumHelper<MeetingService.Permissions>.ContainFlags(userPermission, permission);
 }