예제 #1
0
        public async Task SaveAsync(StudyType entity)
        {
            try
            {
                if (entity == null)
                {
                    return;
                }

                using (var timeLineContext = _contextFactory.GetTimeLineContext())
                {
                    var entityModel = await timeLineContext
                                      .StudyTypes
                                      .FirstOrDefaultAsync(item => item.Id.Equals(entity.Id));

                    if (entityModel == null)
                    {
                        entityModel = new DA.StudyType();
                        MapForUpdateentity(entity, entityModel);
                        await timeLineContext.StudyTypes.AddAsync(entityModel);
                    }
                    else
                    {
                        MapForUpdateentity(entity, entityModel);
                    }


                    timeLineContext.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #2
0
    public override void SelectTab(TabButton tabButton)
    {
        if (selectedTab != null)
        {
            selectedTab.Deselect();
        }

        selectedTab = tabButton;

        ResetTabButtonsVisuals();

        int index = tabButton.transform.GetSiblingIndex();

        StudyType studyType = tabButtons[index].GetComponent <StarLabsTabButton>().Type;

        onTabSelection?.Invoke(studyType);

        if (type == TabGroupType.SpriteBased)
        {
            selectedTab.Select(activeSprite);
        }
        else
        {
            selectedTab.Select(activeColor);
        }
    }
예제 #3
0
        public async ValueTask <IActionResult> Get(int id, StudyType study = StudyType.StudyMate)
        {
            Test model = null;

            if (study == StudyType.StudyMate)
            {
                model = await _repo.Item()
                        .Where(q => q.Id == id && q.StudyType == study)
                        .Include(t => t.Quizes)
                        .ThenInclude(q => q.Options)
                        .FirstOrDefaultAsync();
            }
            else
            {
                model = await _repo.Item()
                        .Where(q => q.Id == id && q.StudyType == study)
                        .Include(t => t.Videos)
                        .Include(t => t.Quizes)
                        .ThenInclude(q => q.Options)
                        .Include(t => t.UserTests)
                        .ThenInclude(u => u.UserQuizzes)
                        .Include(t => t.UserTests)
                        .ThenInclude(u => u.UserVideos)
                        .FirstOrDefaultAsync();
            }

            if (model != null)
            {
                return(Ok(model));
            }
            return(NotFound());
        }
예제 #4
0
        public async ValueTask <IActionResult> Get(int id, bool parent = false, StudyType study = StudyType.StudyMate)
        {
            if (parent)
            {
                if (study == StudyType.StudyMate)
                {
                    return(Ok(await _repo.Item()
                              .Where(q => q.CourseId == id && q.StudyType == study)
                              .Include(t => t.Videos)
                              .Include(t => t.Quizes)
                              .ThenInclude(q => q.Options)
                              .ToListAsync()));
                }
                return(Ok(await _repo.Item()
                          .Where(q => q.CourseId == id && q.StudyType == study)
                          .Include(t => t.Videos)
                          .Include(t => t.Quizes.Where(q => q.IncludeThis))
                          .ThenInclude(q => q.Options)
                          .Include(t => t.UserTests)
                          .ThenInclude(u => u.UserQuizzes)
                          .Include(t => t.UserTests)
                          .ThenInclude(u => u.UserVideos)
                          .ToListAsync()));
            }
            Test model = await _repo
                         .Item()
                         .Where(c => c.Id == id)
                         .FirstOrDefaultAsync();

            if (model != null)
            {
                return(Ok(model));
            }
            return(NotFound());
        }
예제 #5
0
        public RespirationsTitrationFinalTX(
            float TotalSleepTime,
            float SupineSleepTime,
            float LateralSleepTime,
            float RemSleepTime,
            float TotalRdi,
            float SupineRdi,
            float LateralRdi,
            float RemRdi,
            float LowestSao2,
            object CPAPorBIPAP,
            object TX,
            StudyType studyType)
        {
            initializeCommon(
                TotalSleepTime,
                SupineSleepTime,
                LateralSleepTime,
                RemSleepTime,
                TotalRdi,
                SupineRdi,
                LateralRdi,
                RemRdi,
                LowestSao2);

            mTxType    = CPAPorBIPAP.ToString();
            mTxValue   = TX.ToString();
            mStudyType = studyType;
            initializeData();
            commentOnSeverity();
        }
예제 #6
0
        public DurationComment(float totalSleepTime, float supineSleepTime, float remSleepTime, StudyType type)
        {
            mTotalSleepTime  = totalSleepTime;
            mSupineSleepTime = supineSleepTime;
            mRemSleepTime    = remSleepTime;
            mStudyType       = type;
            initializeSleepDuration();
            initializeSupineDuration();
            initializeRemDuration();
            initializeDurationTable();
            switch (type)
            {
            case StudyType.Diagnostic:
                initializeDiagnosticDurationResults();
                break;

            case StudyType.SplitNight:
                initializeSplitFinalDurationResults();
                break;

            case StudyType.Titration:
                initializeTitrationFinalTxDurationResults();
                break;
            }
            getDurationComment();
        }
예제 #7
0
파일: Program.cs 프로젝트: lulzzz/iRadiate
        private static void AddFirstStudyType()
        {
            StudyType s = new StudyType();

            s.Name      = "Bone Scan";
            s.ShortName = "Bone";
            retriever.SaveItem(s);
        }
예제 #8
0
        public IActionResult GetCount(int courseId, StudyType stype = StudyType.StudyMate)
        {
            var total = _repo
                        .Item()
                        .Where(q => q.Test.CourseId == courseId && q.IncludeThis && q.Test.StudyType == stype)
                        .Count();

            return(Ok(new { Score = total }));
        }
예제 #9
0
        public List <ComboBoxModel> Type()
        {
            List <ComboBoxModel> result = new List <ComboBoxModel>();
            var type = StudyType.GetAll();

            result = type.Select(s => new ComboBoxModel {
                id = s.id_studyType, Name = s.Name
            }).ToList();
            return(result);
        }
예제 #10
0
 public Group(string abbrevation, int year, Semester semester, int numberOfStudents, StudyForm studyForm, StudyType studyType, Language language)
 {
     Abbrevation      = abbrevation;
     Year             = year;
     Semester         = semester;
     NumberOfStudents = numberOfStudents;
     StudyForm        = studyForm;
     StudyType        = studyType;
     Language         = language;
 }
예제 #11
0
 public void WriteXml(XmlWriter writer)
 {
     writer.WriteString(Abbrevation);
     writer.WriteString(Year.ToString());
     writer.WriteString(Semester.ToString());
     writer.WriteString(NumberOfStudents.ToString());
     writer.WriteString(StudyForm.ToString());
     writer.WriteString(StudyType.ToString());
     writer.WriteString(Language.ToString());
 }
예제 #12
0
 public Student(string fullName, Sex sex, string group, double avgMark,
                double IncomePerFamMem, FamilyCategory FamilyCategory, StudyType StudyType)
 {
     this.FullName        = fullName;
     this.Sex             = sex;
     this.Group           = group;
     this.AvgMark         = avgMark;
     this.IncomePerFamMem = IncomePerFamMem;
     this.FamilyCategory  = FamilyCategory;
     this.StudyType       = StudyType;
 }
예제 #13
0
        private void AddNewStudyType()
        {
            StudyType st = new StudyType();

            st.NucMedPractice = DesktopApplication.CurrentPratice;
            StudyTypes.Add(st);

            DataStoreItemViewModel stvm = new DataStoreItemViewModel(st);

            DesktopApplication.MakeModalDocument(stvm, DesktopApplication.DocumentMode.New);
        }
예제 #14
0
        private void AddStudyType()
        {
            StudyType st = new StudyType();

            st.Name           = "Enter Name";
            st.NucMedPractice = (NucMedPractice)this.Item;
            StudyTypeViewModel stvm = new StudyTypeViewModel();

            stvm.SetItem(st);
            SelectedStudyType = stvm;
            StudyTypes.Add(stvm);
        }
예제 #15
0
 public async Task <IActionResult> Put([FromBody] StudyType value)
 {
     try
     {
         var entity = _mapper.Map <BL.StudyType>(value);
         var id     = _service.SaveAsync(entity);
         return(Ok(id));
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }
예제 #16
0
        public void Updata(DataGridView dgv, StudyType displayType, string field, List<Color> cr)
        {
            switch (displayType)
            {
                case StudyType.Discrete_values:
                    this.m_DiscreteValue[field].Updata(field, dgv, cr);
                    break;

                case StudyType.Value_intervals:
                    this.m_ValueIntervals[field].Updata(field, dgv, cr);
                    break;
            }
        }
예제 #17
0
        public async ValueTask <IActionResult> Get(string name, StudyType study = StudyType.StudyMate)
        {
            var model = await _repo
                        .Item()
                        .Where(c => c.Name.ToLower().Contains(name.ToLower()) && c.HasStudyPack)
                        .Include(c => c.Tests.Where(t => t.StudyType == study))
                        .FirstOrDefaultAsync();

            if (model != null)
            {
                return(Ok(model));
            }
            return(NotFound());
        }
예제 #18
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Institution != null ? Institution.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Area != null ? Area.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StudyType != null ? StudyType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Gpa != null ? Gpa.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Courses != null ? Courses.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Start.GetHashCode();
         hashCode = (hashCode * 397) ^ End.GetHashCode();
         return(hashCode);
     }
 }
예제 #19
0
 /**
  * <summary> Constructor from known parameters. </summary>
  * <param name="id"> Group's ID in the DB. </param>
  * <param name="abbreviation"> Abbreaviation of the program the students are in. </param>
  * <param name="name"> Name of the program the students are in. </param>
  * <param name="year"> Year/grade to which students belong to. </param>
  * <param name="semester"> Semester in which the students are. </param>
  * <param name="form"> Form of study the students attend. </param>
  * <param name="type"> Type of study the students are in. </param>
  * <param name="language"> Language of study in which the student use. </param>
  * <param name="studentCount"> Number of student's in a study group. </param>
  */
 public StudentGroup(UInt32 id, string abbreviation, string name, StudyYear year,
                     StudySemester semester, StudyForm form, StudyType type, StudyLanguage language,
                     UInt16 studentCount)
 {
     this.Id           = id;
     this.Abbreviation = abbreviation;
     this.Name         = name;
     this.Year         = year;
     this.Semester     = semester;
     this.Form         = form;
     this.Type         = type;
     this.Language     = language;
     this.StudentCount = studentCount;
     this.Subjects     = new Dictionary <UInt32, Subject>();
 }
예제 #20
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (value == null)
     {
         return(string.Empty);
     }
     try
     {
         StudyType studyType = (StudyType)Enum.Parse(typeof(StudyType), value.ToString());
         return(studyType == StudyType.SpeakFreely ? "自由发言" : "主讲");
     }
     catch (Exception)
     {
         return(string.Empty);
     }
 }
예제 #21
0
    public List <Study> GetStudiesByType(StudyType studyType)
    {
        List <Study> result = new List <Study>();

        foreach (var study in allStudies)
        {
            if (studyType != study.studyType)
            {
                continue;
            }

            result.Add(study);
        }

        return(result);
    }
예제 #22
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value == null || !(value is StudyType))
            {
                return("");
            }
            StudyType st = (StudyType)value;
            string    result;

            if (!display.TryGetValue(st, out result))
            {
                result      = st.GetDescription();
                display[st] = result;
            }
            return(result);
        }
