public CreateSystemWizardViewModel(IEventAggregator EventAggregator, IProjectInfoBAL projctInfoBll, IRegionManager _regionManager)
 {
     _eventAggregator = EventAggregator;
     _projectBAL      = projctInfoBll;
     _eventAggregator.GetEvent <PubSubEvent <Visibility> >().Subscribe(GetSetFloorTabVisibility);
     _eventAggregator.GetEvent <OduIduVisibility>().Subscribe(GetSetIduTabVisibility);
     //_eventAggregator.GetEvent<RefreshDashboard>().Subscribe(RefreshDashBoard);
     CancelClickCommand   = new DelegateCommand <Window>(this.CancelClick);
     CreateClickCommand   = new DelegateCommand <Window>(this.CreateClick);
     NextClickCommand     = new DelegateCommand(NextClick);
     PreviousClickCommand = new DelegateCommand(PreviousClick);
     this.FloorVisibility = Visibility.Collapsed;
     //ACC - RAG START
     _eventAggregator.GetEvent <TheuInfoVisibility>().Subscribe(GetSetTHEUITabVisibility);
     this.TheuInfoVisibility = Visibility.Collapsed;
     //ACC - RAG END
     _eventAggregator.GetEvent <TypeTabSubscriber>().Subscribe(SetTypeTabValidateValue);
     _eventAggregator.GetEvent <FloorTabSubscriber>().Subscribe(SetFloorTabValidateValue);
     _eventAggregator.GetEvent <OduTabSubscriber>().Subscribe(SetOduTabValidateValue);
     _eventAggregator.GetEvent <IduTabSubscriber>().Subscribe(SetIDUTabValidateValue);
     //ACC - RAG START
     _eventAggregator.GetEvent <NextButtonVisibility>().Subscribe(GetSetNextBtnVisibility);
     this.NextButtonVisibility = Visibility.Collapsed;
     CreateButtonEnable        = true;
     _eventAggregator.GetEvent <CreateButtonVisibility>().Subscribe(GetSetCreateBtnVisibility);
     _eventAggregator.GetEvent <CreateButtonEnability>().Subscribe(GetSetCreateBtnEnability);
     this.CreateButtonVisibility = Visibility.Collapsed;
     _eventAggregator.GetEvent <Cleanup>().Subscribe(OnCleanup);
     //ACC - RAG END
     RegionManager = _regionManager;
 }
 public CreateProjectWizardViewModel(IEventAggregator EventAggregator, IProjectInfoBAL projctInfoBll, IRegionManager _regionManager, IGlobalProperties globalProperties, IModalWindowService winService)
 {
     _eventAggregator  = EventAggregator;
     _projectBAL       = projctInfoBll;
     _globalProperties = globalProperties;
     _winService       = winService;
     _eventAggregator.GetEvent <PubSubEvent <Visibility> >().Subscribe(GetSetFloorTabVisibility);
     _eventAggregator.GetEvent <OduIduVisibility>().Subscribe(GetSetIduTabVisibility);
     _eventAggregator.GetEvent <TheuInfoVisibility>().Subscribe(GetSetTHEUITabVisibility);  //ACC - RAG
     //_eventAggregator.GetEvent<RefreshDashboard>().Subscribe(RefreshDashBoard);
     CancelClickCommand      = new DelegateCommand(this.CancelClick);
     CreateClickCommand      = new DelegateCommand(this.CreateClick);
     NextClickCommand        = new DelegateCommand(NextClick);
     PreviousClickCommand    = new DelegateCommand(PreviousClick);
     this.FloorVisibility    = Visibility.Collapsed;
     this.TheuInfoVisibility = Visibility.Collapsed;  //ACC - RAG
     _eventAggregator.GetEvent <ProjectInfoSubscriber>().Subscribe(SetProjectInfoValidateValue);
     _eventAggregator.GetEvent <DesignerTabSubscriber>().Subscribe(SetDesignTabValidateValue);
     _eventAggregator.GetEvent <TypeTabSubscriber>().Subscribe(SetTypeTabValidateValue);
     _eventAggregator.GetEvent <FloorTabSubscriber>().Subscribe(SetFloorTabValidateValue);
     _eventAggregator.GetEvent <NextButtonVisibility>().Subscribe(GetSetNextBtnVisibility); //ACC - RAG
     this.NextButtonVisibility = Visibility.Visible;                                        //ACC - RAG
     _eventAggregator.GetEvent <OduTabSubscriber>().Subscribe(SetOduTabValidateValue);
     _eventAggregator.GetEvent <IduTabSubscriber>().Subscribe(SetIDUTabValidateValue);
     _eventAggregator.GetEvent <CreateButtonVisibility>().Subscribe(GetSetCreateBtnVisibility); //ACC - RAG
     this.CreateButtonVisibility = Visibility.Collapsed;                                        //ACC - RAG
     CreateButtonEnable          = true;
     _eventAggregator.GetEvent <CreateButtonEnability>().Subscribe(GetSetCreateBtnEnability);
     _eventAggregator.GetEvent <Cleanup>().Subscribe(OnCleanup);
     RegionManager = _regionManager;
     Project.isSystemPropertyWiz = false;
 }
