예제 #1
0
        private void RemoveRecord()
        {
            if (MessageBox.Show("Are sure to delete '" + CurrentSelectedItem.StandardName + "' and it's all students ? ", "Confirm", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
            {
                return;
            }
            SchoolObjContext context = new SchoolObjContext();

            TestApp.EntityDatabase.DomainClasses.Standard std = context.Standards.Where(s => s.StandardId == CurrentSelectedItem.StandardId).FirstOrDefault();
            if (std == null)
            {
                return;
            }
            context.Standards.Remove(std);
            context.SaveChanges();
            MainViewModel.RefreshView("Result Report");


            //MainViewModel.CloseTabs("Subjects");
            MainViewModel.RefreshView("Subjects");
            MainViewModel.RefreshView("Add Students");
            MainViewModel.RefreshView("Show Students");

            StandardList.Remove(CurrentSelectedItem);
        }
예제 #2
0
 public static void From(StandardListDto dto, StandardList domainObject)
 {
     domainObject.Id = dto.Id;
     domainObject.DefaultSentenceLanguage = dto.DefaultSentenceLanguage;
     domainObject.DefaultWordLanguage     = dto.DefaultWordLanguage;
     domainObject.StandardListName        = dto.StandardListName;
 }
예제 #3
0
        private void AddNewStandard()
        {
            SchoolObjContext context = new SchoolObjContext();

            if (NameToBeAdded != null && NameToBeAdded != " " && NameToBeAdded != "")
            {
                EntityDatabase.DomainClasses.Standard std = new EntityDatabase.DomainClasses.Standard()
                {
                    StandardName = NameToBeAdded
                };
                context.Standards.Add(std);
                context.SaveChanges();
                StandardList.Add(context.Standards.AsEnumerable().Last());
                var StdId = context.Standards.Where(s => s.StandardName == NameToBeAdded).FirstOrDefault().StandardId;

                NameToBeAdded = "";

                MainViewModel.RefreshView("Subjects");
                MainViewModel.RefreshView("Show Students");
                MainViewModel.RefreshView("Result Report");


                MainViewModel.Tabs.Add(new SubjectViewModel(StdId));
            }
        }
예제 #4
0
        public static LookupDto From(StandardList domainObject)
        {
            var dto = new LookupDto();

            dto.DisplayName = domainObject.StandardListName;
            dto.Id          = domainObject.Id;
            return(dto);
        }
        public async Task <ActionResult <SimpleUpsertDto> > AddStandardListAsync([FromBody] StandardListDto dto)
        {
            var domainObject = new StandardList();

            StandardListDto.From(dto, domainObject);
            domainObject = await _standardListRepository.AddAsync(domainObject, this.AppUserId.Value);

            return(SimpleUpsertDto.From(domainObject));
        }
예제 #6
0
        public static StandardListDto FromNoSound(StandardList domainObject)
        {
            var dto = new StandardListDto();

            dto.Id = domainObject.Id;
            dto.DefaultSentenceLanguage = domainObject.DefaultSentenceLanguage;
            dto.DefaultWordLanguage     = domainObject.DefaultWordLanguage;
            dto.StandardListName        = domainObject.StandardListName;
            dto.StandardListItems       = domainObject.StandardListItems.Select(StandardListItemDto.FromNoSound).OrderBy(o => o.Word).ToList();
            //todo add items
            return(dto);
        }
        public ConsolidateStandardDialogViewModel(IDataService <LabDbEntities> labDbData,
                                                  ISpecificationService specificationService)
        {
            _labDbData            = labDbData;
            _specificationService = specificationService;

            CancelCommand = new DelegateCommand <Window>(
                parentDialog =>
            {
                parentDialog.DialogResult = false;
            });

            ConfirmCommand = new DelegateCommand <Window>(
                parentDialog =>
            {
                _specificationService.ConsolidateStandard(StandardList.Where(giw => giw.IsSelected)
                                                          .Select(giw => giw.Item),
                                                          _standardInstance);
                parentDialog.DialogResult = true;
            },
                parentDialog => _standardInstance != null);
        }
예제 #8
0
 public List <String> GetPackingList()
 {
     return(StandardList.Split('_').ToList());
 }