예제 #23
0
        public async ValueTask <IActionResult> GetSane(int id, int uid, StudyType study = StudyType.StudyMate)
        {
            var model = await _repo.Item()
                        .Where(q => q.Id == id && q.StudyType == study)
                        .Include(t => t.Quizes.Where(q => q.IncludeThis).OrderBy(q => q.QuestionNumber))
                        .ThenInclude(q => q.Options)
                        //.Include(t => t.UserTests.Where(ut => ut.UserCourse.UserId == uid))
                        //    .ThenInclude(u => u.UserQuizzes)
                        .FirstOrDefaultAsync();

            if (model == null)
            {
                return(NotFound());
            }
            var utests = await _ut.Item().Where(ut => ut.UserCourse.UserId == uid && ut.TestId == id).Include(u => u.UserQuizzes).ToListAsync();

            model.UserTests = utests;
            return(Ok(model));
        }
예제 #24
0
 public static string ToString(StudyType value)
 {
     if (value == StudyType.Interventional)
     {
         return("interventional");
     }
     else if (value == StudyType.Observational)
     {
         return("observational");
     }
     else if (value == StudyType.ExpandedAccess)
     {
         return("expanded access");
     }
     else
     {
         throw new ArgumentException("Unrecognized StudyType value: " + value.ToString());
     }
 }
