Exemple #1
0
        private bool ReselectOutdoor(JCHVRF.Model.NextGen.SystemVRF CurrentSystem, int IsNodeUpdateRequired = 1)
        {
            string ErrMsg = string.Empty;

            this.projectLegacy = JCHVRF.Model.Project.GetProjectInstance;
            bool IsValidDraw = Utility.Validation.IsValidatedSystemVRF(this.projectLegacy, CurrentSystem, out ErrMsg);

            try
            {
                //bug fix 3422
                SetCompositeMode(CurrentSystem, JCHVRF.Model.Project.GetProjectInstance.RoomIndoorList);
                //bug fix 3422
                NextGenModel.SystemVRF CurrVRF   = new NextGenModel.SystemVRF();
                AutoSelectOutdoor      SelectODU = new AutoSelectOutdoor();
                if (IsValidDraw)
                {
                    AutoSelectODUModel result = SelectODU.ReselectOutdoor(CurrentSystem, JCHVRF.Model.Project.GetProjectInstance.RoomIndoorList);
                    if (result.SelectionResult == SelectOutdoorResult.OK)
                    {
                        if (IsNodeUpdateRequired == 1)
                        {
                            UpdatePipingNodeStructure(CurrentSystem);
                            UpdateWiringNodeStructure(CurrentSystem);
                        }
                        IsValidDraw = true;
                    }
                    else
                    {
                        IsValidDraw = false;
                        if (result.ERRList != null && result.ERRList.Count > 0)
                        {
                            _eventAggregator.GetEvent <ErrorLogVM>().Publish(result.ERRList);
                            // JCHMessageBox.Show("No suitable outdoor unit available\n", MessageType.Error);
                            JCHMessageBox.Show(GetErrorMassage(result.ERRList), MessageType.Error);
                        }
                        else if (result.MSGList != null && result.MSGList.Count > 0)
                        {
                            _eventAggregator.GetEvent <ErrorLogVM>().Publish(result.MSGList);
                            JCHMessageBox.Show(Langauge.Current.GetMessage("CAPCITYREQIREMENT"), MessageType.Error);
                        }
                        else
                        {
                            JCHMessageBox.Show(Langauge.Current.GetMessage("CAPCITYREQIREMENT"), MessageType.Error);
                        }
                    }
                }
                else
                {
                    IsValidDraw = false;
                    JCHMessageBox.Show(string.Format(ErrMsg));
                    ErrorLog.LogError(Model.ErrorType.Error, Model.ErrorCategory.PipingErrors, ErrMsg);
                }
            }
            catch (Exception ex)
            {
            }
            return(IsValidDraw);
        }
        private bool ReselectOutdoor(JCHVRF.Model.NextGen.SystemVRF CurrentSystem)
        {
            string ErrMsg      = string.Empty;
            var    proj        = JCHVRF.Model.Project.GetProjectInstance;
            bool   IsValidDraw = Utility.Validation.IsValidatedSystemVRF(proj, CurrentSystem, out ErrMsg);

            try
            {
                NextGenModel.SystemVRF CurrVRF   = new NextGenModel.SystemVRF();
                AutoSelectOutdoor      SelectODU = new AutoSelectOutdoor();
                if (IsValidDraw)
                {
                    IsValidDraw = Validation.IsIndoorIsValidForODUSeries(CurrentSystem);
                    if (IsValidDraw)
                    {
                        AutoSelectODUModel result = SelectODU.ReselectOutdoor(CurrentSystem, JCHVRF.Model.Project.GetProjectInstance.RoomIndoorList);
                        if (result.SelectionResult == SelectOutdoorResult.OK)
                        {
                            UpdatePipingNodeStructure(CurrentSystem);
                            UpdateWiringNodeStructure(CurrentSystem);
                            IsValidDraw = true;
                        }
                        else
                        {
                            IsValidDraw = false;
                            if (result.ERRList != null && result.ERRList.Count > 0)
                            {
                                _eventAggregator.GetEvent <ErrorLogVM>().Publish(result.ERRList);
                                // JCHMessageBox.Show("The capacity requirements are mismatching.\nPlease add/remove IDUs to make it compatible.\n", MessageType.Error);
                                //----------------- Code below for multi-langauge------------//
                                JCHMessageBox.Show(Language.Current.GetMessage("CAPCITYREQIREMENT"), MessageType.Error);
                            }
                            else if (result.MSGList != null && result.MSGList.Count > 0)
                            {
                                _eventAggregator.GetEvent <ErrorLogVM>().Publish(result.MSGList);
                                //JCHMessageBox.Show("The capacity requirements are mismatching.\nPlease add/remove IDUs to make it compatible.\n", MessageType.Error);
                                //----------------- Code below for multi-langauge------------//
                                JCHMessageBox.Show(Language.Current.GetMessage("CAPCITYREQIREMENT"), MessageType.Error);
                            }
                            else
                            {
                                //JCHMessageBox.Show("The capacity requirements are mismatching.\nPlease add/remove IDUs to make it compatible.\n", MessageType.Error);
                                //----------------- Code below for multi-langauge------------//
                                JCHMessageBox.Show(Language.Current.GetMessage("CAPCITYREQIREMENT"), MessageType.Error);
                            }
                        }
                    }
                    else
                    {
                        JCHMessageBox.Show(Language.Current.GetMessage("CAPCITYREQIREMENT"), MessageType.Error);
                    }
                }
                else
                {
                    IsValidDraw = false;
                    JCHMessageBox.Show(string.Format(ErrMsg));
                }
            }
            catch (Exception ex)
            {
                IsValidDraw = false;
            }
            return(IsValidDraw);
        }