public ServiceStoreServiceParamEditViewModel(ServiceStoreServiceParamEditWindow window, ServiceStore selectedServiceStore, ServiceStoreServiceParams selectedParam)
 {
     this._contextDal          = new ServiceStoreServiceParamsDAL();
     this.SourceWindow         = window;
     this.SelectedServiceStore = selectedServiceStore;
     this.TeamDal          = new TeamDAL();
     this.ServiceStoreDal  = new ServiceStoreDAL();
     this.TeamFilter       = TeamDal.FindById(SelectedServiceStore.ProviderTeamID);
     this.SelectedParam    = selectedParam;
     this.SessionGroupID   = TeamDal.FindById(SelectedServiceStore.ProviderTeamID).SessionGroupID;
     this.TeamList         = new ObservableCollection <Team>(TeamDal.FindAll(x => x.SessionGroupID == SessionGroupID));
     this.ServiceStoreList = ReloadServiceStoreList();
     this.SaveCommand      = new RelayCommand(SaveParameter);
 }
        public ServiceStoreViewModel(Window sourceWindow, Student contextStudent, Teacher ContextTeacher)
        {
            this.ContextStudent = contextStudent;
            this.SourceWindow   = sourceWindow;

            this._contextDal          = new ServiceStoreDAL();
            this.ServiceRequestDal    = new ServiceRequestDAL();
            this.ServiceTableDal      = new ServiceTableDAL();
            this.ServiceTableFieldDal = new ServiceTableFieldDAL();
            this.TeamDal = new TeamDAL();
            this.ServiceStoreParamsDal = new ServiceStoreParamsDAL();
            this.DictionaryDal         = new DictionaryDAL();
            this.ContextTeacher        = ContextTeacher;

            this.ServiceStoreCreate = new RelayCommand(CreateServiceStore);
            this.ServiceStoreEdit   = new RelayCommand(EditServiceStore, CanEditOrDeleteSelectedItem);
            this.ServiceStoreDelete = new RelayCommand(DeleteServiceStore, CanEditOrDeleteSelectedItem);

            this.ServiceTableCreate = new RelayCommand(CreateServiceTable);
            this.ServiceTableEdit   = new RelayCommand(EditServiceTable, CanEditOrDeleteSelectedItem);
            this.ServiceTableDelete = new RelayCommand(DeleteServiceTable, CanEditOrDeleteSelectedItem);


            this.ServiceTableFieldCreate = new RelayCommand(CreateServiceTableField, CanCreateServiceTableField);
            this.ServiceTableFieldEdit   = new RelayCommand(EditServiceTableField, CanEditOrDeleteSelectedItem);
            this.ServiceTableFieldDelete = new RelayCommand(DeleteServiceTableField, CanEditOrDeleteSelectedItem);

            this.ServiceRequestCreate = new RelayCommand(CreateServiceRequest);
            this.ServiceRequestEdit   = new RelayCommand(EditServiceRequest, CanEditOrDeleteSelectedItem);
            this.ServiceRequestDelete = new RelayCommand(DeleteServiceRequest, CanDeleteServiceRequest);
            this.ApproveRequest       = new RelayCommand(RequestApprove, CanApproveRequest);

            this.LogoutCommand          = new RelayCommand(Logout);
            this.DeleteFilter           = new RelayCommand(DeleteSelectedFilter);
            this.DeleteCompleteFilters  = new RelayCommand(CompleteFiltersDelete);
            this.DeleteRequestedFilters = new RelayCommand(RequestFiltersDelete);
            this.GenerateSummary        = new RelayCommand(SummaryGeneration);
            this.ContextSessionGroupID  = TeamDal.FindById(ContextStudent.TeamID).SessionGroupID;

            this.TeamList              = new ObservableCollection <Team>(TeamDal.FindAll(x => x.SessionGroupID == ContextSessionGroupID));
            this.ServiceTableList      = ReloadServiceTableList();
            this.ServiceTableFieldList = ReloadServiceTableFieldList();
            this.ServiceStoreList      = ReloadServiceStoreList();
            this.ServiceRequestList    = ReloadServiceRequestList();
            this.RequestedRequestsList = ReloadRequestedRequests();
            this.ProvidedRequestsList  = ReloadProvidedRequestsList();
            this.AllServices           = ReloadAllServices();
            this.FillFilters(false);
        }
        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();
        }
        public ServiceStoreParamAddViewModel(ServiceStoreParamAddWindow sourceWindow, ServiceStore selectedServiceStore, ServiceStoreParams serviceStoreParam)
        {
            this.SourceWindow         = sourceWindow;
            this.SelectedServiceStore = selectedServiceStore;
            this._contextDal          = new ServiceStoreParamsDAL();
            this.TeamDal               = new TeamDAL();
            this.ServiceTableDal       = new ServiceTableDAL();
            this.ServiceTableFieldDal  = new ServiceTableFieldDAL();
            this.ServiceStoreParamsDal = new ServiceStoreParamsDAL();
            this.ServiceStoreDal       = new ServiceStoreDAL();
            this.DictionaryDal         = new DictionaryDAL();

            this.SessionGroupID                    = TeamDal.FindById(selectedServiceStore.ProviderTeamID).SessionGroupID;
            this.TeamFilter                        = TeamDal.FindById(SelectedServiceStore.ProviderTeamID);
            this.SessionGroupTeamList              = new ObservableCollection <Team>(TeamDal.FindAll(x => x.SessionGroupID == SessionGroupID));
            this.TableList                         = ReloadServiceTableList();
            this.TableFieldList                    = ReloadServiceTableFieldList();
            this.SelectedServiceStoreParam         = serviceStoreParam;
            SelectedServiceStoreParam.ServiceStore = SelectedServiceStore;
            CustomFieldTypeList                    = new ObservableCollection <Dictionary>(DictionaryDal.DictionaryListByType(3));
            this.SaveCommand                       = new RelayCommand(SaveParameter, CanSaveParameter);
        }