Пример #1
0
 private void OnFindZeroLengthClicked(NextGenModel.SystemVRF currentSystem)
 {
     try
     {
         if (!currentSystem.IsManualPiping)
         {
             if (currentSystem.MyPipingNodeOut != null)
             {
                 currentSystem.IsInputLengthManually = true;
                 designerCanvas.DoFindZeroLength();
                 UndoRedoSetup.SetInstanceNullWithInitalizedProjectStack();
             }
         }
         else
         {
             if ((currentSystem.MyPipingOrphanNodes != null && currentSystem.MyPipingOrphanNodes.Count > 0) || currentSystem.SystemStatus == SystemStatus.INVALID)
             {
                 JCHMessageBox.Show(Langauge.Current.GetMessage("ALERT_CHANGES_CANVAS"));
                 return;
             }
         }
     }
     catch (Exception ex)
     {
         // To DO
     }
 }
Пример #2
0
 private void SaveProjectClicked()
 {
     try
     {
         bool isActive = regionManager.Regions[RegionNames.ContentRegion].ActiveViews.Select(a => a.ToString()?.Split('.').Last()).Contains("MasterDesigner");
         if (isActive)
         {
             Project = Project.GetProjectInstance;
             DoSavePipingTempNodeOutStructure();
             ProjectInfoBLL objProjectInfoBll = new ProjectInfoBLL();
             bool           status            = objProjectInfoBll.UpdateProject(Project);
             System.Windows.Application.Current.Properties["ProjectId"] = Project.projectID;
             JCHMessageBox.Show(Langauge.Current.GetMessage("SAVED_SUCCESSFULLY"));
         }
         else
         {
             JCHMessageBox.Show(Langauge.Current.GetMessage("ALERT_SAVE_PROJECT"));
         }
     }
     catch (Exception ex)
     {
         int?id = Project.GetProjectInstance?.projectID;
         Logger.LogProjectError(id, ex);
     }
 }
Пример #3
0
        private void DrawAutoWiring(ControlSystem system)
        {
            try
            {
                var findgroup = Project.CurrentProject.ControlGroupList.Find(g => g.ControlSystemID == system.Id);
                if (findgroup != null)
                {
                    if (findgroup.IsValidGrp)
                    {
                        AutoControlWiring objAutoControlWiring =
                            new AutoControlWiring(true, Project.GetProjectInstance, system, designerCanvas.addflow);
                        system.IsAutoWiringPerformed = true;
                    }
                    else
                    {
                        JCHMessageBox.Show("The Group has some errors. Please Check!", MessageType.Error);
                    }

                    UtilTrace.SaveHistoryTraces();
                }
                else
                {
                    JCHMessageBox.Show("Cannot perform Auto-Control Wiring on Empty Group", MessageType.Warning);
                }
            }
            catch (Exception ex)
            { //ToDo
            }
        }
Пример #4
0
 private void OnAddBulkPopupClickedCommand()
 {
     try
     {
         if (!string.IsNullOrWhiteSpace(TxtBulkAdd))
         {
             if (Convert.ToInt32(TxtBulkAdd) < 1000)
             {
                 _eventAggregator.GetEvent <PubSubEvent <string> >().Publish(TxtBulkAdd);
             }
             else
             {
                 //JCHMessageBox.Show("You can enter maximum 1000 floor");
                 //---------------- Below code added for multi-language----------//
                 JCHMessageBox.Show(Language.Current.GetMessage("ALERT_MAXIMUM_FLOOR"));
             }
             _winService.Close(ViewKeys.BulkFloorPopup);
         }
         else
         {
             //JCHMessageBox.Show("Please Enter Floor No");
             //---------------- Below code added for multi-language----------//
             JCHMessageBox.Show(Language.Current.GetMessage("ALERT_ENTER_FLOOR_NO"));
         }
     }
     catch (Exception ex)
     {
         Logger.LogProjectError(null, ex);
     }
 }
