Example #1
0
        public void UpdateHierarchyList()
        {
            UnitView HospitalUnitView = new UnitView(HospManager.Hospital);
            var      deptView         = HospManager.AppManager.ApplicationDb.Departments.ToList();

            if (deptView != null)
            {
                foreach (Department dept in deptView)
                {
                    UnitView newDept = new UnitView(dept);
                    HospitalUnitView.Units.Add(newDept);
                    if (dept.Wards != null)
                    {
                        foreach (Ward ward in dept.Wards)
                        {
                            UnitView newWard = new UnitView(ward);
                            newDept.Units.Add(newWard);
                        }
                    }
                }
            }

            if (units.Count > 0)
            {
                units.Remove(units[0]);
            }
            units.Add(HospitalUnitView);
        }
        public void UpdateHierarchyList()
        {
            UnitView HospitalUnitView = new UnitView(HospManager.Hospital);
            var deptView = HospManager.AppManager.ApplicationDb.Departments.ToList();
            if (deptView != null)
            {
                foreach (Department dept in deptView)
                {
                    UnitView newDept = new UnitView(dept);
                    HospitalUnitView.Units.Add(newDept);
                    if (dept.Wards != null)
                    {
                        foreach (Ward ward in dept.Wards)
                        {
                            UnitView newWard = new UnitView(ward);
                            newDept.Units.Add(newWard);
                        }
                    }
                }
            }

            if (units.Count > 0)
                units.Remove(units[0]);
            units.Add(HospitalUnitView);
        }
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            UnitView selection = value as UnitView;

            if (selection != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #4
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            UnitView unit = value as UnitView;
            Hospital hosp = null;

            if (unit != null)
            {
                hosp = unit.Reference as Hospital;
            }
            if (hosp != null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            UnitView unit = value as UnitView;
            Ward     ward = null;

            if (unit != null)
            {
                ward = unit.Reference as Ward;
            }
            if (ward != null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }