public ActionResult EditModel(int id) { //Return a view with a form containing the editable contents of the meeting ID Provided. IMeeting meeting = meetingRepository.Get(id); return(View(meeting)); }
/// <summary> /// SOMETHING. /// </summary> /// <param name="meetingId">Meeting Id.</param> /// <returns>Action Result.</returns> public async Task <IActionResult> Index(Guid meetingId) { IWho who = this.Who(); this.logger.ReportEntry( who, new { MeetingId = meetingId }); IMeeting meeting = await this.service.GetMeetingByIdAsync( who, meetingId).ConfigureAwait(false); IAgendaItem agendaItem = await this.service.GetAgendaItemsByMeetingIdAsTreeAsync( who, meetingId).ConfigureAwait(false); if (agendaItem == null) { agendaItem = await this.service.CreateSkeletonAgendaAsync( who, AuditEvent.ViewAgenda, meetingId, SkeletonAgendaType.BasicContinuation).ConfigureAwait(false); } _ = meeting; _ = agendaItem; throw new NotImplementedException(); ////return this.View(); }
public void StartMeeting(IMeeting meeting) { if (meeting != null) { meeting.ShowAgenda(message); } }
/// <summary> /// Update Meeting. /// </summary> /// <param name="who">Who Details.</param> /// <param name="model">Edit view model.</param> /// <returns>Nothing.</returns> private async Task UpdateRecordAsync( IWho who, EditViewModel model) { this.logger.ReportEntry( who, new { Model = model }); IMeeting originalMeeting = await this.service .GetMeetingByIdAsync( who : who, meetingId : model.MeetingId) .ConfigureAwait(false); IMeeting meeting = model.ToDomain( committee: originalMeeting.Committee); await this.service .UpdateMeetingAsync( who : who, auditEvent : AuditEvent.MeetingMaintenance, meeting : meeting) .ConfigureAwait(false); this.logger.ReportExit(who); }
/// <inheritdoc/> public async Task CreateMeetingAsync( IWho who, AuditEvent auditEvent, IMeeting meeting) { this.logger.ReportEntry( who, new { Meeting = meeting }); try { IAuditHeaderWithAuditDetails auditHeader = this.data.BeginTransaction(auditEvent, who); await this.data .CreateMeetingAsync( who : who, auditHeader : auditHeader, meeting : meeting) .ConfigureAwait(false); await this.data.CommitTransactionAsync(auditHeader) .ConfigureAwait(false); } catch (Exception) { this.data.RollbackTransaction(); throw; } this.logger.ReportExit(who); }
public static void SetRightsOnDocument(IMeeting meeting, IElectronicDocument document) { if (meeting == null) { return; } var secretary = meeting.Secretary; if (secretary != null && !document.AccessRights.IsGrantedDirectly(DefaultAccessRightsTypes.Change, secretary)) { document.AccessRights.Grant(secretary, DefaultAccessRightsTypes.Change); } var president = meeting.President; if (president != null && !document.AccessRights.IsGrantedDirectly(DefaultAccessRightsTypes.Change, president)) { document.AccessRights.Grant(president, DefaultAccessRightsTypes.Change); } var members = meeting.Members.Select(m => m.Member).ToList(); foreach (var member in members) { if (!document.AccessRights.IsGrantedDirectly(DefaultAccessRightsTypes.Read, member)) { document.AccessRights.Grant(member, DefaultAccessRightsTypes.Read); } } }
/// <summary> /// Display the specified Meeting. /// </summary> /// <param name="meetingId">Meeting Id.</param> /// <returns>View.</returns> public async Task <IActionResult> Index(Guid meetingId) { IWho who = this.Who(); this.logger.ReportEntry( who, new { MeetingId = meetingId }); IMeeting meeting = await this.service .GetMeetingByIdAsync( who : who, meetingId : meetingId) .ConfigureAwait(false); IndexViewModel model = IndexViewModel.Create(meeting); ViewResult view = this.View(model); this.logger.ReportExitView( who, view.ViewName, view.Model, view.StatusCode); return(view); }
private async Task GotoMeeting(int meetingId) { var curUser = DependencyResolver.Current.Container.Resolve <UserInfo>(); if (curUser.UserId == CurLessonDetail.MasterUserId) { _sdkService.SetTeacherPhoneId(curUser.GetNube()); } var lessonDetail = DependencyResolver.Current.Container.Resolve <LessonDetail>(); lessonDetail.CloneLessonDetail(CurLessonDetail); _sdkService.SetMeetingId(meetingId); await _interactiveContentView.Dispatcher.BeginInvoke(new Action(() => { IMeeting meetingService = DependencyResolver.Current.Container.Resolve <IMeeting>(); meetingService.StartMeetingCallbackEvent += MeetingService_StartMeetingCallbackEvent; meetingService.ExitMeetingCallbackEvent += MeetingService_ExitMeetingCallbackEvent; meetingService.StartMeeting(); })); }
public void Test_Passing_Valid_Values() { // ARRANGE OrganisationDto organisationDto = new OrganisationDto( id: Guid.NewGuid(), code: "CBC", name: "County Bridge Club", bgColour: "000000"); CommitteeDto committeeDto = new CommitteeDto( id: Guid.NewGuid(), organisationId: organisationDto.Id, name: "TSC", description: "Tournament Sub-Committee", organisation: organisationDto); MeetingDto meetingDto = new MeetingDto( Guid.NewGuid(), committeeId: committeeDto.Id, meetingDateTime: new DateTime(2019, 12, 30, 19, 15, 00), committee: committeeDto); // ACT IMeeting meeting = meetingDto.ToDomain(); // ASSERT Assert.IsNotNull(meeting); Assert.AreEqual(meetingDto.Id, meeting.Id); Assert.IsNotNull(meeting.Committee); Assert.AreEqual(meetingDto.CommitteeId, meeting.Committee.Id); Assert.AreEqual(meetingDto.MeetingDateTime, meeting.MeetingDateTime); }
// GET: Meetings/Details/5 public ActionResult Details(int id) { //Load the specified Meeting by the Meeting ID provided. IMeeting meeting = meetingRepository.Get(id); return(View(meeting)); }
public VisualizeShellService() { _userInfo = IoC.Get <UserInfo>(); _sdkService = IoC.Get <IMeeting>(); _shellView = IoC.Get <MainView>(); _rtClientService = IoC.Get <IRtClientService>(); }
private void GetSerialNo() { IMeeting sdkService = IoC.Get <IMeeting>(); GlobalData.Instance.SerialNo = sdkService.GetSerialNo(); Log.Logger.Debug($"【device no.】:{GlobalData.Instance.SerialNo}"); }
// GET: Meetings/Delete/5 public ActionResult Delete(int id) { //Return a view which shows the contents of the provided meeting id //and prompt form confirmation to delete. IMeeting meeting = meetingRepository.Get(id); return(View()); }
public void StartMeeting(IMeeting meeting) { // Its a callback if (meeting != null) { meeting.ShowAgenda(message); } }
public void Test_With_Valid_List_Of_Meetings() { // ARRANGE Guid paramId = Guid.NewGuid(); const string paramName = "TSC"; const string paramDescription = "Tournament Sub-Committee"; OrganisationDto organisationDto = new OrganisationDto( id: Guid.NewGuid(), code: "CBC", name: "County Bridge Club", bgColour: "000000"); CommitteeDto committeeDto = new CommitteeDto( id: paramId, organisationId: organisationDto.Id, name: paramName, description: paramDescription, organisation: organisationDto); IList <MeetingDto> paramMeetings = new List <MeetingDto> { new MeetingDto( id: Guid.NewGuid(), committeeId: committeeDto.Id, meetingDateTime: DateTime.Now, committee: committeeDto) }; committeeDto.SetPrivatePropertyValue( propName: nameof(CommitteeDto.Meetings), value: paramMeetings); // ACT ICommitteeWithMeetings committeeWithMeetings = committeeDto.ToDomainWithMeetings(); // ASSERT Assert.AreEqual(paramId, committeeWithMeetings.Id); Assert.AreEqual(paramName, committeeWithMeetings.Name); Assert.AreEqual(paramDescription, committeeWithMeetings.Description); Assert.IsNotNull(committeeWithMeetings.Organisation); Assert.AreEqual(organisationDto.Id, committeeWithMeetings.Organisation.Id); Assert.IsNotNull(committeeWithMeetings.Meetings); Assert.AreEqual(1, committeeWithMeetings.Meetings.Count); IMeeting meeting = committeeWithMeetings.Meetings[0]; Assert.IsNotNull(meeting); Assert.IsNotNull(meeting.Committee); Assert.AreEqual(paramId, meeting.Committee.Id); Assert.IsNotNull(meeting.Committee.Organisation); Assert.AreEqual(organisationDto.Id, meeting.Committee.Organisation.Id); }
public ViewLayoutService() { _meetingService = DependencyResolver.Current.GetService <IMeeting>(); _manualPushLive = DependencyResolver.Current.Container.ResolveNamed <IPushLive>("ManualPushLive"); _serverPushLive = DependencyResolver.Current.Container.ResolveNamed <IPushServerLive>("ServerPushLive"); _localRecordLive = DependencyResolver.Current.GetService <IRecordLive>(); InitializeStatus(); }
public static MeetingDto ToDto(IMeeting meeting) { if (meeting == null) { throw new ArgumentNullException(nameof(meeting)); } return(new MeetingDto( id: meeting.Id, committeeId: meeting.Committee.Id, meetingDateTime: meeting.MeetingDateTime)); }
private async Task <bool> AuthenticateUserAsync() { if (string.IsNullOrEmpty(GlobalData.Instance.AggregatedConfig.GetInterfaceItem().BmsAddress)) { DialogContent = Messages.WarningUserCenterIpNotConfigured; return(false); } Log.Logger.Debug("【**********************************************************************************】"); Log.Logger.Debug($"【login step1】:get imei token begins"); ResponseResult getImeiToekenResult = await _bmsService.GetImeiToken(GlobalData.Instance.SerialNo, GlobalData.Instance.AggregatedConfig.DeviceKey); Log.Logger.Debug($"【login step1】:get imei token ends"); if (getImeiToekenResult.Status != "0") { DialogContent = getImeiToekenResult.Message; return(false); } Log.Logger.Debug($"【login step2】:get userinfo begins"); ResponseResult getUserInfoResult = await _bmsService.GetUserInfo(); Log.Logger.Debug($"【login step2】:get userinfo ends"); if (getUserInfoResult.Status != "0") { DialogContent = getUserInfoResult.Message; return(false); } UserInfo userInfo = getUserInfoResult.Data as UserInfo; if (userInfo != null) { UserInfo globalUserInfo = IoC.Get <UserInfo>(); globalUserInfo.CloneUserInfo(userInfo); IMeeting sdkService = IoC.Get <IMeeting>(); sdkService.SelfPhoneId = userInfo.GetNube(); return(true); } Log.Logger.Error($"【get user info via device no. failed】:user info is null"); DialogContent = Messages.ErrorLoginFailed; return(false); }
public ViewLayoutService() { _sdkService = DependencyResolver.Current.Container.Resolve <IMeeting>(); _attendees = DependencyResolver.Current.Container.Resolve <List <UserInfo> >(); _lessonDetail = DependencyResolver.Current.Container.Resolve <LessonDetail>(); _localPushLiveService = DependencyResolver.Current.Container.ResolveNamed <IPushLive>(GlobalResources.LocalPushLive); _serverPushLiveService = DependencyResolver.Current.Container.ResolveNamed <IPushLive>(GlobalResources.RemotePushLive); _localRecordService = DependencyResolver.Current.Container.Resolve <IRecord>(); InitializeStatus(); }
public ViewLayoutService() { _sdkService = IoC.Get <IMeeting>(); _attendees = IoC.Get <List <UserInfo> >(); _lessonDetail = IoC.Get <LessonDetail>(); _localPushLiveService = IoC.Get <IPushLive>(GlobalResources.LocalPushLive); _serverPushLiveService = IoC.Get <IPushLive>(GlobalResources.RemotePushLive); _localRecordService = IoC.Get <IRecord>(); InitializeStatus(); }
public SelectAttendeeListViewModel(SelectAttendeeListView selectAttendeeListView, SpecialViewType specialViewType) { _selectAttendeeListView = selectAttendeeListView; _targetSpecialViewType = specialViewType; _sdkService = IoC.Get <IMeeting>(); _userInfos = IoC.Get <List <UserInfo> >(); _viewLayoutService = IoC.Get <IViewLayout>(); AttendeeItems = new ObservableCollection <AttendeeItem>(); LoadedCommand = new DelegateCommand(LoadedAsync); WindowKeyDownCommand = new DelegateCommand <object>(WindowKeyDownHandlerAsync); }
/// <summary> /// Creates the Meeting Card View Model. /// </summary> /// <param name="meeting">Meeting.</param> /// <returns>Meeting Card View Model.</returns> public static MeetingCardViewModel Create(IMeeting meeting) { if (meeting == null) { throw new ArgumentNullException(nameof(meeting)); } return(new MeetingCardViewModel( meetingId: meeting.Id, organisationName: meeting.Committee.Organisation.Name, committeeName: meeting.Committee.Name, meetingDateTime: meeting.MeetingDateTime, bgColor: meeting.Committee.Organisation.BgColour)); }
public ManageAttendeeListViewModel(ManageAttendeeListView manageAttendeeListView) { _viewLayoutService = IoC.Get <IViewLayout>(); _manageAttendeeListView = manageAttendeeListView; _manageAttendeeListView.Closing += _manageAttendeeListView_Closing; _userInfos = IoC.Get <List <UserInfo> >(); _sdkService = IoC.Get <IMeeting>(); RegisterEvents(); AttendeeItems = new ObservableCollection <AttendeeItem>(); LoadedCommand = new DelegateCommand(LoadedAsync); WindowKeyDownCommand = new DelegateCommand <object>(WindowKeyDownHandlerAsync); }
private async Task <bool> AuthenticateUserAsync() { if (string.IsNullOrEmpty(GlobalData.Instance.AggregatedConfig.GetInterfaceItem().BmsAddress)) { HasErrorMsg("-1", Messages.WarningUserCenterIpNotConfigured); return(false); } Log.Logger.Debug("【**********************************************************************************】"); Log.Logger.Debug($"【login step1】:apply for token begins"); ResponseResult bmsTokenResult = await _bmsService.ApplyForToken(UserName, Password, GlobalData.Instance.SerialNo); Log.Logger.Debug($"【login step1】:apply for token ends"); if (HasErrorMsg(bmsTokenResult.Status, bmsTokenResult.Message)) { return(false); } Log.Logger.Debug($"【login step2】:get userinfo begins"); ResponseResult userInfoResult = await _bmsService.GetUserInfo(); Log.Logger.Debug($"【login step2】:get userinfo ends"); if (HasErrorMsg(userInfoResult.Status, userInfoResult.Message)) { return(false); } UserInfo userInfo = userInfoResult.Data as UserInfo; if (userInfo != null) { UserInfo globalUserInfo = IoC.Get <UserInfo>(); userInfo.Pwd = Password; globalUserInfo.CloneUserInfo(userInfo); IMeeting sdkService = IoC.Get <IMeeting>(); sdkService.SelfPhoneId = userInfo.GetNube(); return(true); } Log.Logger.Error($"【get user info via account failed】:user info is null"); HasErrorMsg("-1", Messages.ErrorLoginFailed); return(false); }
/// <summary> /// Creates the view model. /// </summary> /// <param name="meeting">Meeting.</param> /// <returns>View model.</returns> public static MeetingViewModel Create( IMeeting meeting) { if (meeting == null) { throw new ArgumentNullException(nameof(meeting)); } CultureInfo cultureInfo = CultureInfo.GetCultureInfo("en-GB"); string date = meeting.MeetingDateTime.Date.ToLongDateString(); string time = meeting.MeetingDateTime.ToString("h:mm tt", cultureInfo); return(new MeetingViewModel( meetingId: meeting.Id, meetingDate: date, meetingTime: time)); }
/// <inheritdoc/> public async Task CreateMeetingAsync( IWho who, IAuditHeaderWithAuditDetails auditHeader, IMeeting meeting) { this.logger.ReportEntry( who, new { Meeting = meeting }); MeetingDto dto = MeetingDto.ToDto(meeting); this.context.Meetings.Add(dto); await this.context.SaveChangesAsync().ConfigureAwait(false); Audit.AuditCreate(auditHeader, dto, dto.Id); this.logger.ReportExit(who); }
/// <inheritdoc/> public async Task UpdateMeetingAsync( IWho who, IAuditHeaderWithAuditDetails auditHeader, IMeeting meeting) { this.logger.ReportEntry( who, new { Meeting = meeting }); MeetingDto dto = MeetingDto.ToDto(meeting); MeetingDto original = await this.context.FindAsync <MeetingDto>(meeting.Id); Audit.AuditUpdate(auditHeader, dto.Id, original, dto); this.context.Entry(original).CurrentValues.SetValues(dto); await this.context.SaveChangesAsync().ConfigureAwait(false); this.logger.ReportExit(who); }
/// <summary> /// Creates the view model. /// </summary> /// <param name="meeting">Meeting.</param> /// <returns>Edit view model.</returns> public static EditViewModel Create(IMeeting meeting) { if (meeting == null) { throw new ArgumentNullException(nameof(meeting)); } CultureInfo cultureInfo = CultureInfo.GetCultureInfo("en-GB"); return(new EditViewModel( formState: FormState.Initial, meetingId: meeting.Id, organisationId: meeting.Committee.Organisation.Id, organisationName: meeting.Committee.Organisation.Name, committeeId: meeting.Committee.Id, committeeName: meeting.Committee.Name, meetingDate: meeting.MeetingDateTime.ToString("dd/MM/yyyy", cultureInfo), meetingTime: meeting.MeetingDateTime.ToString("hh:mm", cultureInfo))); }
/// <inheritdoc/> public async Task <IMeeting> GetMeetingByIdAsync( IWho who, Guid meetingId) { this.logger.ReportEntry( who, new { MeetingId = meetingId }); IMeeting meeting = await this.data .GetMeetingByIdAsync( who : who, meetingId : meetingId) .ConfigureAwait(false); this.logger.ReportExit( who, new { Meeting = meeting }); return(meeting); }
/// <summary> /// Record this guy as having been visited. /// </summary> /// <param name="meeting"></param> /// <param name="startTime"></param> /// <param name="title"></param> public async Task MarkVisitedNow(IMeeting m, DateTime?timeStamp = null) { // Setup the time stamp var ts = timeStamp.HasValue ? timeStamp.Value : DateTime.Now; await CreateDBConnection(); // See if this meeting is already in the database. We have to // use the unique string for that, sadly. var mref = m.AsReferenceString(); var entry = await(_db.AsyncConnection.Table <IWalker.MRU>().Where(mt => mt.IDRef == mref).FirstOrDefaultAsync()); if (entry == null) { // Totally new! var mru = new IWalker.MRU() { IDRef = mref, StartTime = m.StartTime, Title = m.Title, LastLookedAt = ts }; var r = await _db.AsyncConnection.InsertAsync(mru); _mrusUpdated.OnNext(default(Unit)); } else { // Just update a pre-existing object. entry.LastLookedAt = DateTime.Now; // And update all the other fields entry.Title = m.Title; entry.StartTime = m.StartTime; await _db.AsyncConnection.UpdateAsync(entry); _mrusUpdated.OnNext(default(Unit)); } }
public Meeting Get(IMeeting meeting) { return context.Meetings.Find(meeting.Id); }