Пример #5
0
        private void OnApplyClicked()
        {
            var proj = JCHVRF.Model.Project.GetProjectInstance;

            proj.IsRoomInfoChecked       = IsRoomInfoChecked;
            proj.IsOutdoorListChecked    = IsOutdoorListChecked;
            proj.IsWiringDiagramChecked  = IsWiringDiagramChecked;
            proj.IsIndoorListChecked     = IsIndoorListChecked;
            proj.IsPipingDiagramChecked  = IsPipingDiagramChecked;
            proj.IsControllerChecked     = IsControllerChecked;
            proj.IsExchangerChecked      = IsExchangerChecked;
            proj.IsActualCapacityChecked = IsActualCapacityChecked;
            proj.IsNormalCapacityChecked = IsNormalCapacityChecked;
            proj.IsIduCapacityW          = IsIduCapacityW;
            JCHMessageBox.Show(Langauge.Current.GetMessage("ALERT_SUCCESSFULLY_APPLIED"));    //"Successfully applied"
            _winService.Close(ViewKeys.EditReportContents);
            JCHVRF.Model.Project.CurrentProject.SystemListNextGen.ForEach((p) =>
            {
                if (p.IsExportToReport == false)
                {
                    p.editreportapply = true;
                }
                else
                {
                    p.editreportapply = false;
                }
            });
        }
        private void RemoveFromAllAccessories(object win)
        {
            if (JCHMessageBox.Show("Are you sure want to remove Accessories", MessageType.Information, MessageBoxButton.YesNoCancel) == MessageBoxResult.Yes)
            {
                try
                {
                    var selectedItems = (from s in ListAccessory where s.IsSelect == true select s).ToList();

                    foreach (AccessoryModel accessory in selectedItems)
                    {
                        if (objIndoor != null && objIndoor.IndoorItem != null) //ri.IndoorItem.ListAccessory.Count > 0
                        {
                            if (objIndoor.ListAccessory != null && objIndoor.ListAccessory.Count > 0)
                            {
                                objIndoor.ListAccessory.RemoveAll(c => c.Type == accessory.Type);
                            }
                            if (objIndoor.IndoorItem.ListAccessory != null && objIndoor.IndoorItem.ListAccessory.Count > 0)
                            {
                                objIndoor.IndoorItem.ListAccessory.RemoveAll(a => a.Type == accessory.Type);
                            }
                            accessory.IsSelect = false;
                        }
                    }
                }
                catch (Exception ex)
                {
                    int?id = Project.GetProjectInstance?.projectID;
                    Logger.LogProjectError(id, ex);
                }
            }
            _projectBAL.UpdateProject(Project.CurrentProject);
            CloseWindow(win);
        }
Пример #7
0
        private bool ValidateHeatWetBulb()
        {
            double nCWBVal = Math.Round((Convert.ToDouble(HeatingWetBulb))); //Convert.ToDouble(indoorCoolingWB);

            if ((nCWBVal >= -20) && (nCWBVal <= 15))
            {
                lblOutDoorHeatingWB = string.Empty;
                if (Convert.ToDecimal(HeatingWetBulb) > Convert.ToDecimal(HeatingDryBulb))
                {
                    JCHMessageBox.ShowWarning(Msg.WARNING_TXT_LESSTHAN(UnitTemperature.WB.ToString(), UnitTemperature.DB.ToString()));
                    return(false);
                }

                return(true);
            }
            else
            {
                lblOutDoorHeatingWB = string.Format("Range[{0}, {1}]", Unit.ConvertToControl(-20, UnitType.TEMPERATURE, CurrentTempUnit), Unit.ConvertToControl(15, UnitType.TEMPERATURE, CurrentTempUnit)); //"Range[14, 24]";

                if (Convert.ToDecimal(HeatingWetBulb) > Convert.ToDecimal(HeatingDryBulb))
                {
                    JCHMessageBox.ShowWarning(Msg.WARNING_TXT_LESSTHAN(UnitTemperature.WB.ToString(), UnitTemperature.DB.ToString()));
                }
                return(false);
            }
        }