예제 #25
0
            public static bool TryParse(string value, out StudyType result)
            {
                result = default(StudyType);

                if (value == "interventional")
                {
                    result = StudyType.Interventional;
                }
                else if (value == "observational")
                {
                    result = StudyType.Observational;
                }
                else if (value == "expanded access")
                {
                    result = StudyType.ExpandedAccess;
                }
                else
                {
                    return(false);
                }

                return(true);
            }
예제 #26
0
        private void Bind_basic()
        {
            DataTable dt_School = School.Find(CK.K["IsDelete"] == false).ToDataTable();

            ddl_School.DataSource     = dt_School;
            ddl_School.DataValueField = "SchoolName";
            ddl_School.DataTextField  = "SchoolName";
            ddl_School.DataBind();

            DataTable dt_StudyType = StudyType.Find(CK.K["IsDelete"] == false).ToDataTable();

            ddl_StudyType.DataSource     = dt_StudyType;
            ddl_StudyType.DataValueField = "StudyTypeId";
            ddl_StudyType.DataTextField  = "StudyTypeText";
            ddl_StudyType.DataBind();


            ////导出文件年份
            //int earliestYear = 2000;
            //int nowYear = DateTime.Now.Year;
            //DataTable dt_Year = new DataTable();
            //dt_Year.Columns.Add("Year");
            //dt_Year.Columns.Add("YearText");
            //for (int i = earliestYear; i <= nowYear; i++)
            //{
            //    DataRow dr_Year = dt_Year.NewRow();
            //    dr_Year["Year"] = i;
            //    dr_Year["YearText"] = i + "年";
            //    dt_Year.Rows.Add(dr_Year);
            //}
            //ddl_year.DataSource = dt_Year;
            //ddl_year.DataTextField = "YearText";
            //ddl_year.DataValueField = "Year";
            //ddl_year.DataBind();
            //ddl_year.SelectedValue = nowYear.ToString();
        }
