Esempio n. 1
0
        public FloorTabViewModel(IEventAggregator eventAggregator, IModalWindowService winService)
        {
            _eventAggregator       = eventAggregator;
            _winService            = winService;
            ListFloor              = new ObservableCollection <Floor>();
            CurrentProject         = JCHVRF.Model.Project.GetProjectInstance;
            BulkRemoveFloorCommand = new DelegateCommand(BulkRemoveFloor);
            AddFloorCommand        = new DelegateCommand(AddFloorIconClick);
            AddEditFloorCommand    = new DelegateCommand(AddEditFloorClick);
            RemoveFloorCommand     = new DelegateCommand(RemoveFloorIconClick);
            CheckUpdateCommand     = new DelegateCommand(() => {
                RaisePropertyChanged(nameof(AreAllFloorChecked));
            });
            _eventAggregator.GetEvent <PubSubEvent <int?> >().Subscribe(OnMultiFloorValueTypeTab);
            _eventAggregator.GetEvent <PubSubEvent>().Subscribe(OnAddFloorEdit);
            _eventAggregator.GetEvent <PubSubEvent <string> >().Subscribe(OnMultiFloorValueBulkUpload);


            _eventAggregator.GetEvent <FloorListAddSubscriber>().Subscribe(AddFloor);
            BulkAddCommand = new DelegateCommand(BulkAddClick);
            ProjectInitialisation();
            _eventAggregator.GetEvent <FloorTabNext>().Subscribe(FloorNextClick);
            AddDefoultFloorlist();
            SaveClickCommand = new DelegateCommand(OnSaveClicked);
            NavigationParameters param = _winService.GetParameters(ViewKeys.FloorTab);

            if (param != null)
            {
                EnableFLoorSavebutton((bool)param["EnableSaveButtons"]);
            }
        }
Esempio n. 2
0
        public bool CreateProject(JCHVRF.Model.Project project)
        {
            bool isCreated = false;

            try
            {
                _projectInfoDAL.CreateProject(project);
                isCreated = true;
            }
            catch (Exception ex)
            {
                string exception = "Unhandled exception has occurred in your application. If you click Ok, the application will ignore this error" +
                                   " and attempt to continue. If you click Cancel, the application will close immediately." + "\n" + ex.Message;
                var result = MessageBox.Show(exception, "Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
                if (result == DialogResult.Cancel)
                {
                    return(false);
                }
                else
                {
                    isCreated = true;
                }
            }
            return(isCreated);
        }
Esempio n. 3
0
 void ProjectInitialisation()
 {
     CurrentProject = JCHVRF.Model.Project.GetProjectInstance;
     if (CurrentProject.DeliveryRequiredDate != null)
     {
         DeliveryDate = CurrentProject.DeliveryRequiredDate;
     }
     IsHitachiImgVisible = "Collapsed";
     IsHitachiRdbVisible = "Collapsed";
     IsYorkImgVisible    = "Collapsed";
     IsYorkRdbVisible    = "Collapsed";
     BindBrandCode();
 }
Esempio n. 4
0
        public bool UpdateProject(JCHVRF.Model.Project project)
        {
            bool isUpdated = false;

            try
            {
                isUpdated = _projectInfoDAL.updateProject(project);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(isUpdated);
        }
Esempio n. 5
0
        public override void OnNavigatedTo(NavigationContext navigationContext)
        {
            base.OnNavigatedTo(navigationContext);
            if (navigationContext.Parameters.ContainsKey("Project"))
            {
                Project = navigationContext.Parameters["Project"] as JCHVRF.Model.Project;

                //Thread.Sleep(5000);

                NavigationParameters param = new NavigationParameters();
                param.Add("Project", Project);

                regionManager.RequestNavigate(RegionNames.ContentRegion, ViewKeys.MasterDesigner, param);
            }
        }
Esempio n. 6
0
        public static bool IsValidatedSystemVRF(JCHVRF.Model.Project project, JCHVRF.Model.NextGen.SystemVRF CurrentSystem, out string ErrMsg)
        {
            bool Result = true;

            ErrMsg = "";
            var IndoorListForCurrentSystem = project.RoomIndoorList.Where(ri => ri.SystemID == (((JCHVRF.Model.SystemBase)CurrentSystem).Id)).ToList();

            if (IndoorListForCurrentSystem == null || IndoorListForCurrentSystem.Count == 0)
            {
                Result = false;
                ErrMsg = Langauge.Current.GetMessage("ALERT_INDOOR");
            }
            else if (CurrentSystem == null)
            {
                Result = false;
                ErrMsg = string.Format(JCHVRF.Const.ValidationMessage.AtleastOneODU);
            }
            else
            {
                if (CurrentSystem.SelOutdoorType == null)
                {
                    Result = false;
                    ErrMsg = string.Format(Langauge.Current.GetMessage("ERROR_PROPERTY") + CurrentSystem.Name);
                }
                else if (CurrentSystem.Power == null || CurrentSystem.Power.Trim() == "")
                {
                    Result = false;
                    ErrMsg = string.Format(Langauge.Current.GetMessage("ERROR_POWER_PROPERTY") + CurrentSystem.Name);
                }
                else if (CurrentSystem.MaxRatio == 0)
                {
                    Result = false;
                    ErrMsg = string.Format(Langauge.Current.GetMessage("ERROR_MAXRATIO_PROPERTY") + CurrentSystem.Name);
                }
            }
            foreach (var indoor in IndoorListForCurrentSystem)
            {
                if (indoor.IndoorItem == null || indoor.IndoorItem.Type == null || indoor.IndoorItem.ModelFull == null)
                {
                    Result = false;
                    ErrMsg = string.Format(Langauge.Current.GetMessage("ERROR_INDOOR_PROPERTY") + indoor.IndoorName);
                    break;
                }
            }

            return(Result);
        }
Esempio n. 7
0
 void ProjectInitialisation()
 {
     CurrentProject = JCHVRF.Model.Project.GetProjectInstance;
     IsSaveEnable   = "Hidden";
     IsCancelEnable = "Hidden";
 }