Пример #8
0
        private void BulkRemoveRoom()
        {
            bool isCheckedAny = RoomList.Any(x => x.IsRoomChecked == true);

            if (isCheckedAny)
            {
                if (JCHMessageBox.Show(language.Current.GetMessage("CONFIRM_ROOM_DELETE"), MessageType.Information, MessageBoxButton.OKCancel) == MessageBoxResult.OK)
                {
                    for (int i = RoomList.Count - 1; i >= 0; i--)
                    {
                        if (RoomList[i].IsRoomChecked)
                        {
                            if (JCHVRF.Model.Project.CurrentProject != null && JCHVRF.Model.Project.CurrentProject.RoomIndoorList != null && JCHVRF.Model.Project.CurrentProject.RoomIndoorList.Count > 0)
                            {
                                UpdateRoomList(RoomList[i]);
                            }
                            RoomList.RemoveAt(i);
                        }
                    }
                    if (!AreSaveCancelVisible)
                    {
                        AddEditRoomClick();
                    }
                }
            }
        }
        private void MaxTypeCountCheck(object obj)
        {
            bool validstatis = true;
            int  typecount   = 0;

            if (ListAccessory != null)
            {
                var selectedrowobj = (AccessoryModel)obj;
                var selectedItems  = (from s in ListAccessory where s.IsSelect == true select s).ToList();

                foreach (AccessoryModel accessory1 in selectedItems)
                {
                    typecount = 0;
                    if (accessory1.IsSelect == false)
                    {
                        continue;
                    }

                    selectedrowobj = accessory1;
                    if (selectedItems.Count > 0 && selectedrowobj != null)
                    {
                        foreach (AccessoryModel accessory in selectedItems)
                        {
                            if (selectedrowobj.Description == accessory.Description)
                            {
                                typecount += accessory.Count;
                            }
                        }
                        if (typecount > selectedrowobj.MaxCount)
                        {
                            validstatis = false;
                        }
                        else
                        {
                            // AddButtonEnable = true;
                        }
                    }
                }
                var selectedrowobjmsg = new AccessoryModel();
                if (obj != null)
                {
                    selectedrowobjmsg = (AccessoryModel)obj;
                }

                if (validstatis == true)
                {
                    AddButtonEnable = true;
                }
                else if (obj == null)
                {
                    AddButtonEnable = false;
                }
                else if (selectedrowobjmsg.IsSelect == true)
                {
                    AddButtonEnable = false;
                    JCHMessageBox.Show("selected count is greater than max count of type ");
                }
            }
        }
Пример #10
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);
        }
