示例#1
0
文件: Main.cs 项目: nghipq/TOS_WF
 /**
  * Tạo màn hình chọn suất chiếu
  */
 public void Load_ScheduleScreen()
 {
     frmFilms.Visible      = false;
     frmSchedule           = new ScheduleList();
     frmSchedule.MdiParent = this;
     frmSchedule.Show();
 }
        private void BindData()
        {
            ScheduleBLL schedule = new ScheduleBLL();

            ScheduleList.DataSource = schedule.GetScheduleOfTrainees();
            ScheduleList.DataBind();
        }
示例#3
0
 /// <summary>
 /// オブジェクトをコピーする
 /// </summary>
 /// <param name="editData"></param>
 internal void Clone(Alerm editData)
 {
     try
     {
         Name          = editData.Name;
         Message       = editData.Message;
         LabelColor    = editData.LabelColor;
         EdgeColor     = editData.EdgeColor;
         ForeColor     = editData.ForeColor;
         Enable        = editData.Enable;
         ExecPath      = editData.ExecPath;
         ExecType      = editData.ExecType;
         ExecTypeIndex = editData.ExecTypeIndex;
         FontName      = editData.FontName;
         TimeAddUpDown = editData.TimeAddUpDown;
         ScheduleList.Clear();
         foreach (var s in editData.ScheduleList)
         {
             ScheduleList.Add(s);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#4
0
 void IXmlSerializable.ReadXml(XmlReader reader)
 {
     reader.ReadStartElement();
     _isRecording = reader.DeserializeXml <bool>();
     _currentlyRecordingSchedules = reader.DeserializeXml <ScheduleList>();
     reader.ReadEndElement();
 }
示例#5
0
 public EditSchedule()
 {
     InitializeComponent();
     schedules = new ScheduleList();
     locations = new LocationList();
     sections  = new SectionList();
 }
示例#6
0
        // START SCHEDULE LIST


        public ScheduleList GetScheduleList(Guid jobid)
        {
            if (jobid != Guid.Empty)
            {
                using (var context = new CloudbassContext())
                {
                    var schedules = context.Schedules.AsNoTracking()
                                    .Where(x => x.JobId == jobid)
                                    .OrderBy(x => x.Id);

                    if (schedules != null)
                    {
                        var scheduleListView = new ScheduleList();
                        foreach (var schedule in schedules)
                        {
                            var scheduleVm = new Schedule()
                            {
                                JobId   = schedule.JobId.ToString("D"),
                                Id      = schedule.Id,
                                text    = schedule.text,
                                SchType = schedule.SchType,
                                //SchTypeId = schedule.SchTypeId,
                                //SchTypName = schedule.SchType.name,
                                start_date = schedule.start_date,
                                end_date   = schedule.end_date,
                                //StatusName = schedule.ScheduleStatu.title
                            };
                        }
                        return(scheduleListView);
                    }
                }
            }
            return(null);
        }
 /// <summary>
 /// Конструктор списка событий
 /// </summary>
 /// <param name="input">Список событий</param>
 public Schedule(params Schedule[] input)
 {
     foreach (Schedule s in input)
     {
         ScheduleList.Add(s);
     }
 }
示例#8
0
        private static Conflicts NextClassesAtDifferentAddress(ScheduleList allClasses)
        {
            var conflicts = new Conflicts();
            var message   = "Адреса двух аудиторий, в которых проходят два соседних занятия, различны.";

            var classes = from c in allClasses
                          orderby c.Group.Name, c.Time.Day, c.Time.Number
            select c;

            var prevClass = classes.ElementAt(0);

            for (int i = 1; i < allClasses.Count; ++i)
            {
                var currClass = classes.ElementAt(i);
                if (prevClass.Time.Day == currClass.Time.Day &&
                    currClass.Time.Number - prevClass.Time.Number <= 1 &&
                    prevClass.Classroom.Address != currClass.Classroom.Address)
                {
                    var conflictingClasses = new List <FullClassRecord> {
                        prevClass, currClass
                    };
                    conflicts.Add(new Conflict(message, ConflictType.Warning, conflictingClasses));
                }
            }
            return(conflicts);
        }
示例#9
0
 private void DeleteSection_Load(object sender, EventArgs e)
 {
     sectionList = new SectionList();
     sectionStudentList = new SectionStudentList();
     scheduleList = new ScheduleList();
     PopulateSections();
 }
示例#10
0
 public DeleteTaughtCourse()
 {
     InitializeComponent();
     taughtCourses      = new TaughtCourseList();
     scheduleList       = new ScheduleList();
     sectionStudentList = new SectionStudentList();
     sectionList        = new SectionList();
 }
示例#11
0
 //Populate the combo box of the instructor IDs and instantiantes objects to use
 private void DeleteInstructor_Load(object sender, EventArgs e)
 {
     instructorList     = new InstructorList();
     scheduleList       = new ScheduleList();
     sectionStudentList = new SectionStudentList();
     sectionList        = new SectionList();
     PopulateInstructors();
 }
示例#12
0
        // Commands

        public void CreateNewSchedule()
        {
            var newSchedule             = new Schedule();
            var categorySelectViewModel = new CategorySelectViewModel(newSchedule);

            _windowManager.ShowDialog(categorySelectViewModel);

            ScheduleList.Add(newSchedule);
        }
示例#13
0
        private static Conflicts LecterersInDifferentClassrooms(ScheduleList allClasses)
        {
            var message = "Преподаватель находится в нескольких аудиториях одновременно.";

            var groupClasses = from c in allClasses
                               group c by new Tuple <Lecturer, ClassTime>(c.Lecturer, c.Time);

            return((from c in groupClasses where c.Count() > 1 select new Conflict(message, ConflictType.Conflict, c)).ToList());
        }
示例#14
0
        private static Conflicts GreaterFourClassesPerDay(ScheduleList allClasses)
        {
            var message = "Больше 4х занятий в день";

            var groupClasses = from c in allClasses
                               group c by new Tuple <Group, Weekdays>(c.Group, c.Time.Day);

            return((from c in groupClasses where c.Count() >= 5 select new Conflict(message, ConflictType.Warning, c)).ToList());
        }
示例#15
0
        public void GetSchedule()
        {
            var repository     = new ScheduleList();
            var testReportType = ReportType.MemberReportType;

            var schedule = repository.GetSchedule(testReportType);

            Assert.IsTrue(null != schedule, "returned schedule does not exist");
            Assert.AreEqual(schedule.ReportType, testReportType, "report types are not equal");
        }
示例#16
0
 public override void AddItem(RITE Item)
 {
     ScheduleList.Add(Item);
     if (ScheduleList.Count == 1)
     {
         IsLocation = true;
     }
     else if (ScheduleList.Count > 1)
     {
         IsLocation = false;
     }
 }
        public OpenDialog()
        {
            InitializeComponent();
            Background = new SolidColorBrush(Config.BackgroundColour);

            monthCalendar.SelectedDate = DateTime.Today;
            DatePreview.Text           = DateTime.Today.ToLongDateString();
            _mth = DateTime.Today;
            BindScheduleList();

            ScheduleList.SelectedIndex = 0;
            ScheduleList.Focus();
        }
示例#18
0
文件: Main.cs 项目: nghipq/TOS_WF
 public Main()
 {
     InitializeComponent();
     frmFilms             = new FilmList();
     frmSchedule          = new ScheduleList();
     frmRoom              = new frmRoom();
     frmLogin             = new Login();
     frmAreas             = new Areas();
     TicketN              = new frmTicket();
     frmConfirmTicket     = new ConfirmTicket();
     this.TopMost         = true;
     this.FormBorderStyle = FormBorderStyle.Fixed3D;
     this.WindowState     = FormWindowState.Maximized;
 }
        public void TestCreateDoctorDayScheduleDictionary()
        {
            ScheduleList s = new ScheduleList();

            Assert.IsNotNull(s);
            Dictionary <String, String> dic;
            string date     = "12/2/2013";
            string doctorID = "1";

            dic = s.createDoctorDayScheduleDictionary(date, doctorID);
            Assert.IsNotNull(dic);
            Assert.IsTrue(dic.ContainsKey("@date"));
            Assert.IsTrue(dic.ContainsKey("@doctorID"));
            Assert.AreSame(dic["@date"], date);
            Assert.AreSame(dic["@doctorID"], doctorID);
        }
示例#20
0
        private void InitializeProcessor(string settingsFile)
        {
            XmlDocument doc = new XmlDocument();

            doc.Load(settingsFile);

            XmlNamespaceManager nsMgr = new XmlNamespaceManager(doc.NameTable);

            nsMgr.AddNamespace("def", "http://smarthomecontrol.voronin.co.uk");

            //Loading local settings first
            XmlNode settingsNode = doc.SelectSingleNode("/def:Definition/def:LocalSettings", nsMgr);

            LocalSettings.InitializeParameters(IPAddress.Parse(settingsNode.Attributes["address"].Value),
                                               settingsNode.Attributes["dbConnection"].Value, this,
                                               settingsNode.Attributes["macAddress"].Value,
                                               settingsNode.Attributes["homeCoordinates"].Value);

            //Now loading gateways
            XmlNode node = doc.SelectSingleNode("/def:Definition/def:Gateways", nsMgr);

            Gateways = new GatewayList(node);

            //Next we load remotes
            node    = doc.SelectSingleNode("/def:Definition/def:Remotes", nsMgr);
            Remotes = new RemoteList(node);
            Remotes.ButtonPressed += ProcessDeviceEvent;

            //Loading list of schedules
            node      = doc.SelectSingleNode("/def:Definition/def:Schedules", nsMgr);
            Schedules = new ScheduleList(node);
            Schedules.ScheduleFired += ProcessDeviceEvent;

            //Finally we load zones
            node  = doc.SelectSingleNode("/def:Definition/def:Zones", nsMgr);
            Zones = new ZoneList(node, Gateways, ProcessChangedDeviceState, ProcessDeviceEvent);

            TriggerStartupCommands();

            queueCleanUpTimer.Elapsed += new ElapsedEventHandler(CleanUpCommandQueue);
            queueCleanUpTimer.Enabled  = true;

            //Creating command server for external commands (Alexa, Mobile App, etc - received from IIS gateway)
            CommandServer.CommandServer comSrv = new CommandServer.CommandServer(GetCurrentDeviceState, SimulateSpecificCommand);
            host = new ServiceHost(comSrv);
            host.Open();
        }
示例#21
0
        public void DeleteSchedule()
        {
            var repository     = new ScheduleList();
            var testReportType = 99;

            var newSchedule = new Schedule(testReportType, 5, new TimeSpan(12, 59, 59));
            var success     = repository.AddSchedule(newSchedule);

            Assert.IsTrue(success, "addition fail");

            success = repository.DeleteSchedule(testReportType);
            Assert.IsTrue(success, "delete fail");

            var schedule = repository.GetSchedule(testReportType);

            Assert.IsTrue(null == schedule, "schedule exist");
        }
示例#22
0
        public static void Run(Ising system, StdMt19937 randomNumberEngine, ScheduleList scheduleList)
        {
            if (system == null)
            {
                throw new ArgumentNullException(nameof(system));
            }
            if (randomNumberEngine == null)
            {
                throw new ArgumentNullException(nameof(randomNumberEngine));
            }
            if (scheduleList == null)
            {
                throw new ArgumentNullException(nameof(scheduleList));
            }

            system.ThrowIfDisposed();
            randomNumberEngine.ThrowIfDisposed();
            scheduleList.ThrowIfDisposed();

            if (!UpdaterElementTypesRepository.SupportTypes.TryGetValue(typeof(T), out var types))
            {
                throw new NotSupportedException($"{typeof(T).Name} does not support");
            }
            if (types.Item2 != system.IsingType)
            {
                throw new NotSupportedException($"{typeof(T).Name} supports only {system.IsingType}");
            }
            if (types.Item3 != system.GraphType)
            {
                throw new NotSupportedException($"{typeof(T).Name} supports only {system.GraphType}");
            }
            if (types.Item4 != system.FloatType)
            {
                throw new NotSupportedException($"{typeof(T).Name} supports only {system.FloatType}");
            }

            var updaterType = types.Item1;
            var ret         = NativeMethods.algorithm_Algorithm_run(updaterType,
                                                                    system.NativePtr,
                                                                    system.IsingType,
                                                                    system.GraphType,
                                                                    system.FloatType,
                                                                    randomNumberEngine.NativePtr,
                                                                    scheduleList.NativePtr);
        }
示例#23
0
        public IActionResult CreateSchedule(string datestr)
        {
            DateTime              date               = DateTime.Parse(datestr);
            IActionResult         response           = Unauthorized();
            ScheduleRepository    scheduleRepository = new ScheduleRepository();
            ScheduleList          scheduleList       = scheduleRepository.Schedule();
            AddDateRepository     addDate            = new AddDateRepository();
            AddMedicineRepository addMedicine        = new AddMedicineRepository();

            scheduleList = addDate.AddDateToList(scheduleList, date);
            scheduleList = addMedicine.AddMedicineList(scheduleList, _config);
            if (scheduleList.Schedules.Count == 0)
            {
                return(response);
            }
            response = Ok(scheduleList.Schedules);
            return(response);
        }
示例#24
0
        public void AddSchedule()
        {
            var repository     = new ScheduleList();
            var testReportType = 99;

            var newSchedule = new Schedule(testReportType, 5, new TimeSpan(12, 59, 59));
            var success     = repository.AddSchedule(newSchedule);
            var schedule    = repository.GetSchedule(testReportType);

            Assert.IsTrue(success, "addition fail");
            Assert.IsTrue(null != schedule, "returned schedule does not exist");

            Assert.AreEqual(newSchedule.ReportType, schedule.ReportType, "report types are not equal");
            Assert.AreEqual(newSchedule.Time, schedule.Time, "times are not equal");
            Assert.AreEqual(newSchedule.Week, schedule.Week, "weeks are not equal");

            success = repository.DeleteSchedule(testReportType);
            Assert.IsTrue(success, "delete fail");
        }
示例#25
0
        public ScheduleList AddDateToList(ScheduleList scheduleList, DateTime startdate)
        {
            int extra = 0;

            foreach (Schedule schedule in scheduleList.Schedules)
            {
                if (startdate.DayOfWeek == DayOfWeek.Sunday)
                {
                    extra++;
                    startdate = startdate.AddDays(extra);
                }
                else
                {
                    startdate = startdate.AddDays(1);
                }
                schedule.Date = startdate;
            }
            return(scheduleList);
        }
示例#26
0
        public ScheduleList AddMedicineList(ScheduleList scheduleList, IConfiguration _config)
        {
            List <string>   tempList     = new List <string>(); //To copy list so clearing wont affect it
            List <Medicine> medicineList = communication.GetMedicineList(_config);

            foreach (Schedule schedule in scheduleList.Schedules)
            {
                foreach (Medicine medicine in medicineList)
                {
                    if (medicine.TargetAilment == schedule.Ailment)
                    {
                        tempList.Add(medicine.Name);
                    }
                }
                string strToList = string.Join(",", tempList.ToArray()); // Makes string and rejoins as list to avoid reference
                schedule.Medicine = strToList.Split(',').ToList();
                tempList.Clear();
            }
            return(scheduleList);
        }
示例#27
0
        public ScheduleList AddDateToList(ScheduleList scheduleList, string dateStr)
        {
            DateTime startdate = DateTime.Parse(dateStr);

            foreach (Schedule schedule in scheduleList.Schedules)
            {
                if (startdate.DayOfWeek == DayOfWeek.Sunday)
                {
                    startdate     = startdate.AddDays(1);
                    schedule.Date = startdate;
                    startdate     = startdate.AddDays(1);
                }
                else
                {
                    schedule.Date = startdate;
                    startdate     = startdate.AddDays(1);
                }
            }
            return(scheduleList);
        }
示例#28
0
        //Instantiates all objects to be used and adds the table names to the tables combobox
        private void TotalHours_Load(object sender, EventArgs e)
        {
            scheduleList = new ScheduleList();

            locationList = new LocationList();
            locationList.Populate();
            sectionList = new SectionList();
            sectionList.Populate();
            instructorList = new InstructorList();
            instructorList.Populate();
            courseList = new CourseList();
            courseList.Populate();
            studentList = new StudentList();
            studentList.Populate();

            //Adds the tables of wanted data to be selected from in an Array
            String[] tables = { "Location", "Section", "Instructor", "Course", "Student", "All" };
            //Make above array the datasource of the tables combobox
            comboBoxBy.DataSource = tables;
        }
示例#29
0
        public async static Task <List <Schedule> > getSchedule(String routeID, int direction_id)
        {
            if (Database.RouteSchedules.ContainsKey(routeID))
            {
                return(Database.RouteSchedules[routeID]);
            }
            string url = globalURL + "/schedules?filter[date]=" + getLocalTime() +
                         "&filter[direction_id]=" + direction_id + "&filter[route]=" + routeID + "&sort=departure_time";
            string response = await DataFetcher.fetchData(url);

            ScheduleList    raw_data     = JsonConvert.DeserializeObject <ScheduleList>(response);
            List <Schedule> scheduleList = new List <Schedule>();

            for (int i = 0; i < raw_data.data.Length; i++)
            {
                Schedule schedule = raw_data.data[i];
                scheduleList.Add(schedule);
            }
            Database.RouteSchedules.Add(routeID, scheduleList);
            return(Database.RouteSchedules[routeID]);
        }
示例#30
0
        public ActionResult Table(FormCollection collection)
        {
            var formOfEmployment = collection["formOfEmployment"];
            var depName          = Session["UserDepName"].ToString();
            var fullName         = Session["UserFullName"].ToString();
            var schedules        = db.Schedules.Include(s => s.Person).Include(s => s.Workplace).Include(s => s.Person.DictTeam)
                                   .Where(s => s.active == true && s.Person.DictDepartment.Name == depName && s.Person.FullName == fullName);

            ScheduleList viewModel = new ScheduleList();

            if (formOfEmployment == null || formOfEmployment == "all")
            {
                viewModel.Person = db.Persons.Include(p => p.DictTeam).Where(s => s.active == true && s.DictDepartment.Name == depName).OrderBy(p => p.DictTeam.Name).ThenBy(p => p.FullName).ToList();
            }
            else
            {
                viewModel.Person = db.Persons.Include(p => p.DictTeam).Where(s => s.active == true && s.DictDepartment.Name == depName && s.FormOfEmployment == formOfEmployment).OrderBy(p => p.DictTeam.Name).ThenBy(p => p.FullName).ToList();
            }
            viewModel.Schedule = schedules.ToList();

            return(View(viewModel));
        }
示例#31
0
        private void LoadData()
        {
            if (m_SubCampaignId < 1)
                return;

            //private void InitializeSchedulerControl() {
            listMeetingSchedules = BPContext.FIGetBookingSchedule(3, m_SubCampaignId).ToList();
            //if (listMeetingSchedules == null || listMeetingSchedules.Count < 1)
                //return;

            //create data binding for resources
            List<CTResources> _lstResources = new List<CTResources>();
            _lstResources = BPContext.FIGetResources(m_SubCampaignId).ToList();
            if (_lstResources == null || _lstResources.Count < 1)
                return;

            List<CTResources> resourceList = new List<CTResources>();
            foreach (CTResources _item in _lstResources) {
                if (!resourceList.Exists(i => i.resource_id == _item.resource_id))
                    resourceList.Add(_item);
            }

            //resourceList.AddRange(resourceList.ToArray());

            /**
             * what does this part do? it does not make sense.
             */
            // ----
            List<int?> resourceids = new List<int?>();
            resourceList.ForEach(delegate(CTResources r) {
                resourceids.Add(r.resource_id);
            });
            // ---

            ResourceStorage resStorage = schedulerStorage1.Resources;
            resStorage.Mappings.Id = "resource_id";
            resStorage.Mappings.Caption = "resource_name";
            resStorage.DataSource = resourceList;

            //create binding list for schedules
            var result = BPContext.FIGetSubCampaignSchedules(m_SubCampaignId).ToList();
            if (result == null || result.Count < 1)
                return;

            ScheduleList schedList = new ScheduleList();
            schedList.AddRange(result.ToArray());

            //create storage for resource and schedule appointments
            AppointmentStorage aptStorage = schedulerStorage1.Appointments;
            //ResourceStorage resStorage = schedulerStorage1.Resources;

            //set mapping for resources
            //resStorage.Mappings.Id = "resource_id";
            //resStorage.Mappings.Caption = "resource_name";
            //resStorage.Mappings.Image = "picture";

            //set mapping for schedules
            aptStorage.Mappings.ResourceId = "resource_id";
            aptStorage.Mappings.Status = "status";
            aptStorage.Mappings.Subject = "subject";
            aptStorage.Mappings.Location = "address";
            aptStorage.Mappings.Description = "description";
            aptStorage.Mappings.Label = "label";
            aptStorage.Mappings.Start = "start_time";
            aptStorage.Mappings.End = "end_time";
            aptStorage.Mappings.AllDay = "all_day";
            aptStorage.Mappings.Type = "event_type";
            aptStorage.Mappings.RecurrenceInfo = "recurrence_info";
            aptStorage.Mappings.ReminderInfo = "reminder_info";

            //set custom fields mapping
            aptStorage.CustomFieldMappings.Add(new AppointmentCustomFieldMapping("zipcode", "zipcode"));
            aptStorage.CustomFieldMappings.Add(new AppointmentCustomFieldMapping("city", "city"));
            aptStorage.CustomFieldMappings.Add(new AppointmentCustomFieldMapping("schedule_type", "schedule_type"));

            //set the data bindings as datasources
            //resStorage.DataSource = resourceList;
            aptStorage.DataSource = schedList;

            //schedulerControl1.GroupType = SchedulerGroupType.None;
            schedulerControl1.GroupType = SchedulerGroupType.Resource;
            dateNavigator1.DateTime = DateTime.Today.AddMonths(1);
            dateNavigator1.DateTime = DateTime.Today;
        }