Beispiel #3
0
        public TypeInfoViewModel(IProjectInfoBAL projctInfoBll, IEventAggregator EventAggregator)
        {
            try
            {
                Initializations();
                _eventAggregator              = EventAggregator;
                this.ButtonVisibility         = "Hidden";
                SingleFloorCheckedCommand     = new DelegateCommand(SingleFloorCheckedEvent);
                SingleFloorUnCheckedCommand   = new DelegateCommand(SingleFloorUnCheckedEvent);
                MultipleFloorCheckedCommand   = new DelegateCommand(MultipleFloorCheckedEvent);
                MultipleFloorUnCheckedCommand = new DelegateCommand(MultipleFloorUnCheckedEvent);
                _eventAggregator.GetEvent <cntrlTexthiding>().Subscribe(GetTypeTabVisibility);

                _eventAggregator.GetEvent <BeforeCreate>().Subscribe(OnBeforeCreate);
                LoadFloor            = new DelegateCommand <int?>(OnMultiFloorLostFocus);
                RegularCheckedCommnd = new DelegateCommand(RegularCheckedEvent);
                _projectInfoBll      = projctInfoBll;
                _controllerDAL       = new CentralControllerDAL();
                //GetSystemTypeList();


                ShowCommand = new DelegateCommand(ShowMethod);
                HideCommand = new DelegateCommand(HideMethod);
                _eventAggregator.GetEvent <Cleanup>().Subscribe(OnCleanup);
            }
            catch (Exception ex)
            {
                int?id = CurrentProject?.projectID;
                Logger.LogProjectError(id, ex);
            }
        }
 public AddHEAccessoriesTemplateViewModel(IProjectInfoBAL projectBAL)
 {
     try
     {
         this._projectBAL = projectBAL;
         //this.Cancelcommand = new RelayCommand(this.Cancel);
         AddButtonEnable            = true;
         Cancelcommand              = new DelegateCommand <object>(OnCancelClicked);
         MaxTypeCount               = new DelegateCommand <object>(MaxTypeCountCheck);
         this.AddAccessoriesCommand = new RelayCommand(this.AddAccessoriesToHeatExchanger, CanAddExecute);
         this.RemoveFromAllCommand  = new RelayCommand(this.RemoveFromAllAccessories, CanRemoveAllExecute);
         Project.CurrentProject     = Project.GetProjectInstance;
         MainAppLoadedCommand       = new DelegateCommand(
             () =>
         {
             ListAccessory = GetAllAccessoriesCompatibleForHeatExchanger(objIndoor);
             UpdateSelectedAccessories();
             GetSelectedAccessories(ListAccessory);
             MaxTypeCountCheck(null);
         }
             );
     }
     catch (Exception ex)
     {
         int?id = Project.GetProjectInstance?.projectID;
         Logger.LogProjectError(id, ex);
     }
 }
        public EditReportContentsViewModel(IEventAggregator eventAggregator, IProjectInfoBAL projectInfoBll, IModalWindowService winService)
        {
            if (SystemSetting.UserSetting.unitsSetting.settingPOWER == "kW")
            {
                this.VisisbleIduCapacityW = Visibility.Visible;
            }
            else
            {
                this.VisisbleIduCapacityW = Visibility.Collapsed;
            }
            this._eventAggregator = eventAggregator;
            LeftSideBarItems      = new ObservableCollection <LeftSideBarItem>();
            _winService           = winService;
            uc_CheckBox_RptSelectAllModuleCheckedCommandEvent();
            uc_CheckBox_ActualCheckedCommandEvent();

            Apply_Click        = new DelegateCommand(this.OnApplyClicked);
            CancelClickCommand = new DelegateCommand(this.CancelClick);

            uc_CheckBox_RptSelectAllModuleCheckedCommand   = new DelegateCommand(uc_CheckBox_RptSelectAllModuleCheckedCommandEvent);
            uc_CheckBox_RptSelectAllModuleUnCheckedCommand = new DelegateCommand(uc_CheckBox_RptSelectAllModuleUnCheckedCommandEvent);
            uc_CheckBox_RptRoomInfoCheckedCommand          = new DelegateCommand(uc_CheckBox_RptRoomInfoCheckedCommandEvent);
            uc_CheckBox_RptRoomInfoUnCheckedCommand        = new DelegateCommand(uc_CheckBox_RptRoomInfoUnCheckedCommandEvent);
            uc_CheckBox_RptOutdoorDetailCheckedCommand     = new DelegateCommand(uc_CheckBox_RptOutdoorDetailCheckedCommandEvent);
            uc_CheckBox_RptWiringCheckedCommand            = new DelegateCommand(uc_CheckBox_RptWiringCheckedCommandEvent);
            uc_CheckBox_RptOutdoorDetailUnCheckedCommand   = new DelegateCommand(uc_CheckBox_RptOutdoorDetailUnCheckedCommandEvent);
            uc_CheckBox_RptWiringUnCheckedCommand          = new DelegateCommand(uc_CheckBox_RptWiringUnCheckedCommandEvent);
            uc_CheckBox_RptIndoorDetailCheckedCommand      = new DelegateCommand(uc_CheckBox_RptIndoorDetailCheckedCommandEvent);
            uc_CheckBox_RptIndoorDetailUnCheckedCommand    = new DelegateCommand(uc_CheckBox_RptIndoorDetailUnCheckedCommandEvent);
            uc_CheckBox_RptPipingCheckedCommand            = new DelegateCommand(uc_CheckBox_RptPipingCheckedCommandEvent);
            uc_CheckBox_RptPipingUnCheckedCommand          = new DelegateCommand(uc_uc_CheckBox_RptPipingUnCheckedCommandEvent);
            uc_CheckBox_RptControllerCheckedCommand        = new DelegateCommand(uc_CheckBox_RptControllerCheckedCommandEvent);
            uc_CheckBox_RptControllerUnCheckedCommand      = new DelegateCommand(uc_CheckBox_RptControllerUnCheckedCommandEvent);
            uc_CheckBox_RptExchangerCheckedCommand         = new DelegateCommand(uc_CheckBox_RptExchangerCheckedCommandEvent);
            uc_CheckBox_RptExchangerUnCheckedCommand       = new DelegateCommand(uc_CheckBox_RptExchangerUnCheckedCommandEvent);
            uc_CheckBox_ActualCheckedCommand         = new DelegateCommand(uc_CheckBox_ActualCheckedCommandEvent);
            uc_CheckBox_ActualUnCheckedCommand       = new DelegateCommand(uc_CheckBox_ActualUnCheckedCommandEvent);
            uc_CheckBox_NominalCheckedCommand        = new DelegateCommand(uc_CheckBox_NominalCheckedCommandEvent);
            uc_CheckBox_IduCapacityWCheckedCommand   = new DelegateCommand(uc_CheckBox_IduCapacityCheckedCommandEvent);
            uc_CheckBox_IduCapacityWUnCheckedCommand = new DelegateCommand(uc_CheckBox_IduCapacityUnCheckedCommandEvent);
            uc_CheckBox_NominalUnCheckedCommand      = new DelegateCommand(uc_CheckBox_NominalUnCheckedCommandEvent);
            var proj = JCHVRF.Model.Project.GetProjectInstance;

            if (proj.IsIduCapacityW != null)
            {
                IsIduCapacityW = proj.IsIduCapacityW;
            }

            //  _eventAggregator.GetEvent<SystemCreated>().Subscribe(NewSystemCreated);
            //   _eventAggregator.GetEvent<SystemSelectedTabSubscriber>().Subscribe(OnSelectedSystemTab);
        }
        private void DisplayProjectDetails(IProjectInfoBAL projectInfoBll)
        {
            var currentProject = JCHVRF.Model.Project.GetProjectInstance;
            //currentProject = projectInfoBll.GetProjectInfo(currentProject.projectID).ProjectLegacy; //CurrentProject object is already being filled in the line above. commenting this to fix bug#2234

            List <LeftSideBarChild> vrfSystems = new List <LeftSideBarChild>();

            foreach (JCHVRF.Model.NextGen.SystemVRF systemVRF in currentProject.SystemListNextGen)
            {
                vrfSystems.Add(new LeftSideBarChild(systemVRF.Name, "VRF", systemVRF.StatusIcon, systemVRF));
            }
            _vrfSystemsObservableCollection.AddRange(vrfSystems);

            List <LeftSideBarChild> centralControllers = new List <LeftSideBarChild>();

            foreach (JCHVRF.Model.ControlSystem controlSystem in currentProject.ControlSystemList)
            {
                centralControllers.Add(new LeftSideBarChild(controlSystem.Name, "VRF", controlSystem.StatusIcon, controlSystem));
            }

            _centralContollerObservableCollection.AddRange(centralControllers);

            List <LeftSideBarChild> HeatExchangerSystems = new List <LeftSideBarChild>();

            foreach (JCHVRF.Model.SystemHeatExchanger systemHeatExch in currentProject.HeatExchangerSystems)
            {
                HeatExchangerSystems.Add(new LeftSideBarChild(systemHeatExch.Name, "VRF", systemHeatExch.StatusIcon, systemHeatExch));
            }


            _heatExchangerObservableCollection.AddRange(HeatExchangerSystems);

            if (vrfSystems.Count > 0)
            {
                _selectedLeftSideBarChild = vrfSystems[0];
            }
            else if (centralControllers.Count > 0)
            {
                _selectedLeftSideBarChild = centralControllers[0];
            }
            else if (HeatExchangerSystems.Count > 0)
            {
                _selectedLeftSideBarChild = HeatExchangerSystems[0];
            }

            updateLeftSideBarItems();

            _selectedLeftSideBarChild.IsSelected = true;
            _eventAggregator.GetEvent <SystemSelectedItemSubscriber>().Publish((SystemBase)_selectedLeftSideBarChild.Source);
        }
        public ucDesignerCanvasViewModel(IProjectInfoBAL projctInfoBll, IEventAggregator eventAggregator, IRegionManager regionManager, IGlobalProperties globalProperties = null)
        {
            try
            {
                this.regionManager        = regionManager;
                _eventAggregator          = eventAggregator;
                this.globalProperties     = globalProperties;
                utTemperature             = SystemSetting.UserSetting.unitsSetting.settingTEMPERATURE;
                CanvasItemSelectedCommand = new DelegateCommand <Item>(OnSelectedItemChanged);

                //validateController = new ControllerValidation(_group, Project.CurrentProject, _currentSystem);
            }
            catch (Exception ex)
            {
                int?id = Project.GetProjectInstance?.projectID;
                Logger.LogProjectError(id, ex);
            }
        }
 public SystemPropertyWizardViewModel(IEventAggregator EventAggregator, IProjectInfoBAL projctInfoBll, IRegionManager _regionManager)
 {
     try
     {
         _eventAggregator = EventAggregator;
         _projectBAL      = projctInfoBll;
         _eventAggregator.GetEvent <PubSubEvent <Visibility> >().Subscribe(GetSetFloorTabVisibility);
         _eventAggregator.GetEvent <OduIduVisibility>().Subscribe(GetSetIduTabVisibility);
         //_eventAggregator.GetEvent<RefreshDashboard>().Subscribe(RefreshDashBoard);
         CancelClickCommand   = new DelegateCommand <Window>(this.CancelClick);
         SaveClickCommand     = new DelegateCommand <Window>(this.SaveClick);
         NextClickCommand     = new DelegateCommand(NextClick);
         PreviousClickCommand = new DelegateCommand(PreviousClick);
         this.FloorVisibility = Visibility.Collapsed;
         //ACC - RAG START
         _eventAggregator.GetEvent <TheuInfoVisibility>().Subscribe(GetSetTHEUITabVisibility);
         this.TheuInfoVisibility = Visibility.Collapsed;
         //ACC - RAG END
         _eventAggregator.GetEvent <TypeTabSubscriber>().Subscribe(SetTypeTabValidateValue);
         _eventAggregator.GetEvent <FloorTabSubscriber>().Subscribe(SetFloorTabValidateValue);
         _eventAggregator.GetEvent <OduTabSubscriber>().Subscribe(SetOduTabValidateValue);
         _eventAggregator.GetEvent <IduTabSubscriber>().Subscribe(SetIDUTabValidateValue);
         //ACC - RAG START
         _eventAggregator.GetEvent <NextButtonVisibility>().Subscribe(GetSetNextBtnVisibility);
         this.NextButtonVisibility = Visibility.Collapsed;
         _eventAggregator.GetEvent <SaveButton_Visibility>().Subscribe(GetSetSaveBtnVisibility);//Acc IA
         SaveButtonEnable = true;
         _eventAggregator.GetEvent <SaveButtonEnability>().Subscribe(GetSetSaveBtnEnability);
         this.SaveButtonVisibility = Visibility.Collapsed;
         _eventAggregator.GetEvent <CleanupSystemWizard>().Subscribe(OnCleanup);
         //ACC - RAG END
         RegionManager = _regionManager;
     }
     catch (Exception ex)
     {
         int?id = Project.GetProjectInstance?.projectID;
         Logger.LogProjectError(id, ex);
     }
 }