Пример #11
0
        private void SelectedTreeViewItemClick(object leftSideBarChild)
        {
            if (leftSideBarChild.GetType().Equals(typeof(LeftSideBarChild)))
            {
                var object2 = ((LeftSideBarChild)leftSideBarChild).Source;

                var vrf = WorkFlowContext.CurrentSystem as JCHVRF.Model.NextGen.SystemVRF;
                if (vrf != null && vrf.HvacSystemType == "1")
                {
                    if ((vrf.MyPipingOrphanNodes != null && vrf.MyPipingOrphanNodes.Count > 0) || (vrf.SystemStatus == SystemStatus.WIP && vrf.IsManualPiping))
                    {
                        JCHMessageBox.Show(Langauge.Current.GetMessage("ALERT_CHANGES_CANVAS"));
                        LeftSideBarChild toselect = AllSystems?.FirstOrDefault(a => a.Children.Count > 0 && a.Children.FirstOrDefault(b => ((SystemBase)b.Source)?.Id == _lastSelectedId) != null)?.Children.FirstOrDefault(b => ((SystemBase)b.Source)?.Id == _lastSelectedId);
                        if (toselect != null)
                        {
                            toselect.IsSelected = true;
                        }
                        else
                        {
                            toselect            = AllSystems?.FirstOrDefault(a => a.Children.Count > 0 && a.Children.FirstOrDefault() != null)?.Children.FirstOrDefault();
                            toselect.IsSelected = true;
                        }
                        return;
                    }
                    //Start Bug#4695 : If ODU is dirty then get confirmation before user leaves the current system. Retain user on the same system if he wants to stay.
                    else if (vrf.IsODUDirty)
                    {
                        MessageBoxResult messageBoxResult = JCHMessageBox.Show(Langauge.Current.GetMessage("ALERT_CHANGES_ON_SYSTEM_FLIP"), MessageType.Warning, MessageBoxButton.YesNo);

                        if (messageBoxResult == MessageBoxResult.Yes)
                        {
                            LeftSideBarChild toselect = AllSystems?.FirstOrDefault(a => a.Children.Count > 0 && a.Children.FirstOrDefault(b => ((SystemBase)b.Source)?.Id == _lastSelectedId) != null)?.Children.FirstOrDefault(b => ((SystemBase)b.Source)?.Id == _lastSelectedId);
                            if (toselect != null)
                            {
                                toselect.IsSelected = true;
                            }
                            else
                            {
                                toselect            = AllSystems?.FirstOrDefault(a => a.Children.Count > 0 && a.Children.FirstOrDefault() != null)?.Children.FirstOrDefault();
                                toselect.IsSelected = true;
                            }
                            return;
                        }
                    }
                    //End Bug#4695
                }


                _eventAggregator.GetEvent <SystemSelectedItemSubscriber>().Publish((SystemBase)object2);
                _lastSelectedId = ((SystemBase)object2).Id;
            }
        }
Пример #12
0
 public void UpdateWiringNodeStructure(JCHVRF.Model.NextGen.SystemVRF CurrentSystem)
 {
     try
     {
         string imageDir = @"/Image/TypeImages/";
         JCHVRF_New.Utility.WiringBLL bll = new JCHVRF_New.Utility.WiringBLL(JCHVRF.Model.Project.GetProjectInstance, imageDir);
         bll.CreateWiringNodeStructure(CurrentSystem);
     }
     catch (Exception ex)
     {
         JCHMessageBox.Show("Error Occured : " + ex.Message);
     }
 }
Пример #13
0
 public void UpdatePipingNodeStructure(JCHVRF.Model.NextGen.SystemVRF CurrentSystem)
 {
     try
     {
         NextGenBLL.PipingBLL pipBll = GetPipingBLLInstance();
         pipBll.CreatePipingNodeStructure(CurrentSystem);
         //newUtilTrace.UtilTrace.SaveHistoryTraces();
     }
     catch (Exception ex)
     {
         JCHMessageBox.Show("Error Occured : " + ex.Message);
     }
 }
Пример #14
0
 private void UpdatePipingNodeStructure(JCHVRF.Model.NextGen.SystemVRF CurrentSystem)
 {
     try
     {
         NextGenBLL.PipingBLL pipBll = GetPipingBLLInstance();
         pipBll.CreatePipingNodeStructure(CurrentSystem);
     }
     catch (Exception ex)
     {
         //JCHMessageBox.Show("Error Occured : " + ex.Message);
         //----------------- Code below for multi-langauge------------//
         JCHMessageBox.Show(Language.Current.GetMessage("ERROR_OCCURED"), MessageType.Error);
     }
 }
Пример #15
0
        public void AddEventCommandClick()
        {
            objEventList = new ObservableCollection <Event>();
            objEventList.Add(SelectedEvent);

            Boolean result = false;

            result = _eventDAL.InsertEventData(selectedEvent.EventTitle, selectedEvent.EventLocation, selectedEvent.StartDate, selectedEvent.EndDate, selectedEvent.Notes);
            if (result)
            {
                JCHMessageBox.Show(language.Current.GetMessage("ALERT_EVENT_SUCCESS"));
                _winService.Close(ViewKeys.AddEvent);
                _globalProperties.Notifications.Insert(0, new Notification(NotificationType.APPLICATION, string.Format("Event {0} Created", selectedEvent.EventTitle)));
            }
        }
