// GET: Chat public async Task <ActionResult> Index() { var eventLogic = new EventLogic(); ViewBag.events = (await eventLogic.GetAllEvents()).Where(x => x.AttendesEvents.Any(y => y.AttendesID == CurrentUserSession.AttendesID.Value)).ToList(); return(View()); }
/// <summary> /// Initializes the page. /// </summary> /// <remarks>This method runs on the first load of the page, and does NOT /// run on postbacks. If you want to run a method on PostBacks, override the /// Page_Load event</remarks> protected override void InitializePage() { base.InitializePage(); if (EventLogic.IsRegistrationClosed(targetEvent)) { GoTo(string.Format("ViewEvent.aspx?contextID={0}", ContextID)); } if (targetChapter != null) { setOwnerBackLinks(targetChapter.ID, targetChapter.Name, "~/chapters/ViewChapter.aspx", "~/chapters/ManageChapterEvents.aspx"); } if (targetSection != null) { setOwnerBackLinks(targetSection.ID, targetSection.Name, "~/sections/ViewSection.aspx", "~/sections/ManageSectionEvents.aspx"); } if (targetOrganizationalLayer != null) { setOwnerBackLinks(targetOrganizationalLayer.ID, targetOrganizationalLayer.Name, "~/organizationallayers/ViewOrganizationalLayer.aspx", "~/organizationallayers/ManageOrganizationalLayerEvents.aspx"); } //MS-2100 //Has to happen before describing products because this may change the target entity initializeGroupRegistration(); setFeesAndContinueIfApplicable(); }
/// <summary> /// Show the Editor UI /// </summary> public void ShowEditor() { // Collision stuff for highlights during testing CollisionTimes = new List <List <DateTime> >(); CollisionStates = new List <JointCollisionStates[]>(); CollisionHighlights_3D = new Model3DGroup(); foreach (Gesture gg in GestureCollection) { CollisionTimes.Add(new List <DateTime>()); foreach (GestureFrame f in gg.Frames) { CollisionTimes.Last().Add(new DateTime()); } CollisionStates.Add(new JointCollisionStates[2] { JointCollisionStates.OutThere, JointCollisionStates.OutThere }); CollisionHighlights_3D.Children.Add(new Model3DGroup()); } HotspotCellsModelVisual3D_Hit_Editor.Content = CollisionHighlights_3D; // Initialize variable to store the initial state of the Gesture.Command being set CommandBackup = new ObservableCollection <Key>(); EnableKinect_Editor(); EditorVisible = true; FramesListBox.SelectedIndex = 0; // Reset Frame selection // Kill keyboard control on 3D grid EventLogic.RemoveRoutedEventHandlers(ViewPort3D_Editor.CameraController, HelixToolkit.Wpf.CameraController.KeyDownEvent); }
public ActionResult ViewEventsByDate() { _viewModel = new EventViewModel(); try { EventLogic eventLogic = new EventLogic(); DateTime today = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day); _viewModel.Events = eventLogic.GetEntitiesBy(s => s.Date == today); _viewModel.Events.ForEach(e => { e.Status = eventLogic.GetEventStatus(e); }); ViewBag.Programmes = _viewModel.ProgrammeSelectList; ViewBag.Departments = _viewModel.DepartmentSelectList; ViewBag.Levels = _viewModel.LevelSelectList; ViewBag.Sessions = _viewModel.SessionSelectList; ViewBag.Locations = _viewModel.LocationSelectList; ViewBag.Courses = _viewModel.CourseSelectList; ViewBag.Halls = _viewModel.HallSelectList; ViewBag.EventTypes = _viewModel.EventTypeSelectList; } catch (Exception ex) { SetMessage("Error! " + ex.Message, Message.Category.Error); } return(View(_viewModel)); }
public async Task <ActionResult> Create(Attende attende, List <int> events, HttpPostedFileBase thumbnail) { try { string fileName = ""; if (thumbnail != null) { fileName = Guid.NewGuid().ToString() + ".png"; } if (attende.ID == 0) { attende.AddedBY = CurrentUserSession.UserID; } attende.Thumbnail = fileName; await attendBuisness.AddUpdateAttendee(attende, events); if (thumbnail != null) { thumbnail.SaveAs(Path.Combine(ImageSavePath, fileName)); } return(RedirectToAction("Index")); } catch (Exception ex) { Helpers.LogError("Atted create error", ex); EventLogic eventLogic = new EventLogic(); ViewBag.Events = await eventLogic.GetAllEvents(); ViewBag.Error = Literals.ErrorMessage; return(View(attende)); } }
public async Task <ActionResult> ActivitiesByEvent(string Token, int eventId) { EventLogic logic = new EventLogic(); var data = await logic.ActivitiesByEvent(CurrentUserSession.AttendesID.Value, eventId); return(Json(new { Data = data })); }
/// <summary> /// Initializes the target object for the page /// </summary> /// <remarks>Many pages have "target" objects that the page operates on. For instance, when viewing /// an event, the target object is an event. When looking up a directory, that's the target /// object. This method is intended to be overriden to initialize the target object for /// each page that needs it.</remarks> protected override void InitializeTargetObject() { base.InitializeTargetObject(); targetRegistration = LoadObjectFromAPI <msEventRegistration>(ContextID); if (targetRegistration == null) { GoToMissingRecordPage(); return; } targetEvent = LoadObjectFromAPI <msEvent>(targetRegistration.Event); targetEntity = LoadObjectFromAPI <msEntity>(targetRegistration.Owner); if (targetEvent == null || targetEntity == null) { GoToMissingRecordPage(); return; } if (!targetEvent.AllowRegistrantsToChangeSessions || (targetEvent.DeadlineForChangingSessions.HasValue && targetEvent.DeadlineForChangingSessions < DateTime.Now) || !EventLogic.HasSessions(targetEvent.ID)) { liChangeSessions.Visible = false; } initializeRegistrationFields(); createdBy = LoadObjectFromAPI <msUser>(targetRegistration.CreatedBy); status = getStatus(); loadEventOwners(); }
public async Task <ActionResult> VendorById(string Token, int id, int eventID) { VendorsLogic attendesBusiness = new VendorsLogic(); EventLogic eventLogic = new EventLogic(); var x = await attendesBusiness.GetVendorById(id); var vendorEvent = x.VendorsEvents.FirstOrDefault(y => y.EventID == eventID); var VendorQuestions = await eventLogic.VendorSurveyQuestions(CurrentUserSession.AttendesID.Value, id); var floorMapping = vendorEvent?.FloorMapLocation?.FloorRegionMappings.FirstOrDefault(); return(Json(new { data = new { x.ID, x.Name, x.Description, x.DocURL, Thumbnail = imageToUrlConvertionHandler(x.Thumbnail), //Helpers.ImageToBase64(MvcCustom.APiImagePath(x.Thumbnail)), x.Status, x.TwitterURL, x.WebsiteURL, vendorEvent?.BoothNo, vendorEvent?.StartTime, VendorPackageType = x.VendorsEvents.FirstOrDefault(y => y.EventID == eventID)?.UserPackageType?.Name, vendorEvent?.EndTime, SurveyQuestions = VendorQuestions.Select(a => new QuestionsWithOptions { QID = a.QID, QuestionText = a.QuestionText, IsAtActiivtyLevel = a.IsAtActiivtyLevel, QuestionResponseType = a.QuestionResponseType, HideorShowQuestion = a.HideorShowQuestion, options = a.options, IsSubmitted = a.IsSubmitted, IsAtVendorLevel = a.IsAtVendorLevel, IsAtSponsorLevel = a.IsAtSponsorLevel }), Note = x.Notes.FirstOrDefault(y => y.UserID == CurrentUserSession.AttendesID.Value && y.EventID == eventID)?.Text, FloorMap = floorMapping != null ? new { floorMapping?.FloorMapping?.ID, FloorName = vendorEvent?.FloorMapLocation?.Location } : null, Activities = x.VendorActivities.Select(y => y.Activite).Select(y => new { y.ID, y.Name, y.StartTime, y.EndTime }), Vendors = x.VendorActivities.SelectMany(y => y.Activite.BookMarks.Select(z => z.Attende)) .Where(y => y.IsSpeaker).Distinct(new AttendeeComparer()). Select(y => new { y.FirstName, y.Lastname, y.TitleName, Thubnail = compressedImageConvertionHandler(y.Thumbnail) }) } }, JsonRequestBehavior.AllowGet)); }
public EventController(IMapper mapper, EventLogic eventLogic, ControllerHelper controllerHelper, LogLogic logLogic) { _mapper = mapper; _eventLogic = eventLogic; _controllerHelper = controllerHelper; _logLogic = logLogic; }
/// <summary> /// Get attendees info for specific event /// </summary> /// <param name="eventID"></param> /// <returns></returns> public ActionResult GetAttendees(int eventID) { var eventLogic = new EventLogic(); return(Json(eventLogic.GetEeventAttendes(eventID). Where(x => !x.IsAdmin && (x.EnableMessaging == true)). Select(x => new { AttendeeID = x.ID, x.FirstName, x.Lastname }), JsonRequestBehavior.AllowGet)); }
public static void RansomwareSimulation() { ActiveEvent = "Ransomware"; Percent = 2; //show on progress bar Steps = RansomwareSteps; Hints = RansomwareHints; EventLogic.RansomwareAttack(); }
protected override bool CheckSecurity() { if (!base.CheckSecurity()) { return(false); } if (targetEvent.InviteOnly && (ConciergeAPI.CurrentEntity == null || !EventLogic.IsInvited(targetEvent.ID, ConciergeAPI.CurrentEntity.ID))) { return(false); } // MS-3032 //if (ConciergeAPI.CurrentEntity != null && EventLogic.IsRegistered(targetEvent.ID, ConciergeAPI.CurrentEntity.ID)) //return false; if (!targetEvent.VisibleInPortal && !ConciergeAPI.HasBackgroundConsoleUser) { return(false); } if ((targetEvent.RegistrationCloseDate ?? targetEvent.EndDate) < DateTime.Today) { return(false); } // MS-4745 if (EventLogic.IsRegistrationClosed(targetEvent)) { return(false); } // is the registration open? if (targetEvent.RegistrationOpenDate != null && targetEvent.RegistrationOpenDate > DateTime.Now) { return(false); } if (targetEvent.RegistrationMode == EventRegistrationMode.Normal && ConciergeAPI.CurrentEntity != null && EventLogic.IsRegistered(targetEvent.ID, ConciergeAPI.CurrentEntity.ID) ) { return(false); } if (targetEvent.RegistrationMode == EventRegistrationMode.Tabled) // tabled event { return(false); } return(true); }
public MockedEventLogic() { var eventDal = new MockedEventDal().Mock; var autoMapperConfig = AutoMapperConfig.Config.CreateMapper(); var rpcClient = new Mock <IRpcClient>(); var publisher = new Mock <IPublisher>(); EventLogic = new EventLogic(eventDal, autoMapperConfig, rpcClient.Object, publisher.Object); }
public ActionResult Event() { EventLogic el = new EventLogic(); EventViewModel rvm = el.GetEventData(); //Notifications should be seen return(View(rvm)); }
public AttendanceController() { _studentLogic = new StudentLogic(); _eventLogic = new EventLogic(); _absentTypeLogic = new AbsentTypeLogic(); _attendanceLogic = new AttendanceLogic(); _absentLogLogic = new AbsentLogLogic(); _courseLogic = new CourseLogic(); }
protected void setRegistrationLink() { // is the registration open? if (targetEvent.RegistrationOpenDate != null && targetEvent.RegistrationOpenDate > DateTime.Now) { lblRegistrationClosed.Text = string.Format("Registration for this event opens on {0} at {1}.", targetEvent.RegistrationOpenDate.Value.ToLongDateString(), targetEvent.RegistrationOpenDate.Value.ToShortTimeString()); hlRegistration.Visible = false; return; } // is it closed? if (EventLogic.IsRegistrationClosed(targetEvent)) { lblRegistrationClosed.Text = "Registration for this event is closed."; hlRegistration.Visible = false; return; } // CORE-1018 hlRegistration.NavigateUrl = !string.IsNullOrWhiteSpace(targetEvent.RegistrationUrl) ? targetEvent.RegistrationUrl : string.Format("~/events/RegisterForEvent.aspx?contextID={0}", ContextID); if (targetEvent.RegistrationMode == EventRegistrationMode.Normal && ConciergeAPI.CurrentEntity != null && EventLogic.IsRegistered(targetEvent.ID, ConciergeAPI.CurrentEntity.ID) ) { // MS-3032 lblRegistrationClosed.Text = "You have already registered for this event."; hlRegistration.Visible = false; // now, can we register a guest? using (var api = GetServiceAPIProxy()) { if ( api.GetApplicableRegistrationFees(targetEvent.ID, CurrentEntity.ID) .ResultValue.Exists(x => x.IsGuestRegistration)) { // guest registration is available liRegisterAGuest.Visible = true; } } return; } if (targetEvent.RegistrationMode == EventRegistrationMode.Tabled) // tabled event { hlRegistration.Visible = false; hlPurchaseSeats.Visible = true; hlViewMySeats.Visible = true; hlPurchaseSeats.NavigateUrl = string.Format("PurchaseTableSeats.aspx?contextID=" + ContextID); hlViewMySeats.NavigateUrl = string.Format("ViewTableSeats.aspx?contextID=" + ContextID); } }
// GET: Attendes/Create public async Task <ActionResult> Create(int?id) { var attende = await attendBuisness.GetAttende(id); EventLogic eventLogic = new EventLogic(); ViewBag.Events = await eventLogic.GetAllEvents(); return(View(attende)); }
// GET: AppUsers/Details/5 //public async Task<ActionResult> Details(int? id) //{ // if (id == null) // { // return new HttpStatusCodeResult(HttpStatusCode.BadRequest); // } // AppUser appUser = await db.AppUsers.FindAsync(id); // if (appUser == null) // { // return HttpNotFound(); // } // return View(appUser); //} // GET: AppUsers/Create public async Task <ActionResult> Create(int?id) { var adminUser = id != null?db.Attendes.Find(id) : new Attende() { AdminInfo = new AdminInfo() }; EventLogic eventLogic = new EventLogic(); ViewBag.Events = await eventLogic.GetAllEvents(); return(View(adminUser)); }
public ReservationSystemForm(User user) { InitializeComponent(); _user = user; _eventRepo = new EventLogic(new EventOracleContext()); _guestRepo = new GuestLogic(new GuestOracleContext()); _locationRepo = new LocationLogic(new LocationOracleContext()); _events = _eventRepo.GetAllEvents(); cmbEvents.DataSource = _events; cmbEvents.SelectedIndex = 0; }
protected override void InitializePage() { base.InitializePage(); Search s = new Search(msEventRegistration.CLASS_NAME); s.AddCriteria(Expr.Equals("Owner", CurrentEntity.ID)); s.AddSortColumn("CreatedDate", true); s.AddOutputColumn("Event"); s.AddOutputColumn("Event.Name"); s.AddOutputColumn("Event.StartDate"); s.AddOutputColumn("Event.AllowRegistrantsToChangeSessions"); s.AddOutputColumn("Event.DeadlineForChangingSessions"); s.AddOutputColumn("CreatedDate"); var results = APIExtensions.GetSearchResult(s, 0, null); gvEvents.DataSource = results.Table; gvEvents.DataBind(); if (results.Table != null && results.Table.Rows != null && results.Table.Rows.Count > 0) { var eventId = string.Empty; if (results.Table.Columns.Contains("Event")) { eventId = Convert.ToString(results.Table.Rows[0]["Event"]); } bool allowRegistrantsToChangeSessions = false; if (results.Table.Columns.Contains("Event.AllowRegistrantsToChangeSessions")) { bool.TryParse(Convert.ToString(results.Table.Rows[0]["Event.AllowRegistrantsToChangeSessions"]), out allowRegistrantsToChangeSessions); } DateTime deadlineForChangingSessions = DateTime.MaxValue; if (results.Table.Columns.Contains("Event.DeadlineForChangingSessions") && results.Table.Rows[0]["Event.DeadlineForChangingSessions"] != DBNull.Value) { deadlineForChangingSessions = Convert.ToDateTime(results.Table.Rows[0]["Event.DeadlineForChangingSessions"]); } if (!allowRegistrantsToChangeSessions || deadlineForChangingSessions < DateTime.Now || (!string.IsNullOrWhiteSpace(eventId) && !EventLogic.HasSessions(eventId))) { gvEvents.Columns[3].Visible = false; // Hide the (change sessions) button } } }
public static void AddWeeklyEvents() { try { EventLogic eventLogic = new EventLogic(); UserLogic userLogic = new UserLogic(); List <EVENT> activeEvents = new List <EVENT>(); List <EVENT> weeklyEvents = new List <EVENT>(); activeEvents = eventLogic.GetEntitiesBy(e => e.Is_Weekly == true && e.Active == true && e.Date != DateTime.Now); if (activeEvents != null) { weeklyEvents = activeEvents.Where(e => e.Date.DayOfWeek == DateTime.Now.DayOfWeek).ToList(); weeklyEvents.ForEach(e => { EVENT weekLyEvent = new EVENT(); weekLyEvent.Active = true; weekLyEvent.Course_Id = e.Course_Id; weekLyEvent.Date = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day); weekLyEvent.Department_Id = e.Department_Id; weekLyEvent.Event_End = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, e.Event_End.Hour, e.Event_End.Minute, e.Event_End.Second); weekLyEvent.Event_Start = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, e.Event_Start.Hour, e.Event_Start.Minute, e.Event_Start.Second); weekLyEvent.Event_Type_Id = e.Event_Type_Id; weekLyEvent.Hall_Id = e.Hall_Id; weekLyEvent.Is_Weekly = true; weekLyEvent.Level_Id = e.Level_Id; weekLyEvent.Location_Id = e.Location_Id; weekLyEvent.Programme_Id = e.Programme_Id; weekLyEvent.Session_Id = e.Session_Id; weekLyEvent.User_Id = userLogic.GetAll().FirstOrDefault().Id; EVENT existingEvent = eventLogic.GetEntitiesBy(c => c.Course_Id == e.Course_Id && c.Date == weekLyEvent.Date && c.Department_Id == e.Department_Id && c.Event_End == weekLyEvent.Event_End && c.Event_Start == weekLyEvent.Event_Start && c.Event_Type_Id == e.Event_Type_Id && c.Hall_Id == e.Hall_Id && c.Level_Id == e.Level_Id && c.Location_Id == e.Location_Id && c.Programme_Id == e.Programme_Id && c.Session_Id == e.Session_Id).LastOrDefault(); if (existingEvent == null) { eventLogic.Create(weekLyEvent); } }); } } catch (Exception ex) { return; } }
public JsonResult GetEvent(long eventId) { JsonResponseModel result = new JsonResponseModel(); try { if (eventId > 0) { EventLogic eventLogic = new EventLogic(); EVENT myEvent = eventLogic.GetEntityBy(c => c.Id == eventId); if (myEvent != null) { result.EventId = myEvent.Id; result.EventTypeId = myEvent.Event_Type_Id; result.CourseId = myEvent.COURSE != null?Convert.ToInt64(myEvent.Course_Id) : 0; result.HallId = myEvent.HALL != null?Convert.ToInt32(myEvent.Hall_Id) : 0; result.EventStart = myEvent.Event_Start.ToShortTimeString(); result.EventEnd = myEvent.Event_End.ToShortTimeString(); result.LocationId = myEvent.Location_Id; result.Date = myEvent.Date.ToShortDateString(); result.SessionId = myEvent.Session_Id; result.ProgrammeId = myEvent.Programme_Id; result.DepartmentId = myEvent.Department_Id; result.LevelId = myEvent.Level_Id; result.EventActive = myEvent.Active != null?Convert.ToBoolean(myEvent.Active) : false; result.IsWeekly = myEvent.Is_Weekly != null?Convert.ToBoolean(myEvent.Is_Weekly) : false; } result.IsError = false; } else { result.IsError = true; result.Message = "Invalid parameter"; } } catch (Exception ex) { result.IsError = true; result.Message = ex.Message; } return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult SendMessage(string chatMessage, int channelId, HttpPostedFileBase uploadedImage) { EventLogic eventLogic = new EventLogic(); string imageName = ""; string imageURL = ""; int senderId = CurrentUserSession.Attende.ID; if (uploadedImage != null) { imageName = eventLogic.createGUIDFileNameFromFile(uploadedImage); imageURL = imageToUrlConvertionHandler(imageName); } bool status = firechatlogic.SendMessage(senderId, chatMessage, channelId, uploadedImage, imageName, ImageSavePath, imageURL); return(Json(status, JsonRequestBehavior.AllowGet)); }
public CarController() { companyLogic = new CompanyLogic(); carLogic = new CarLogic(); carModelLogic = new CarModelLogic(); carMakeLogic = new CarMakeLogic(); bookingLogic = new BookingLogic(); requestBookingLogic = new RequestBookingLogic(); eventLogic = new EventLogic(); addressLogic = new AdressLogic(); utilisateurLogic = new UtilisateurLogic(); statusLogic = new StatusLogic(); stopOverLogic = new StopOverLogic(); stopOverAddressLogic = new StopOverAddressLogic(); notificationLogic = new NotificationLogic(); }
protected override bool CheckSecurity() { if (!base.CheckSecurity()) { return(false); } if (ConciergeAPI.HasBackgroundConsoleUser) { return(true); } if (targetEvent.SafeGetValue <bool>("InviteOnly") && !EventLogic.IsInvited(targetEvent.ID, targetEntity.ID)) { return(false); } if (targetEntity.ID == ConciergeAPI.CurrentEntity.ID) { return(true); } if (targetChapter != null) { return(targetEvent.VisibleInPortal && canManageEvents(targetChapter.Leaders)); } if (targetSection != null) { return(targetEvent.VisibleInPortal && canManageEvents(targetSection.Leaders)); } if (targetOrganizationalLayer != null) { return(targetEvent.VisibleInPortal && canManageEvents(targetOrganizationalLayer.Leaders)); } var mode = Request.QueryString["mode"]; if (mode == "group" && targetEntity.ID == ConciergeAPI.CurrentEntity.ID) { return(true); } //Default to false for now because currently only leaders can create events in the portal return(false); }
public CommandHandler(CommandService commands, DiscordSocketClient client, IMessageTriggerService msgTrgSrvs, MediaProcessor mediaProcessor, MessageTriggers messageTriggers, ModLogic modLogic, PunishLogic punishLogic, NotifyLogic notifyLogic, EventLogic eventLogic, CustomCommandLogic customCommandLogic, IActivityLogService activityLogService) { _commands = commands; _client = client; _msgTrgSrvs = msgTrgSrvs; _modLogic = modLogic; _punishLogic = punishLogic; _notifyLogic = notifyLogic; _eventLogic = eventLogic; _customCommandLogic = customCommandLogic; _mediaProcessor = mediaProcessor; _messageTriggers = messageTriggers; _tokenSource = new CancellationTokenSource(); _activityLogService = activityLogService; }
static async Task Main(string[] args) { try { EventLogic eventLogic = new EventLogic(); ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; await eventLogic.SendScheduledActivityNotifications(); await eventLogic.SendSurveyNotifications(); } catch (Exception ex) { Error error = new Error(); error.LogErrorToDB(ex, "Job"); Helpers.LogError(ex.Message, ex); Environment.Exit(0); } }
public static void PhishSimulation() { //if (Class_Firewall.blockedDomains.Contains) ActiveEvent = "Phishing Email"; Percent = 2; //show on progress bar a little Steps = PhishSteps; Hints = PhishHints; Class_Firewall.blockedDomains.Clear(); //clear domains EventLogic.PhishingEmailAttack(); // the first email //Populate phishing email every 10 seconds timer = new Timer(); timer.Tick += new EventHandler(timer_Tick); timer.Interval = 10000; timer.Start(); }
private void LaunchEditor() { // Collision stuff for highlights during testing CollisionTimes = new List <List <DateTime> >(); CollisionStates = new List <JointCollisionStates[]>(); CollisionHighlights_3D = new Model3DGroup(); foreach (Gesture gg in GestureCollection) { CollisionTimes.Add(new List <DateTime>()); foreach (GestureFrame f in gg.Frames) { CollisionTimes.Last().Add(new DateTime()); } CollisionStates.Add(new JointCollisionStates[2] { JointCollisionStates.OutThere, JointCollisionStates.OutThere }); CollisionHighlights_3D.Children.Add(new Model3DGroup()); } HotspotCellsModelVisual3D_Hit_Editor.Content = CollisionHighlights_3D; // Initialize variable to store the initial state of the Gesture.Command being set CommandBackup = new ObservableCollection <Key>(); // Enable Kinect if (kinect != null) { kinect.SkeletonStream.Enable(); kinect.SkeletonFrameReady += SkeletonFrameReady_Draw3D_Editor; kinect.SkeletonFrameReady += SkeletonFrameReady_Draw3D_Editor; kinect.SkeletonFrameReady += SkeletonFrameReady_Draw3D_Front_Editor; kinect.SkeletonFrameReady += SkeletonFrameReady_Draw3D_Side_Editor; kinect.SkeletonFrameReady += SkeletonFrameReady_ToggleBackground_Editor; kinect.SkeletonFrameReady += SkeletonFrameReady_Detect_Editor; kinect.Start(); } // Show Editor TheEditor.Visibility = Visibility.Visible; EditorOverlay.Visibility = Visibility.Hidden; // Hide Manager ManagerOverlay.Visibility = Visibility.Visible; // Reset Frame selection FramesListBox.SelectedIndex = 0; // Kill keyboard control on 3D grid EventLogic.RemoveRoutedEventHandlers(ViewPort3D_Editor.CameraController, HelixToolkit.Wpf.CameraController.KeyDownEvent); }
private ATTENDANCE ProcessHallAttendance(HALL hall, STUDENT student) { ATTENDANCE attendance = null; try { AttendanceLogic attendanceLogic = new AttendanceLogic(); EventLogic eventLogic = new EventLogic(); int numberOfTimesPresent = attendanceLogic.GetEntitiesBy(s => s.EVENT.Hall_Id == hall.Id && s.Student_Id == student.Person_Id && s.Attendance_Status_Id == (int)AttendanceStatuses.Present).Count(); int numberOfLectures = eventLogic.GetEntitiesBy(s => s.Hall_Id == hall.Id && (s.Active == true || s.Active == null)).Count(); int numberOfAbsence = attendanceLogic.GetEntitiesBy(s => s.EVENT.Hall_Id == hall.Id && s.Student_Id == student.Person_Id && s.Attendance_Status_Id == (int)AttendanceStatuses.Excused).Count(); int numberOfLecturesHeld = numberOfLectures - numberOfAbsence; double eligibilityPercentage = (Convert.ToDouble(numberOfTimesPresent) / Convert.ToDouble(numberOfLecturesHeld)) * 100.0; attendance = new ATTENDANCE(); attendance.Percentage = eligibilityPercentage; //result.ApproximateNumberOfLectures = numberOfLecturesHeld; //result.EligibilityPercentage = eligibilityPercentage; //result.NumberOfAbsent = numberOfAbsence; //result.NumberOfPresent = numberOfTimesPresent; //result.TotalNumberOfLectures = numberOfLectures; if (eligibilityPercentage > 75) { attendance.IsEligible = true; } else { attendance.IsEligible = false; } } catch (Exception) { throw; } return(attendance); }