Beispiel #9
0
        public PropertyInfoViewModel(IProjectInfoBAL projctInfoBll, IEventAggregator EventAggregator)
        {
            Initializations();
            _eventAggregator              = EventAggregator;
            this.ButtonVisibility         = "Hidden";
            SingleFloorCheckedCommand     = new DelegateCommand(SingleFloorCheckedEvent);
            SingleFloorUnCheckedCommand   = new DelegateCommand(SingleFloorUnCheckedEvent);
            MultipleFloorCheckedCommand   = new DelegateCommand(MultipleFloorCheckedEvent);
            MultipleFloorUnCheckedCommand = new DelegateCommand(MultipleFloorUnCheckedEvent);
            _eventAggregator.GetEvent <cntrlTexthiding>().Subscribe(GetTypeTabVisibility);
            _eventAggregator.GetEvent <BeforeSave>().Subscribe(OnBeforeSave);
            _eventAggregator.GetEvent <BeforeSaveVRF>().Subscribe(OnBeforeSaveVRF);

            LoadFloor            = new DelegateCommand <int?>(OnMultiFloorLostFocus);
            RegularCheckedCommnd = new DelegateCommand(RegularCheckedEvent);
            _eventAggregator.GetEvent <TypeInfoTabNext>().Subscribe(TypeTabNextClick);
            _projectInfoBll  = projctInfoBll;
            ShowCommand      = new DelegateCommand(ShowMethod);
            HideCommand      = new DelegateCommand(HideMethod);
            SaveClickCommand = new DelegateCommand(OnSaveClick);
            _eventAggregator.GetEvent <CleanupSystemWizard>().Subscribe(OnCleanup);
            loadFloorTabVisibility();
        }
        public ProjectDetailsViewModel(IEventAggregator eventAggregator, IProjectInfoBAL projectInfoBll)
        {
            Title = Langauge.Current.GetMessage("PROJECT_DETAILS");
            this._eventAggregator = eventAggregator;

            SelectedTreeViewItemCommand = new DelegateCommand <object>(SelectedTreeViewItemClick);
            ReorderUpClickCommand       = new DelegateCommand <object>(OnReorderUpClick);
            ReorderDownClickCommand     = new DelegateCommand <object>(OnReorderDownClick);
            //DisplayProjectDetails(projectInfoBll);
            firstInstance         = true;
            fromLoad              = true;
            LoadedUnloadedCommand = new DelegateCommand <string>(OnLoadedChanged);
            //RefreshSystemsList();
            LostFocusCommand   = new DelegateCommand(OnSearchLostFocus);
            GotFocusCommand    = new DelegateCommand(OnSearchGotFocus);
            TextChangedCommand = new DelegateCommand(OnSearchTextChanged);
            //SearchText = "Search";
            if (!flgEventSubs)
            {
                _eventAggregator.GetEvent <SystemSelectedTabSubscriber>().Subscribe(OnSelectedSystemTab);
                _eventAggregator.GetEvent <RefreshSystems>().Subscribe(RefreshSystemsList);
                flgEventSubs = true;
            }
        }