Пример #16
0
 public void UpdateWiringNodeStructure(JCHVRF.Model.NextGen.SystemVRF CurrentSystem)
 {
     try
     {
         string imageDir = @"/Image/TypeImages/";
         JCHVRF_New.Utility.WiringBLL bll = new JCHVRF_New.Utility.WiringBLL(JCHVRF.Model.Project.GetProjectInstance, imageDir);
         bll.CreateWiringNodeStructure(CurrentSystem);
     }
     catch (Exception ex)
     {
         //JCHMessageBox.Show("Error Occured : " + ex.Message);
         //----------------- Code below for multi-langauge------------//
         JCHMessageBox.Show(Language.Current.GetMessage("ERROR_OCCURED"), MessageType.Error);
     }
 }
Пример #17
0
        public void UpdateEventCommandClick()
        {
            //objEventList = new ObservableCollection<Event>();
            //objEventList.Add(SelectedEvent);

            Boolean result = false;

            result = _eventDAL.UpdateEventData(selectedEvent.EventId, selectedEvent.EventTitle, selectedEvent.EventLocation, selectedEvent.StartDate, selectedEvent.EndDate, selectedEvent.Notes);

            if (result)
            {
                JCHMessageBox.Show("Event Successfully Updated");
                // JCHMessageBox.Show(language.Current.GetMessage("ALERT_EVENT_UPDATE"));
                _winService.Close(ViewKeys.AddEvent);
            }
        }
Пример #18
0
        /// <summary>
        /// Algorithm to Check combination/Combatibilty between the Controllers
        /// </summary>
        /// <param name="type1"></param>
        /// <param name="type2"></param>
        /// <param name="number"></param>
        /// <returns></returns>
        private bool CheckControllerCompatible(CentralController type1, CentralController type2, int number)
        {
            if (string.IsNullOrEmpty(type1.CompatibleModel))
            {
                if (number == 1)
                {
                    return(CheckControllerCompatible(type2, type1, 2));
                }
                else
                {
                    return(true);
                }
            }
            else if (type1.CompatibleModel == "none")
            {
                //2.1 - Not compatible with other central controler
                //JCHMessageBox.Show("ERROR: Controller Not compatible");
                //---------------- Below code added for multi-language----------//
                JCHMessageBox.Show(Langauge.Current.GetMessage("ERROR_CONTROLLER"));

                return(false);
            }
            else
            {
                //2.2 - is combinable
                List <string> compatibleModels = new List <string>();
                compatibleModels.AddRange(type1.CompatibleModel.Split(',').Select(r => r.Trim()));
                //if (type2.Type == ControllerType.CentralController || type2.Type == ControllerType.ONOFF)
                //{
                if (!compatibleModels.Contains(type2.Model))
                {
                    if (number == 2 || string.IsNullOrEmpty(type2.CompatibleModel))
                    {
                        //JCHMessageBox.Show("ERROR: Controller Not compatible with " + (number ==1 ? type2.Model : type1.Model));
                        //---------------- Below code added for multi-language----------//
                        JCHMessageBox.Show(Langauge.Current.GetMessage("ERROR_NOT_COMPATIABLE") + (number == 1 ? type2.Model : type1.Model));
                        return(false);
                    }
                    else
                    {
                        return(CheckControllerCompatible(type2, type1, 2));
                    }
                }
                //}
            }
            return(true);
        }