예제 #27
0
        public async ValueTask <IActionResult> Get(int id, bool child = false, StudyType study = StudyType.Main)
        {
            if (child)
            {
                if (study == StudyType.StudyMate)
                {
                    return(Ok(await _repo.Item().Where(q => q.TestId == id)
                              .Include(q => q.Options)
                              .OrderBy(q => q.QuestionNumber)
                              .ToListAsync()));
                }
                return(Ok(await _repo.Item().Where(q => q.TestId == id && q.IncludeThis)
                          .Include(q => q.Options)
                          .OrderBy(q => q.QuestionNumber)
                          .ToListAsync()));
            }
            Quiz model = await _repo.Item().Where(c => c.Id == id).FirstOrDefaultAsync();

            if (model != null)
            {
                return(Ok(model));
            }
            return(NotFound());
        }
예제 #28
0
        public static void InitializeStudyTypes(TrackerContext context)
        {
            if (context.StudyType.Any())
            {
                return;
            }

            var studyTypes = new StudyType[]
            {
                new StudyType {
                    StudyTypeName = "Original"
                },
                new StudyType {
                    StudyTypeName = "Update"
                },
            };

            foreach (StudyType s in studyTypes)
            {
                context.StudyType.Add(s);
            }

            context.SaveChanges();
        }
예제 #29
0
 public Study(StudyType type)
 {
     Type = type;
 }
