Ejemplo n.º 1
0
 private ObservableCollection <ServiceStore> ReloadServiceStoreList()
 {
     if (SelectedServiceRequest.ServiceID == null && SelectedServiceRequest.ID != 0)
     {
         return(new ObservableCollection <ServiceStore>());
     }
     return(new ObservableCollection <ServiceStore>(ServiceStoreDal.FindAll(x => x.ProviderTeamID == SelectedProviderTeamID)));
 }
 private ObservableCollection <ServiceStore> ReloadServiceStoreList()
 {
     if (TeamFilter != null)
     {
         return(new ObservableCollection <ServiceStore>(ServiceStoreDal.FindAll(x => x.Team.SessionGroupID == SessionGroupID && x.ProviderTeamID == TeamFilter.ID && x.ServiceName.Contains(ServiceTeamFilter))));
     }
     return(new ObservableCollection <ServiceStore>(ServiceStoreDal.FindAll(x => x.Team.SessionGroupID == SessionGroupID && x.ServiceName.Contains(ServiceTeamFilter))));
 }
Ejemplo n.º 3
0
        public ServiceRequestViewModel(int sessionGroupID, ServiceRequest selectedServiceRequest, ServiceRequestWindow sourceWindow, Student contextStudent, string semiReadOnly)
        {
            _contextDal            = new ServiceRequestDAL();
            this.DictionaryDal     = new DictionaryDAL();
            this.TeamDal           = new TeamDAL();
            this.ServiceStoreDal   = new ServiceStoreDAL();
            this.StudentDal        = new StudentDAL();
            this.RequestMessageDal = new RequestMessageDAL();

            this.SemiReadOnly           = semiReadOnly == "ServiceRequestsGrid";
            this.SourceWindow           = sourceWindow;
            this.SelectedServiceRequest = selectedServiceRequest;

            this.SelectedProviderTeamID       = SelectedServiceRequest.ProviderTeamID;
            this.SelectedServiceStore         = ServiceStoreDal.FindAll(x => x.ID == SelectedServiceRequest.ServiceID).FirstOrDefault();
            this.SelectedServiceRequestTypeID = SelectedServiceRequest.RequestType;


            this.AssigneeList = ReloadAssigneeList();

            RequestMessageList        = ReloadRequestMessageList();
            this.CreateRequestMessage = new RelayCommand(RequestMessageCreate, CanCreateRequestMessage);
            this.ContextStudent       = contextStudent;
            this.SaveCommand          = new RelayCommand(SaveRequest, CanSave);
            if (DictionaryDal.DictionaryListByType(5).Where(x => x.ID == 24).FirstOrDefault().ID == SelectedServiceRequest.RequestState)
            {
                this.RequestStateList = new ObservableCollection <Dictionary>(DictionaryDal.DictionaryListByType(5).Where(x => x.ID == 24));
            }
            else
            {
                this.RequestStateList = new ObservableCollection <Dictionary>(DictionaryDal.DictionaryListByType(5).Where(x => x.ID != 24));
            }
            this.RequestTypeList = new ObservableCollection <Dictionary>(DictionaryDal.DictionaryListByType(4));
            int SessionGroupID;

            if (ContextStudent == null)
            {
                SessionGroupID = sessionGroupID;
            }
            else
            {
                SessionGroupID = TeamDal.FindById(ContextStudent.TeamID).SessionGroupID;
            }
            this.ProviderTeamList          = new ObservableCollection <Team>(TeamDal.FindAll(x => x.SessionGroupID == SessionGroupID));
            this.AvailableServiceStoreList = ReloadServiceStoreList();
        }