Пример #19
0
        public static void LogProjectError(int?id, Exception ex, bool flagShowMessage = true)
        {
            string subRegion = JCHVRF.Model.Project.GetProjectInstance?.SubRegionCode;
            string region    = JCHVRF.Model.Project.GetProjectInstance?.RegionCode;
            string format    = string.Format("Project ID: {0} , Region : {1} , SubRegion: {2},Exception : {3}", id.HasValue ? id.Value.ToString() : "Not Found", string.IsNullOrEmpty(region) ? "Not Found" : region, string.IsNullOrEmpty(subRegion) ? "Not Found" : subRegion, ex != null ? ex.StackTrace.ToString() : "No exception");

            //log.Error(format, ex);
            log.Error(format);
            if (flagShowMessage)
            {
                Application.Current.Dispatcher.Invoke(new Action(() =>
                {
                    JCHMessageBox.Show(Language.Current.GetMessage("ALERT_CONTACT"), MessageType.Error);
                }));
            }
            //SendEmailtoContacts();
        }
Пример #20
0
 private void OnRemove()
 {
     if (JCHMessageBox.Show(language.Current.GetMessage("CONFIRM_IDU_DELETE"), MessageType.Information, System.Windows.MessageBoxButton.OKCancel) == System.Windows.MessageBoxResult.OK)
     {
         try
         {
             var toRemove = SelectedIDU.Where(i => i.IsChecked).Select(i => i.RoomIndoor);
             RemoveIdu(toRemove);
             RefreshHeaderAndRemoveButton();
         }
         catch (Exception ex)
         {
             int?id = _project?.projectID;
             Logger.LogProjectError(id, ex);
         }
     }
 }
Пример #21
0
        bool SystemType()
        {
            try
            {
                string errorMessage = null;
                bool   IsValid      = ValidateSystemTypeValid(out errorMessage);
                if (IsValid)
                {
                    int        sysTypeAsInt = Convert.ToInt32(SelectedsystemName.SystemID);
                    SystemBase system       = null;
                    switch (sysTypeAsInt)
                    {
                    case 1:
                        system = createVRFSystem();
                        break;

                    case 2:
                        system = createHeatExchangerSystem();
                        break;
                    }
                    WorkFlowContext.NewSystem = system;
                    if (IsSingleFoorChecked && CurrentProject.FloorList.Count < 1)
                    {
                        CurrentProject.FloorList.Add(new JCHVRF.Model.Floor()
                        {
                            Name = "Floor 1", Id = "0"
                        });
                    }
                    else if (IsMultipleFloorChecked)
                    {
                        CurrentProject.FloorList.Clear();
                        _eventAggregator.GetEvent <PubSubEvent <int?> >().Publish(FloorCount);
                    }
                }
                else
                {
                    JCHMessageBox.Show(errorMessage, MessageType.Error);
                }
            }
            catch (Exception ex)
            {
                int?id = CurrentProject?.projectID;
                Logger.LogProjectError(id, ex);
            }
            return(IsValid);
        }
Пример #22
0
        public void DeleteEventClick(int?eventId)
        {
            Boolean result = false;

            result = _eventDAL.DeleteEventClick(eventId);
            if (result)
            {
                JCHMessageBox.Show("Event Successfully Deleted");
                if (Events.Count > 0)
                {
                    LoadEvents(Currentdate.ToString());
                }
                if (Events.Count == 0)
                {
                    _winService.Close(ViewKeys.EventList);
                }
            }
        }
Пример #23
0
 private void MinusClick()
 {
     if (floorCount == "")
     {
         //JCHMessageBox.Show("No floors added to Remove");
         //---------------- Below code added for multi-language----------//
         JCHMessageBox.Show(Language.Current.GetMessage("ALERT_NO_FLOOR_ADD_TO_REMOVE"));
         return;
     }
     if (Convert.ToInt32(floorCount) > 1)
     {
         floorCount = string.IsNullOrEmpty(TxtBulkAdd) ? "0" : TxtBulkAdd;
         if (floorCount != "0")
         {
             TxtBulkAdd = Convert.ToString(Convert.ToInt32(floorCount) - 1);
         }
     }
 }