예제 #30
0
        private void InstallApp()
        {
            StudyType Ochnaja = new StudyType
            {
                Name = "очная"
            };

            StudyType Zaochnaja = new StudyType
            {
                Name = "заочная"
            };

            StudyType unnamed3 = new StudyType
            {
                Name = "unnamed3"
            };

            StudyType unnamed4 = new StudyType
            {
                Name = "unnamed4"
            };

            Faculty IiVT = new Faculty
            {
                Name = "Информатика и вычислительная техника",
                Abbreviation = "ИиВТ",
            };

            FieldOfStudy Specialist = new FieldOfStudy
            {
                Name = "специалист"
            };

            FieldOfStudy Bakalavr = new FieldOfStudy
            {
                Name = "бакалавр"
            };

            FieldOfStudy Magistr = new FieldOfStudy
            {
                Name = "магистр"
            };

            LessonsType Lections = new LessonsType
            {
                Id = 1,
                Name = "лекция"
            };

            LessonsType Practics = new LessonsType
            {
                Id = 2,
                Name = "практика"
            };

            LessonsType Labs = new LessonsType
            {
                Id = 3,
                Name = "лабораторные"
            };

            LessonsSubType Comp = new LessonsSubType
            {
                Name = "компьютеры",
                LessonsTypeId = Labs.Id
            };

            LessonsSubType Stanki = new LessonsSubType
            {
                Name = "станки",
                LessonsTypeId = Labs.Id
            };

            Title prepod = new Title
            {
                Name = "преподаватель"
            };

            Faculty fac = new Faculty
            {
                Name = "факультет",
                Abbreviation = "фак"
            };

            Ring first = new Ring
            {
                Begin = "8:30",
                End = "9:50"
            };

            Ring second = new Ring
            {
                Begin = "10:00",
                End = "11:20"
            };

            Ring third = new Ring
            {
                Begin = "11:20",
                End = "12:50"
            };

            Ring fourth = new Ring
            {
                Begin = "13:30",
                End = "14:50"
            };

            Ring fifth = new Ring
            {
                Begin = "15:00",
                End = "16:20"
            };

            Ring sixth = new Ring
            {
                Begin = "16:30",
                End = "17:50"
            };

            Ring seventh = new Ring
            {
                Begin = "18:10",
                End = "19:30"
            };

            Auditorium a = new Auditorium
            {
                Building = 1,
                Number = "1-490",
                Seats = 50,
                OpeningDate = "",
                ClosingDate = "",
                DepartmentId = 1,
            };

            Degree d = new Degree
            {
                Name = "degree",
            };

            using (UniversitySheduleContainer cnt = new UniversitySheduleContainer("name=UniversitySheduleContainer"))
            {
                cnt.StudyTypes.AddObject(Ochnaja);
                cnt.StudyTypes.AddObject(Zaochnaja);
                cnt.StudyTypes.AddObject(unnamed3);
                cnt.StudyTypes.AddObject(unnamed4);
                cnt.Faculties.AddObject(IiVT);
                cnt.FieldsOfStudy.AddObject(Specialist);
                cnt.FieldsOfStudy.AddObject(Bakalavr);
                cnt.FieldsOfStudy.AddObject(Magistr);
                cnt.LessonsTypes.AddObject(Lections);
                cnt.LessonsTypes.AddObject(Practics);
                cnt.LessonsTypes.AddObject(Labs);
                cnt.LessonsSubTypes.AddObject(Comp);
                cnt.LessonsSubTypes.AddObject(Stanki);
                cnt.Titles.AddObject(prepod);
                cnt.Faculties.AddObject(fac);
                cnt.Rings.AddObject(first);
                cnt.Rings.AddObject(second);
                cnt.Rings.AddObject(third);
                cnt.Rings.AddObject(fourth);
                cnt.Rings.AddObject(fifth);
                cnt.Rings.AddObject(sixth);
                cnt.Rings.AddObject(seventh);
                cnt.Degrees.AddObject(d);
                //cnt.Auditoriums.AddObject(a);
                // И финальный аккорд - сохраняем все изменения в БД
                cnt.SaveChanges();
            }
        }
예제 #31
0
 public IEnumerable <StudyProgramme> GetByStudyType(StudyType type)
 {
     return(GetImpl(SELECT_BYTYPE, CreateParameter("@studyType", type == StudyType.Bachelor ? 0 : 1)));
 }
예제 #32
0
 public static string ToString(StudyType value)
 {
     if( value==StudyType.Interventional )
         return "interventional";
     else if( value==StudyType.Observational )
         return "observational";
     else if( value==StudyType.ExpandedAccess )
         return "expanded access";
     else
         throw new ArgumentException("Unrecognized StudyType value: " + value.ToString());
 }
예제 #33
0
            public static bool TryParse(string value, out StudyType result)
            {
                result = default(StudyType);

                if( value=="interventional")
                    result = StudyType.Interventional;
                else if( value=="observational")
                    result = StudyType.Observational;
                else if( value=="expanded access")
                    result = StudyType.ExpandedAccess;
                else
                    return false;

                return true;
            }