public List <MeetingTime> GetMeetingTimeList(string RoomName) { try { List <MeetingTime> meetingTimes = new List <MeetingTime>(); var query = service.IQueryable(t => (t.PreResult != 0 && t.PreResult != 2) && t.RoomName.Equals(RoomName) && t.MeetingDate.Value.Year == DateTime.Now.Year && t.MeetingDate.Value.Month == DateTime.Now.Month && t.MeetingDate.Value.Day == DateTime.Now.Day) .OrderByDescending(q => q.MeetingDate).ToList();//除审核不通过之外 foreach (var l in query) { MeetingTime time = new MeetingTime(); time.ID = l.ID; time.BeginTime = l.BeginTime.Value; time.PreEndTime = l.PreEndTime.Value; time.Subject = l.Subject; time.AppMan = l.AppMan; time.AuditTag = l.AuditTag; meetingTimes.Add(time); } return(meetingTimes.OrderBy(t => t.BeginTime).ToList()); } catch (Exception ex) { throw; } }
public void Output(StringBuilder sb) { Settings.AddValueCk(1, sb, Description); Settings.AddValueCk(2, sb, "SmallGroup", SmallGroup); Settings.AddValueCk(2, sb, "Fee", Fee); Settings.AddValueCk(2, sb, "Limit", Limit); Settings.AddValueCk(2, sb, "Time", MeetingTime.ToString2("s")); }
public async Task <IActionResult> JoinMeeting([FromBody] MeetingTime meetingTime, string meetingid) { meetingTime.MeetingId = meetingid; meetingTime.Id = Guid.NewGuid().ToString(); await _cardinalDataService.UpsertMeetingTimeAsync(meetingTime); return(Created("meetingTime", meetingTime)); }
public void TestInvalidMeetingDate() { using (var sw = new StringWriter()) { Console.SetOut(sw); MeetingTime badMeetingTimes = null; try { badMeetingTimes = new MeetingTime( new int[] { 50, 80 }, 70, new bool[] { true, true, true, true, true, true, true }); //After this, nothing should happen Assert.Fail(); } catch (InvalidOperationException) { Assert.IsTrue(true); } Assert.IsNull(badMeetingTimes); //Oversized array try { badMeetingTimes = new MeetingTime( new int[] { 14, 30 }, 70, new bool[] { true, true, true, true, true, true, true, true });//Oversized array //After this, nothing should happen Assert.Fail(); } catch (InvalidOperationException) { Assert.IsTrue(true); } Assert.IsNull(badMeetingTimes); //Undersized array try { badMeetingTimes = new MeetingTime( new int[] { 14, 30 }, 70, new bool[] { true, true, true, true, true, true });//Undersized array //After this, nothing should happen Assert.Fail(); } catch (InvalidOperationException) { Assert.IsTrue(true); } Assert.IsNull(badMeetingTimes); } }
public void WriteXml(APIWriter w) { w.Start("CheckboxItem") .Attr("Fee", Fee) .Attr("Limit", Limit) .Attr("Time", MeetingTime.ToString2("s")) .Add("Description", Description) .Add("SmallGroup", SmallGroup.trim()) .End(); }
public async Task <IActionResult> Delete(MeetingTime meetingTime) { if (ModelState.IsValid) { _meetingTimeRepository.Delete(meetingTime); return(RedirectToAction(nameof(Index))); } return(View(meetingTime)); }
public async Task AddMeetingTimeAsync(MeetingTime meetingTime) { var game = await this.gameRepository.GetAsync(meetingTime.GameId) ?? throw new NotFoundException($"Game with id:{meetingTime.GameId} not exists."); if (game.MeetingTimes.Any(mt => mt.TimeOfMeet == meetingTime.TimeOfMeet)) { return; } game.MeetingTimes.Add(meetingTime); await gameRepository.UpdateAsync(game); }
public void TestGetDayMeeting() { USurvive.Class test = new Class(name, instructor, creditHours, email, website, syllabus, classType, notes, meetingTimes, gradeScale); DateTime date = new DateTime(2021, 3, 31);//Wednesday MeetingTime time = new MeetingTime( new int[] { 16, 30 }, 70, new bool[] { false, true, false, true, false, true, false } ); Assert.IsTrue(test.GetDayMeeting(date).ToString().Equals(time.ToString())); date = new DateTime(2021, 3, 30);//Tuesday Assert.IsNull(test.GetDayMeeting(date)); }
/// <summary> /// 获取会议室预定情况 /// </summary> /// <param name="pagination"></param> /// <param name="BeginDate"></param> /// <param name="EndDate"></param> /// <returns></returns> public List <MeetingRoom> GetBookMeetingList(Pagination pagination, DateTime BeginDate, DateTime EndDate) { try { List <MeetingRoom> meetings = new List <MeetingRoom>(); var query = service.IQueryable(t => (t.PreResult != 0 && t.PreResult != 2) && t.MeetingDate >= BeginDate && t.MeetingDate <= EndDate).OrderByDescending(q => q.MeetingDate).ToList();//除审核不通过之外 meetings = (from q in query group q by new { q.RoomID, q.RoomName, q.MeetingDate } into g select new MeetingRoom { RoomID = g.Key.RoomID ?? 0, RoomName = g.Key.RoomName, MeetingDate = g.Key.MeetingDate.Value }).ToList(); foreach (var m in meetings) { List <MeetingTime> meetingTimes = new List <MeetingTime>(); var list = query.Where(t => t.RoomID == m.RoomID && t.MeetingDate == m.MeetingDate).OrderBy(t => t.BeginTime); foreach (var l in list) { MeetingTime time = new MeetingTime(); time.ID = l.ID; time.BeginTime = l.BeginTime.Value; time.PreEndTime = l.PreEndTime.Value; time.Subject = l.Subject; time.AuditTag = l.AuditTag; meetingTimes.Add(time); } m.meetingTimes = meetingTimes; } pagination.records = meetings.Count(); meetings = meetings.Skip((pagination.page - 1) * pagination.rows).Take(pagination.rows).ToList(); return(meetings); } catch (Exception ex) { throw; } }
public bool Update(MeetingTime meetingTime) { _context.Update(meetingTime); return(Save()); }
public bool Delete(MeetingTime meetingTime) { _context.Remove(meetingTime); return(Save()); }
public bool Create(MeetingTime meetingTime) { _context.Add(meetingTime); return(Save()); }
public void Create(object masterView, RectangleF frame, OnButtonClick onJoinClicked) { OnButtonClicked = onJoinClicked; View = PlatformView.Create( ); View.BackgroundColor = ControlStylingConfig.BackgroundColor; View.AddAsSubview(masterView); // Group Title GroupTitle = PlatformLabel.Create( ); GroupTitle.AddAsSubview(masterView); GroupTitle.SetFont(ControlStylingConfig.Font_Bold, ControlStylingConfig.Large_FontSize); GroupTitle.TextColor = ControlStylingConfig.TextField_ActiveTextColor; GroupTitle.TextAlignment = TextAlignment.Center; // Meeting Time MeetingTime = PlatformLabel.Create( ); MeetingTime.AddAsSubview(masterView); MeetingTime.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Medium_FontSize); MeetingTime.TextColor = ControlStylingConfig.TextField_ActiveTextColor; MeetingTime.TextAlignment = TextAlignment.Center; // Childcare Provided ChildcareProvided = PlatformLabel.Create( ); ChildcareProvided.AddAsSubview(masterView); ChildcareProvided.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Medium_FontSize); ChildcareProvided.TextColor = ControlStylingConfig.TextField_ActiveTextColor; ChildcareProvided.TextAlignment = TextAlignment.Center; // Young Adults YoungAdults = PlatformLabel.Create( ); YoungAdults.AddAsSubview(masterView); YoungAdults.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Medium_FontSize); YoungAdults.TextColor = ControlStylingConfig.TextField_ActiveTextColor; YoungAdults.TextAlignment = TextAlignment.Center; // Family Image and Layer FamilyImageLayer = PlatformView.Create( ); FamilyImageLayer.AddAsSubview(masterView); FamilyImageLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color; FamilyImageLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; FamilyImageLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth; FamilyImage = PlatformImageView.Create( ); FamilyImage.AddAsSubview(masterView); FamilyImage.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFit; FamilyImage.BackgroundColor = 0; // Group Desc GroupDescLayer = PlatformView.Create( ); GroupDescLayer.AddAsSubview(masterView); GroupDescLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color; GroupDescLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; GroupDescLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth; GroupDesc = PlatformLabel.Create( ); GroupDesc.AddAsSubview(masterView); GroupDesc.TextAlignment = TextAlignment.Center; GroupDesc.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Medium_FontSize); GroupDesc.TextColor = ControlStylingConfig.TextField_ActiveTextColor; // Group Desc Header GroupDescHeader = PlatformLabel.Create( ); GroupDescHeader.AddAsSubview(masterView); GroupDescHeader.TextAlignment = TextAlignment.Center; GroupDescHeader.SetFont(ControlStylingConfig.Font_Bold, ControlStylingConfig.Medium_FontSize); GroupDescHeader.TextColor = ControlStylingConfig.TextField_ActiveTextColor; GroupDescHeader.Text = ConnectStrings.GroupInfo_AboutGroup; // Childcare Desc ChildDescLayer = PlatformView.Create( ); ChildDescLayer.AddAsSubview(masterView); ChildDescLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color; ChildDescLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; ChildDescLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth; ChildDesc = PlatformLabel.Create( ); ChildDesc.AddAsSubview(masterView); ChildDesc.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Medium_FontSize); ChildDesc.TextColor = ControlStylingConfig.TextField_ActiveTextColor; ChildDesc.TextAlignment = TextAlignment.Center; // Child Desc Header ChildDescHeader = PlatformLabel.Create( ); ChildDescHeader.AddAsSubview(masterView); ChildDescHeader.TextAlignment = TextAlignment.Center; ChildDescHeader.SetFont(ControlStylingConfig.Font_Bold, ControlStylingConfig.Medium_FontSize); ChildDescHeader.TextColor = ControlStylingConfig.TextField_ActiveTextColor; ChildDescHeader.Text = ConnectStrings.GroupInfo_AboutChildcare; // Group Image and Layer GroupImageLayer = PlatformView.Create( ); GroupImageLayer.AddAsSubview(masterView); GroupImageLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color; GroupImageLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; GroupImageLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth; GroupImage = PlatformImageView.Create( ); GroupImage.AddAsSubview(masterView); GroupImage.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFit; GroupImage.BackgroundColor = 0; // Join Button JoinButton = PlatformButton.Create( ); JoinButton.AddAsSubview(masterView); JoinButton.ClickEvent = JoinClicked; JoinButton.BackgroundColor = ControlStylingConfig.Button_BGColor; JoinButton.TextColor = ControlStylingConfig.Button_TextColor; JoinButton.CornerRadius = ControlStylingConfig.Button_CornerRadius; JoinButton.Text = ConnectStrings.JoinGroup_JoinButtonLabel; JoinButton.SizeToFit( ); JoinButton.UserInteractionEnabled = true; // Create our results view overlay ResultView = new UIResultView(masterView, View.Frame, OnResultViewDone); // Create our blocker view BlockerView = new UIBlockerView(masterView, View.Frame); }
public MeetingTimeModel(MeetingTime meetingTime, Meeting meeting) { startTime = meetingTime.StartTime; endTime = meetingTime.StartTime.Add(meeting.Length); }
partial void Summary_Compute(ref string result) { result = Title + " - " + MeetingDays + " " + MeetingTime.ToShortTimeString(); }
public void LayoutChanged(RectangleF containerBounds) { View.Frame = new RectangleF(containerBounds.Left, containerBounds.Top, containerBounds.Width, containerBounds.Height); BlockerView.SetBounds(containerBounds); ResultView.SetBounds(containerBounds); if (IsDownloading == false) { float sectionSpacing = Rock.Mobile.Graphics.Util.UnitToPx(25); float textLeftInset = Rock.Mobile.Graphics.Util.UnitToPx(10); float textTopInset = Rock.Mobile.Graphics.Util.UnitToPx(2); float textRightInset = textLeftInset * 2; float textBotInset = textTopInset * 2; float buttonWidth = Rock.Mobile.Graphics.Util.UnitToPx(122); float buttonHeight = Rock.Mobile.Graphics.Util.UnitToPx(44); GroupTitle.Hidden = false; GroupTitle.Frame = new RectangleF(textLeftInset, 0, View.Frame.Width - textRightInset, 0); GroupTitle.SizeToFit( ); GroupTitle.Bounds = new RectangleF(0, 0, View.Frame.Width - textRightInset, GroupTitle.Bounds.Height); // layout the meeting itme MeetingTime.Hidden = false; MeetingTime.Frame = new RectangleF(textLeftInset, GroupTitle.Frame.Bottom, View.Frame.Width - textRightInset, 0); MeetingTime.SizeToFit( ); MeetingTime.Bounds = new RectangleF(0, 0, View.Frame.Width - textRightInset, MeetingTime.Bounds.Height); float nextYPos = MeetingTime.Frame.Bottom; // layout the childcare banner if (string.IsNullOrWhiteSpace(ChildcareProvided.Text) == false) { ChildcareProvided.Hidden = false; ChildcareProvided.Frame = new RectangleF(textLeftInset, nextYPos, View.Frame.Width - textRightInset, 0); ChildcareProvided.SizeToFit( ); ChildcareProvided.Bounds = new RectangleF(0, 0, View.Frame.Width - textRightInset, ChildcareProvided.Bounds.Height); nextYPos = ChildcareProvided.Frame.Bottom; } else { ChildcareProvided.Hidden = true; } // layout the young adults banner if (string.IsNullOrWhiteSpace(YoungAdults.Text) == false) { YoungAdults.Hidden = false; YoungAdults.Frame = new RectangleF(textLeftInset, nextYPos, View.Frame.Width - textRightInset, 0); YoungAdults.SizeToFit( ); YoungAdults.Bounds = new RectangleF(0, 0, View.Frame.Width - textRightInset, YoungAdults.Bounds.Height); nextYPos = YoungAdults.Frame.Bottom; } else { YoungAdults.Hidden = true; } nextYPos += sectionSpacing; // layout the group description header (IF there's a description or group photo) if (string.IsNullOrWhiteSpace(GroupDesc.Text) == false || FamilyImageValid == true) { // display and position the header GroupDescHeader.Hidden = false; GroupDescHeader.Frame = new RectangleF(textLeftInset, nextYPos + textTopInset, View.Frame.Width - textRightInset, 0); GroupDescHeader.SizeToFit( ); GroupDescHeader.Bounds = new RectangleF(0, 0, View.Frame.Width - textRightInset, GroupDescHeader.Bounds.Height); nextYPos = GroupDescHeader.Frame.Bottom; // now try the image if (FamilyImageValid == true) { // setup padding for the image float imageTopPadding = textTopInset * 2; float imageBotPadding = textBotInset * 2; float leaderImageLayerHeight = Rock.Mobile.Graphics.Util.UnitToPx(PrivateConnectConfig.GroupInfo_Leader_ImageSize); FamilyImage.Hidden = false; FamilyImage.Position = new PointF((View.Frame.Width - FamilyImage.Frame.Width) / 2, nextYPos + imageTopPadding); FamilyImageLayer.Hidden = false; FamilyImageLayer.Frame = new RectangleF(0, nextYPos, View.Frame.Width, leaderImageLayerHeight + imageBotPadding); nextYPos = FamilyImageLayer.Frame.Bottom + sectionSpacing; } // try to layout the group description if (string.IsNullOrWhiteSpace(GroupDesc.Text) == false) { GroupDesc.Hidden = false; GroupDesc.Frame = new RectangleF(textLeftInset, nextYPos + textTopInset, View.Frame.Width - textRightInset, 0); GroupDesc.SizeToFit( ); GroupDesc.Bounds = new RectangleF(0, 0, View.Frame.Width - textRightInset, GroupDesc.Bounds.Height); GroupDescLayer.Hidden = false; GroupDescLayer.Frame = new RectangleF(0, nextYPos, View.Frame.Width, GroupDesc.Frame.Height + textBotInset); nextYPos = GroupDescLayer.Frame.Bottom + textBotInset + sectionSpacing; } // now try the image if (GroupImageValid == true) { // setup padding for the image float imageTopPadding = textTopInset * 2; float imageBotPadding = textBotInset * 2; float groupImageLayerHeight = Rock.Mobile.Graphics.Util.UnitToPx(PrivateConnectConfig.GroupInfo_Group_ImageSize); GroupImage.Hidden = false; GroupImage.Position = new PointF((View.Frame.Width - GroupImage.Frame.Width) / 2, nextYPos + imageTopPadding); GroupImageLayer.Hidden = false; GroupImageLayer.Frame = new RectangleF(0, nextYPos, View.Frame.Width, groupImageLayerHeight + imageBotPadding); nextYPos = GroupImageLayer.Frame.Bottom + sectionSpacing; } // regardless of which (or both) of the above displayed, add an additional sectionSpacing // so that the next major section, ChildDesc, has more spacing. nextYPos += sectionSpacing; } // layout the child info header if (string.IsNullOrWhiteSpace(ChildDesc.Text) == false) { ChildDescHeader.Hidden = false; ChildDescHeader.Frame = new RectangleF(textLeftInset, nextYPos + textTopInset, View.Frame.Width - textRightInset, 0); ChildDescHeader.SizeToFit( ); ChildDescHeader.Bounds = new RectangleF(0, 0, View.Frame.Width - textRightInset, ChildDescHeader.Bounds.Height); nextYPos = ChildDescHeader.Frame.Bottom; // layout child info ChildDesc.Hidden = false; ChildDesc.Frame = new RectangleF(textLeftInset, nextYPos + textTopInset, View.Frame.Width - textRightInset, 0); ChildDesc.SizeToFit( ); ChildDesc.Bounds = new RectangleF(0, 0, View.Frame.Width - textRightInset, ChildDesc.Bounds.Height); ChildDescLayer.Hidden = false; ChildDescLayer.Frame = new RectangleF(0, nextYPos, View.Frame.Width, ChildDesc.Frame.Height + textBotInset); nextYPos = ChildDescLayer.Frame.Bottom + sectionSpacing; } // Join Button JoinButton.Hidden = false; JoinButton.Frame = new RectangleF((View.Frame.Width - buttonWidth) / 2, nextYPos + sectionSpacing, buttonWidth, buttonHeight); } }
public async Task UpsertMeetingTimeAsync(MeetingTime meetingTime) { _cardinalDbContext.MeetingTimes.Add(meetingTime); await _cardinalDbContext.SaveChangesAsync(); }