Пример #24
0
 private void OnMultiRoomValueBulkUpload(int introomCount)
 {
     try
     {
         //int introomCount = int.Parse(RoomCount);
         if (introomCount > 0)
         {
             int BulkAddCount = this.RoomList.Count + introomCount;
             int Id           = 0;
             if (BulkAddCount <= 1000)
             {
                 for (int i = this.RoomList.Count; i < BulkAddCount; i++)
                 {
                     Id = this.RoomList.Count + 1;
                     RoomList.Add(new Room
                     {
                         Id             = (Id.ToString()),
                         Name           = sRoomName + (Id),
                         SensibleHeat   = SensibleHeat,
                         RqCapacityCool = RqCapacityCool,
                         RqCapacityHeat = RqCapacityHeat,
                         //HeatingDryBulb = HeatingDryBulb,
                         //CoolingDryBulb = CoolingDryBulb,
                         //CoolingWetBulb = CoolingWetBulb,
                         //CoolingRelativeHumidity = CoolingRelativeHumidity
                         HeatingDryBulb          = Convert.ToDouble(CurrentProject.DesignCondition.indoorCoolingHDB),
                         CoolingDryBulb          = Convert.ToDouble(CurrentProject.DesignCondition.indoorCoolingDB),
                         CoolingWetBulb          = Convert.ToDouble(CurrentProject.DesignCondition.indoorCoolingWB),
                         CoolingRelativeHumidity = Convert.ToDouble(CurrentProject.DesignCondition.indoorCoolingRH)
                     });
                 }
             }
             else
             {
                 JCHMessageBox.Show(language.Current.GetMessage("ALERT_ENTER_COUNT"));
             }
         }
     }
     catch (Exception ex)
     {
         int?id = Project.GetProjectInstance?.projectID;
         Logger.LogProjectError(id, ex);
     }
 }
Пример #25
0
        private void OnSearchLostFocus()
        {
            Regex regex = new Regex("^[A-Za-z0-9- ]+$");

            if (string.IsNullOrWhiteSpace(SearchText))
            {
                JCHMessageBox.Show(Langauge.Current.GetMessage("ERROR_SEARCH"));//Search text box should not contain blank spaces

                SearchText = Langauge.Current.GetMessage("DASHBOARD_SEARCH");
            }
            else
            {
                Match match = regex.Match(SearchText);
                if (!match.Success)
                {
                    JCHMessageBox.Show(Langauge.Current.GetMessage("ERROR_SEARCH_VALIDATION"));//Search text should be alphanumeric
                }
            }
        }
Пример #26
0
        private void openVRFProject(int projectId)
        {
            Project importProj     = CommonBLL.OpenVRFProject(projectId);
            Project currentProject = JCHVRF.Model.Project.GetProjectInstance;

            //if (currentProject != null && importProj.BrandCode != currentProject.BrandCode)
            //{
            //    JCHMessageBox.Show(Msg.GetResourceString("PEOJECT_BRAND_DIFFERENT"));
            //    return;
            //}

            JCHVRF.Model.Project.CurrentProject = importProj;
            NavigationParameters param = new NavigationParameters();

            param.Add("Project", importProj);

            _regionManager.RequestNavigate(RegionNames.ContentRegion, ViewKeys.Splash, param);
            JCHMessageBox.Show(string.Format(language.Current.GetMessage("ALERT_PROJECT_OPEN_SUCCESS")));
        }
Пример #27
0
 private void RemoveRoomIconClick()
 {
     if (JCHMessageBox.Show(language.Current.GetMessage("CONFIRM_ROOM_DELETE"), MessageType.Information, MessageBoxButton.OKCancel) == MessageBoxResult.OK)
     {
         if (this.RoomList != null && this.RoomList.Count > 0)
         {
             Room room = this.RoomList.LastOrDefault();
             this.RoomList.Remove(room);
             if (JCHVRF.Model.Project.CurrentProject != null && JCHVRF.Model.Project.CurrentProject.RoomIndoorList != null && JCHVRF.Model.Project.CurrentProject.RoomIndoorList.Count > 0)
             {
                 UpdateRoomList(room);
             }
         }
         if (!AreSaveCancelVisible)
         {
             AddEditRoomClick();
         }
     }
 }