Beispiel #11
0
 private void OnNewCreatorClickedCommand()
 {
     try
     {
         if (ValidateViewModel() == true)
         {
             var bll            = new ProjectInfoBLL();
             var CreatorDetails = bll.GetCreatorDetails(creatorVal);
             if (CreatorDetails != null)
             {
                 Creator objCreator = new Creator();
                 _projectInfoBll          = new ProjectInfoBLL();
                 objCreator.CompanyName   = CompanyName;
                 objCreator.StreetAddress = StreetAddress;
                 objCreator.Suburb        = Suburb;
                 objCreator.TownCity      = TownCity;
                 objCreator.Country       = Country;
                 objCreator.GpsPosition   = GpsPosition;
                 objCreator.ContactName   = ContactName;
                 objCreator.Phone         = Phone;
                 objCreator.ContactEmail  = ContactEmail;
                 objCreator.IdNumber      = IdNumber;
                 objCreator.Id            = creatorVal;
                 var result = _projectInfoBll.UpdateCreatorInfo(objCreator);
                 if (result == 1)
                 {
                     _eventAggregator.GetEvent <AddCreatorPayLoad>().Publish();
                     JCHMessageBox.Show(Langauge.Current.GetMessage("UPDATE_SUCCESSFULLY"));//"Update Successfully"
                     ResetValue();
                     //objCreatorWindow.RequestClose();
                 }
             }
             else
             {
                 Creator objCreator = new Creator();
                 _projectInfoBll          = new ProjectInfoBLL();
                 objCreator.CompanyName   = CompanyName;
                 objCreator.StreetAddress = StreetAddress;
                 objCreator.Suburb        = Suburb;
                 objCreator.TownCity      = TownCity;
                 objCreator.Country       = Country;
                 objCreator.GpsPosition   = GpsPosition;
                 objCreator.ContactName   = ContactName;
                 objCreator.Phone         = Phone;
                 objCreator.ContactEmail  = ContactEmail;
                 objCreator.IdNumber      = IdNumber;
                 var result = _projectInfoBll.InsertCreatorInfo(objCreator);
                 if (result == 1)
                 {
                     _eventAggregator.GetEvent <AddCreatorPayLoad>().Publish();
                     JCHMessageBox.Show(Langauge.Current.GetMessage("SAVE_SUCCESSFULLY"));// "Save Successfully");
                     ResetValue();
                     // objCreatorWindow.RequestClose();
                     _winService.Close(ViewKeys.NewCreatorInformation);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Logger.LogProjectError(null, ex);
     }
 }
Beispiel #12
0
        public ProjectInfoViewModel(IProjectInfoBAL projctInfoBll, IEventAggregator eventAggregator, IModalWindowService winService)
        {
            Initialization();
            _eventAggregator        = eventAggregator;
            _winService             = winService;
            CoolingCheckedCommand   = new DelegateCommand(CoolingCheckedEvent);
            CoolingUnCheckedCommand = new DelegateCommand(CoolingUncheckedEvent);
            HeatingCheckedCommand   = new DelegateCommand(HeatingCheckedEvent);
            HeatingUnCheckedCommand = new DelegateCommand(HeatingUncheckedEvent);
            BothCheckedCommand      = new DelegateCommand(BothCheckedEvent);
            BothUnCheckedCommand    = new DelegateCommand(BothUncheckedEvent);
            HitachiCheckedCommand   = new DelegateCommand(HitachiCheckedEvent);
            HitachiUnCheckedCommand = new DelegateCommand(HitachiUncheckedEvent);
            YorkCheckedCommand      = new DelegateCommand(YorkCheckedEvent);
            YorkUnCheckedCommand    = new DelegateCommand(YorkUncheckedEvent);
            SelectedDateChanged     = new DelegateCommand(DeliveryDateChangedEvent);
            ProjectInitialisation();
            _projectInfoBll         = projctInfoBll;
            LookupProjectName       = GetDefaultProjectName();
            this.PropertyChanged   += ProjectInfoViewModel_PropertyChanged;
            NewClientClickedCommand = new DelegateCommand(OnNewClientClicked);

            NewCreatorClickedCommand = new DelegateCommand(OnNewCreatorClicked);

            ShowTextVisibility();
            ClientNameDBCommand = new DelegateCommand(OnClientNameKeyUpCommand);

            GetClientList();
            GetCreatorList();
            _eventAggregator.GetEvent <ProjectTypeInfoTabNext>().Subscribe(ProjectTypeNextClick);


            _eventAggregator.GetEvent <AddCreatorPayLoad>().Subscribe(RebindCreatorList);

            ProjectInfoWindowLoaded = new DelegateCommand(() =>
            {
                _isOpenedFromProjectSettings            = true;
                IsCheckSettingsVal                      = true;
                IsBrandSelectionEnabled                 = false;
                Application.Current.Properties["Value"] = IsCheckSettingsVal;
                checkDesignConditionVal                 = "true";
                var proj          = JCHVRF.Model.Project.GetProjectInstance;
                LookupProjectName = proj.Name;
                IsCoolingChecked  = proj.IsCoolingModeEffective;
                IsHeatingChecked  = proj.IsHeatingModeEffective;
                IsBothChecked     = proj.IsBothMode;

                Notes = proj.Remarks;
                this.TxtClientName  = proj.clientName;
                this.TxtCreatorName = proj.CreatorName;
                this.DeliveryDate   = proj.DeliveryRequiredDate;
                IsHitachiRdbVisible = proj.BrandCode;
                TxtVisibility       = Visibility.Collapsed;

                if (proj.BrandCode == "H")
                {
                    IsHitachi = true;
                }
                else
                {
                    IsYork = true;
                }
            }
                                                          );
            _eventAggregator.GetEvent <ProjectSettingsSave>().Subscribe(SetProjectMode);
        }
Beispiel #13
0
 private void OnNewClientClickedCommand()
 {
     try
     {
         if (ValidateViewModel() == true && ValidateEmailId() == true)
         {
             var bll           = new ProjectInfoBLL();
             var ClientDetails = bll.GetClientDetails(clientVal);
             if (ClientDetails != null)
             {
                 Client objClient = new Client();
                 _projectInfoBll         = new ProjectInfoBLL();
                 objClient.CompanyName   = TxtCompanyName;
                 objClient.ContactName   = TxtContactName;
                 objClient.StreetAddress = TxtStreetAddress;
                 objClient.Suburb        = TxtSuburb;
                 objClient.TownCity      = TxtTownCity;
                 objClient.Country       = TxtCountry;
                 objClient.GpsPosition   = TxtGpsPosition;
                 objClient.Phone         = TxtPhone;
                 objClient.ContactEmail  = TxtContactEmail;
                 objClient.IdNumber      = TxtIdNumber;
                 objClient.Id            = clientVal;
                 var result = _projectInfoBll.UpdateClientInfo(objClient);
                 if (result == 1)
                 {
                     _eventAggregator.GetEvent <AddCreatorPayLoad>().Publish();
                     JCHMessageBox.Show(Langauge.Current.GetMessage("UPDATE_SUCCESSFULLY"));//Update Successfully
                     Application.Current.Properties["TxtContactName"] = objClient.ContactName;
                     ResetValue();
                     _winService.Close(ViewKeys.Addnewclient);
                     //objClientWindow.RequestClose();
                 }
             }
             else
             {
                 Client objClient = new Client();
                 _projectInfoBll         = new ProjectInfoBLL();
                 objClient.CompanyName   = TxtCompanyName;
                 objClient.ContactName   = TxtContactName;
                 objClient.StreetAddress = TxtStreetAddress;
                 objClient.Suburb        = TxtSuburb;
                 objClient.TownCity      = TxtTownCity;
                 objClient.Country       = TxtCountry;
                 objClient.GpsPosition   = TxtGpsPosition;
                 objClient.Phone         = TxtPhone;
                 objClient.ContactEmail  = TxtContactEmail;
                 objClient.IdNumber      = TxtIdNumber;
                 var result = _projectInfoBll.InsertClientInfo(objClient);
                 if (result == 1)
                 {
                     _eventAggregator.GetEvent <AddCreatorPayLoad>().Publish();
                     JCHMessageBox.Show(Langauge.Current.GetMessage("SAVE_SUCCESSFULLY"));//Save Successfully
                     Application.Current.Properties["TxtContactName"] = objClient.ContactName;
                     ResetValue();
                     _winService.Close(ViewKeys.Addnewclient);
                     // objClientWindow.RequestClose();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Logger.LogProjectError(null, ex);
     }
 }
        public PipingLengthSettingsViewModel(JCHVRF.Model.Project Project, IEventAggregator eventAggregator, IProjectInfoBAL projectInfoBll)
        {
            this.Project = JCHVRF.Model.Project.GetProjectInstance;
            thisProject  = JCHVRF.Model.Project.GetProjectInstance;
            var ProjcurrentSystem = JCHVRF.Model.Project.GetProjectInstance.SystemListNextGen;
            var Lists             = ProjcurrentSystem.FirstOrDefault(); //.Where(idu => idu.Id == Syste.Id)

            PipeLengthGridSelectionChanged = new DelegateCommand <IList <Object> >(OnSelectionChanged);
            CurrentSystems = Lists;
            LengthUnit     = SystemSetting.UserSetting.unitsSetting.settingLENGTH;
            //NextGenModel.SystemVRF curSystemItem = (NextGenModel.SystemVRF)CurrentSystems;
            if (WorkFlowContext.CurrentSystem != null)
            {
                if (WorkFlowContext.CurrentSystem is NextGenModel.SystemVRF)
                {
                    NextGenModel.SystemVRF curSystemItem = (NextGenModel.SystemVRF)WorkFlowContext.CurrentSystem;
                    this._eventAggregator = eventAggregator;
                    _eventAggregator      = eventAggregator;
                    ListIDU = new ObservableCollection <IDUList>();
                    //SelectedRow = new ObservableCollection<IDUList>();
                    ut_length = SystemSetting.UserSetting.unitsSetting.settingLENGTH;
                    NextGenBLL.PipingBLL pipBll = new NextGenBLL.PipingBLL(this.Project);

                    if (curSystemItem != null)
                    {
                        sysItemSource = curSystemItem;
                        initPipLength();
                        //CreateDataGridViewColumns();
                        //BindPositionType();
                        BindHighDifference();
                    }
                    PopupSettings       = Visibility.Hidden;
                    IsPipingPopupOpened = false;
                    Settings            = new DelegateCommand(OnSettingsClicked);
                    SettingsOk          = new DelegateCommand(OnSettingsOk);
                    SettingsCancel      = new DelegateCommand(OnSettingsCancel);
                }
            }
            Eq_lengthError = "[0-" + Unit.ConvertToControl(sysItemSource.MaxEqPipeLength, UnitType.LENGTH_M, ut_length).ToString("n1") + "]";
            HD_lengthError = "[0-" + Unit.ConvertToControl(sysItemSource.MaxDiffIndoorLength, UnitType.LENGTH_M, ut_length).ToString("n1") + "]";
        }