Пример #28
0
        public void DoPipingValidation(JCHVRF.Model.NextGen.SystemVRF CurrentSystem)
        {
            if (!CurrentSystem.IsManualPiping)
            {
                if (CurrentSystem.MyPipingNodeOut != null)
                {
                    designerCanvas.Validate(CurrentSystem, ref designerCanvas.addflow);
                    newUtilTrace.UtilTrace.SaveHistoryTraces(CurrentSystem);
                }
                else
                {
                    JCHMessageBox.Show(Langauge.Current.GetMessage("ALERT_CHANGES_CANVAS"));
                }
            }
            else
            {
                if (CurrentSystem.MyPipingOrphanNodes != null && CurrentSystem.MyPipingOrphanNodes.Count > 0)
                {
                    JCHMessageBox.Show(Langauge.Current.GetMessage("ALERT_CHANGES_CANVAS"));
                    return;
                }

                string ErrMsg = string.Empty;
                this.projectLegacy = JCHVRF.Model.Project.GetProjectInstance;
                bool IsValidSystemVRF = Utility.Validation.IsValidatedSystemVRF(this.projectLegacy, CurrentSystem, out ErrMsg);
                if (IsValidSystemVRF)
                {
                    var IsValid = ReselectOutdoor(CurrentSystem, 0);
                    if (IsValid == true)
                    {
                        designerCanvas.Validate(CurrentSystem, ref designerCanvas.addflow);
                        //CurrentSystem.IsPipingOK = true;
                        newUtilTrace.UtilTrace.SaveHistoryTraces();
                    }
                }
                else
                {
                    CurrentSystem.IsPipingOK = false;
                    JCHMessageBox.Show(ErrMsg);
                }
            }
        }
Пример #29
0
        private bool ValidateHeatingDryBulb()
        {
            double nCDBVal = Math.Round(Convert.ToDouble(HeatingDryBulb));

            if ((nCDBVal >= -18) && (nCDBVal <= 33))
            {
                lblOutdoorheatingDB = string.Empty;
                return(true);
            }
            else
            {
                lblOutdoorheatingDB = string.Format("Range[{0}, {1}]", Unit.ConvertToControl(-18, UnitType.TEMPERATURE, CurrentTempUnit), Unit.ConvertToControl(33, UnitType.TEMPERATURE, CurrentTempUnit));

                if (Convert.ToDecimal(HeatingDryBulb) < Convert.ToDecimal(HeatingWetBulb) && !(HeatingDryBulb == 0))
                {
                    JCHMessageBox.ShowWarning(Msg.WARNING_TXT_LESSTHAN(UnitTemperature.WB.ToString(), UnitTemperature.DB.ToString()));
                }

                return(false);
            }
        }
Пример #30
0
 private void OnAddBulkPopupClickedCommand()
 {
     if (!string.IsNullOrWhiteSpace(TxtBulkAdd))
     {
         Int64 introomCount = Int64.Parse(TxtBulkAdd);
         if (introomCount <= 1000)
         {
             _eventAggregator.GetEvent <PubSubEvent <int> >().Publish(Convert.ToInt32(introomCount));
             _winService.Close(ViewKeys.BulkRoomPopup);
         }
         else
         {
             JCHMessageBox.ShowError(Language.Current.GetMessage("ALERT_ENTER_COUNT"));
         }
     }
     else
     {
         //JCHMessageBox.Show("Please Enter RoomNo");
         JCHMessageBox.Show(Language.Current.GetMessage("ALERT_ENTER_ROOMNO"));
     }
 }