Exemplo n.º 1
0
        public UserRoleAuthAdminPage()
        {
            InitializeComponent();
            UserRoleAuths = SecurityHelper.GetUserRoleAuths((int)LayoutComponentType.UserRoleAuthorisation);
            if (this.UserRoleAuths == null)
            {
                this.Content = SecurityHelper.GetNoPermissionInfoPanel();
                return;
            }
            btnSave.IsEnabled = this.UserRoleAuths.Count(i => i.WriteRight == true) > 0;
            FillLanguage();

            btnSave.Click   += new RoutedEventHandler(btnSave_Click);
            btnCancel.Click += new RoutedEventHandler(btnCancel_Click);

            //uiUsers.SelectionChanged += new Telerik.Windows.Controls.SelectionChangedEventHandler(uiUsers_SelectionChanged);
            btnNew.Click += new RoutedEventHandler(btnNew_Click);

            RebindUserList();

            uiUsers.IsFilteringEnabled = true;
            uiUsers.KeyUp += new KeyEventHandler(uiUsers_KeyUp);
            uiUsers.OpenDropDownOnFocus = true;
            uiUsers.TextSearchMode      = TextSearchMode.Contains;
            uiUsers.LostFocus          += new RoutedEventHandler(uiUsers_LostFocus);

            DataServiceHelper.ListComponentAsync(null, ListComponentCompleted);
        }
Exemplo n.º 2
0
        public ServiceAdminPage()
        {
            InitializeComponent();
            UserRoleAuths = SecurityHelper.GetUserRoleAuths((int)LayoutComponentType.ServiceAdmin);

            if (!Globals.UserLogin.IsUserOrganisationAdministrator)
            {
                this.Content = SecurityHelper.GetNoPermissionInfoPanel();
                return;
            }
            FillLanguage();
            SecurityChecking();
            BeginRebindService();

            //Services
            btnSaveService.Click          += new RoutedEventHandler(btnSaveService_Click);
            btnCancelService.Click        += new RoutedEventHandler(btnCancelService_Click);
            gvwServices.AddingNewDataItem += new EventHandler <Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs>(gvwServices_AddingNewDataItem);
            //gvwServices.BeginningEdit += new EventHandler<Telerik.Windows.Controls.GridViewBeginningEditRoutedEventArgs>(gvwServices_BeginningEdit);
            gvwServices.CellValidating   += new EventHandler <Telerik.Windows.Controls.GridViewCellValidatingEventArgs>(gvwServices_CellValidating);
            gvwServices.SelectionChanged += new EventHandler <SelectionChangeEventArgs>(gvwServices_SelectionChanged);

            gridImages.Visibility   = System.Windows.Visibility.Collapsed;
            ucImageUpload.ImageType = ImageType.Service;

            //Common
            UiHelper.ApplyMouseWheelScrollViewer(scrollViewerService);
        }
Exemplo n.º 3
0
        public SiteAdminPage()
        {
            InitializeComponent();
            UserRoleAuths = SecurityHelper.GetUserRoleAuths((int)LayoutComponentType.SiteAdmin);

            if (this.UserRoleAuths == null)
            {
                this.Content = SecurityHelper.GetNoPermissionInfoPanel();
                return;
            }
            SecurityChecking();
            FillLanguage();
            BeginRebindSite();

            //Sites
            btnSaveSite.Click          += new RoutedEventHandler(btnSaveSite_Click);
            btnCancelSite.Click        += new RoutedEventHandler(btnCancelSite_Click);
            gvwSites.SelectionChanged  += new EventHandler <Telerik.Windows.Controls.SelectionChangeEventArgs>(gvwSites_SelectionChanged);
            gvwSites.AddingNewDataItem += new EventHandler <Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs>(gvwSites_AddingNewDataItem);
            //gvwSites.BeginningEdit += new EventHandler<Telerik.Windows.Controls.GridViewBeginningEditRoutedEventArgs>(gvwSites_BeginningEdit);
            gvwSites.CellValidating += new EventHandler <Telerik.Windows.Controls.GridViewCellValidatingEventArgs>(gvwSites_CellValidating);
            gvwSites.RowEditEnded   += new EventHandler <GridViewRowEditEndedEventArgs>(gvwSites_RowEditEnded);

            gridContactAccount.Visibility = gridImages.Visibility = System.Windows.Visibility.Collapsed;
            ucImageUpload.ImageType       = ImageType.Site;

            //Common
            UiHelper.ApplyMouseWheelScrollViewer(scrollViewerSite);
        }
Exemplo n.º 4
0
        public SiteGroupAdminPage()
        {
            InitializeComponent();
            UserRoleAuths = ucSitePicker.UserRoleAuths = SecurityHelper.GetUserRoleAuths((int)LayoutComponentType.SiteGroupAdmin);
            if (this.UserRoleAuths == null)
            {
                this.Content = SecurityHelper.GetNoPermissionInfoPanel();
                return;
            }
            btnSave.IsEnabled = this.UserRoleAuths.Count(i => i.WriteRight == true) > 0;
            FillLanguage();

            ucSitePicker.Init();
            RebindSiteGroups();

            gvwSiteGroup.AddingNewDataItem += new EventHandler <Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs>(gvwSiteGroup_AddingNewDataItem);
            gvwSiteGroup.Deleting          += new EventHandler <GridViewDeletingEventArgs>(gvwSiteGroup_Deleting);
            gvwSiteGroup.CellValidating    += new EventHandler <GridViewCellValidatingEventArgs>(gvwSiteGroup_CellValidating);
            gvwSiteGroup.SelectionChanged  += new EventHandler <SelectionChangeEventArgs>(gvwSiteGroup_SelectionChanged);

            gvwSites.Deleting += new EventHandler <GridViewDeletingEventArgs>(gvwSites_Deleting);

            btnSave.Click    += new RoutedEventHandler(btnSave_Click);
            btnCancel.Click  += new RoutedEventHandler(btnCancel_Click);
            btnAddSite.Click += new RoutedEventHandler(btnAddSite_Click);
        }
Exemplo n.º 5
0
        public PortalAdminPage()
        {
            InitializeComponent();

            if (!Globals.UserLogin.IsUserPortalAdministrator)
            {
                this.Content = SecurityHelper.GetNoPermissionInfoPanel();
                return;
            }

            BeginRebindOrg();

            //Organisations
            btnSaveOrg.Click   += new RoutedEventHandler(btnSaveOrg_Click);
            btnCancelOrg.Click += new RoutedEventHandler(btnCancelOrg_Click);
            gvwOrganisations.SelectionChanged  += new EventHandler <Telerik.Windows.Controls.SelectionChangeEventArgs>(gvwOrganisations_SelectionChanged);
            gvwOrganisations.AddingNewDataItem += new EventHandler <Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs>(gvwOrganisations_AddingNewDataItem);
            //gvwOrganisations.BeginningEdit += new EventHandler<Telerik.Windows.Controls.GridViewBeginningEditRoutedEventArgs>(gvwOrganisations_BeginningEdit);
            gvwOrganisations.CellValidating += new EventHandler <Telerik.Windows.Controls.GridViewCellValidatingEventArgs>(gvwOrganisations_CellValidating);
            gvwOrganisations.RowEditEnded   += new EventHandler <GridViewRowEditEndedEventArgs>(gvwOrganisations_RowEditEnded);


            //Common
            UiHelper.ApplyMouseWheelScrollViewer(scrollViewerOrganisation);
        }
Exemplo n.º 6
0
        public RoomAdminPage()
        {
            InitializeComponent();
            UserRoleAuths = ucSitePicker.UserRoleAuths = SecurityHelper.GetUserRoleAuths((int)LayoutComponentType.RoomAdmin);
            if (this.UserRoleAuths == null)
            {
                this.Content = SecurityHelper.GetNoPermissionInfoPanel();
                return;
            }
            FillLanguage();

            btnSaveRoom.IsEnabled    = btnSaveRoomEquipment.IsEnabled = btnSaveRoomService.IsEnabled = this.UserRoleAuths.Count(i => i.WriteRight == true) > 0;
            ucImageUpload.IsReadOnly = !btnSaveRoom.IsEnabled;

            //ucSitePicker.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(ucSitePicker_SelectionChanged);
            ucSitePicker.Init();
            ucSitePicker.InitComplete += new EventHandler(ucSitePicker_InitComplete);
            ucRoomTypes.Init();
            ucRoomTypes.InitComplete  += new EventHandler(ucRoomTypes_InitComplete);
            gvwRoom.AddingNewDataItem += new EventHandler <Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs>(gvwRoom_AddingNewDataItem);
            gvwRoom.Deleting          += new EventHandler <GridViewDeletingEventArgs>(gvwRoom_Deleting);
            gvwRoom.CellValidating    += new EventHandler <GridViewCellValidatingEventArgs>(gvwRoom_CellValidating);
            gvwRoom.BeginningEdit     += new EventHandler <GridViewBeginningEditRoutedEventArgs>(gvwRoom_BeginningEdit);
            gvwRoom.SelectionChanged  += new EventHandler <SelectionChangeEventArgs>(gvwRoom_SelectionChanged);

            btnSearch.Click     += new RoutedEventHandler(btnSearch_Click);
            btnSaveRoom.Click   += new RoutedEventHandler(btnSaveRoom_Click);
            btnCancelRoom.Click += new RoutedEventHandler(btnCancelRoom_Click);

            Dictionary <int, string> roomStatusDic = new Dictionary <int, string>();

            roomStatusDic.Add((int)RoomStatus.Available, RoomStatus.Available.ToString());
            roomStatusDic.Add((int)RoomStatus.Occupied, RoomStatus.Occupied.ToString());
            ((GridViewComboBoxColumn)this.gvwRoom.Columns["RoomStatus"]).ItemsSource = roomStatusDic;

            gridEquipmentService.Visibility = gridImages.Visibility = System.Windows.Visibility.Collapsed;
            ucImageUpload.ImageType         = ImageType.Room;

            DataServiceHelper.ListEquipmentAsync(Globals.UserLogin.UserOrganisationId, null, false, ListEquipmentCompleted);
            btnSaveRoomEquipment.Click   += new RoutedEventHandler(btnSaveRoomEquipment_Click);
            btnCancelRoomEquipment.Click += new RoutedEventHandler(btnCancelRoomEquipment_Click);
            btnInsertRoomEquipment.Click += new RoutedEventHandler(btnInsertRoomEquipment_Click);
            gvwRoomEquipment.Deleting    += new EventHandler <GridViewDeletingEventArgs>(gvwRoomEquipment_Deleting);

            DataServiceHelper.ListServiceAsync(Globals.UserLogin.UserOrganisationId, null, false, ListServiceCompleted);
            btnSaveRoomService.Click   += new RoutedEventHandler(btnSaveRoomService_Click);
            btnCancelRoomService.Click += new RoutedEventHandler(btnCancelRoomService_Click);
            btnInsertRoomService.Click += new RoutedEventHandler(btnInsertRoomService_Click);
            gvwRoomService.Deleting    += new EventHandler <GridViewDeletingEventArgs>(gvwRoomService_Deleting);

            //Common
            UiHelper.ApplyMouseWheelScrollViewer(scrollViewerRooms);
        }
Exemplo n.º 7
0
        public CustomerAdminPage()
        {
            InitializeComponent();

            UserRoleAuths = ucSitePicker.UserRoleAuths = SecurityHelper.GetUserRoleAuths((int)LayoutComponentType.BookingAdmin);
            if (this.UserRoleAuths == null)
            {
                this.Content = SecurityHelper.GetNoPermissionInfoPanel();
                return;
            }
            btnSaveCustomer.IsEnabled             = ucCntactInfoPanel.IsEnabled
                                                  = ucBookingAdmin.btnSaveBooking.IsEnabled = ucBookingAdmin.btnSaveBookingEquipment.IsEnabled = ucBookingAdmin.btnSaveBookingService.IsEnabled
                                                                                                                                                     = ucBookingAdmin.btnNewBooking.IsEnabled = ucBookingAdmin.btnInsertBookingEquipment.IsEnabled = ucBookingAdmin.btnInsertBookingService.IsEnabled
                                                                                                                                                                                                                                                         = this.UserRoleAuths.Count(i => i.WriteRight == true) > 0;
            FillLanguage();

            ucSitePicker.Init();
            ucSitePicker.InitComplete      += new EventHandler(ucSitePicker_InitComplete);
            btnSaveCustomer.Click          += new RoutedEventHandler(btnSaveCustomer_Click);
            btnCancelCustomer.Click        += new RoutedEventHandler(btnCancelCustomer_Click);
            gvwCustomers.SelectionChanged  += new EventHandler <Telerik.Windows.Controls.SelectionChangeEventArgs>(gvwCustomers_SelectionChanged);
            gvwCustomers.AddingNewDataItem += new EventHandler <Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs>(gvwCustomers_AddingNewDataItem);
            gvwCustomers.CellValidating    += new EventHandler <Telerik.Windows.Controls.GridViewCellValidatingEventArgs>(gvwCustomers_CellValidating);
            gvwCustomers.RowEditEnded      += new EventHandler <GridViewRowEditEndedEventArgs>(gvwCustomers_RowEditEnded);

            Dictionary <int, string> genderDic = new Dictionary <int, string>();

            genderDic.Add(-1, string.Empty);
            genderDic.Add((int)Enums.Gender.Male, Enums.Gender.Male.ToString());
            genderDic.Add((int)Enums.Gender.Female, Enums.Gender.Female.ToString());
            ((GridViewComboBoxColumn)this.gvwCustomers.Columns["Gender"]).ItemsSource = genderDic;

            ucCntactInfoPanel.btnSaveContact.Visibility = Visibility.Collapsed;

            btnSearch.Click          += new RoutedEventHandler(btnSearch_Click);
            chkHasContract.Checked   += new RoutedEventHandler(chkHasContract_CheckChanged);
            chkHasContract.Unchecked += new RoutedEventHandler(chkHasContract_CheckChanged);
            uiDateFrom.SelectedDate   = DateTime.Today;

            gridDetails.Visibility = ucCntactInfoPanel.Visibility = System.Windows.Visibility.Collapsed;

            ucBookingAdmin.RebindBookingList += new EventHandler(ucBookingAdmin_RebindBookingList);

            UiHelper.ApplyMouseWheelScrollViewer(scrollViewerCustomers);
        }
        public RoleComponentAdminPage()
        {
            InitializeComponent();
            UserRoleAuths = SecurityHelper.GetUserRoleAuths((int)LayoutComponentType.RoleComponentPermission);
            if (this.UserRoleAuths == null)
            {
                this.Content = SecurityHelper.GetNoPermissionInfoPanel();
                return;
            }
            btnSave.IsEnabled = Globals.UserLogin.IsUserOrganisationAdministrator &&
                                this.UserRoleAuths.Count(i => i.WriteRight == true) > 0;
            FillLanguage();

            btnSave.Click            += new RoutedEventHandler(btnSave_Click);
            btnCancel.Click          += new RoutedEventHandler(btnCancel_Click);
            uiRoles.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(uiRoles_SelectionChanged);
            FillComboboxData();
        }
Exemplo n.º 9
0
        public RoleAdminPage()
        {
            InitializeComponent();
            UserRoleAuths = SecurityHelper.GetUserRoleAuths((int)LayoutComponentType.RoleAdmin);
            if (this.UserRoleAuths == null)
            {
                this.Content = SecurityHelper.GetNoPermissionInfoPanel();
                return;
            }
            btnSave.IsEnabled = Globals.UserLogin.IsUserOrganisationAdministrator &&
                                this.UserRoleAuths.Count(i => i.WriteRight == true) > 0;
            FillLanguage();
            RebindRoleData();

            gvwRole.AddingNewDataItem += new EventHandler <Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs>(gvwRole_AddingNewDataItem);
            gvwRole.Deleting          += new EventHandler <GridViewDeletingEventArgs>(gvwRole_Deleting);
            gvwRole.CellValidating    += new EventHandler <GridViewCellValidatingEventArgs>(gvwRole_CellValidating);

            btnSave.Click   += new RoutedEventHandler(btnSave_Click);
            btnCancel.Click += new RoutedEventHandler(btnCancel_Click);
        }
Exemplo n.º 10
0
        public HistoryPaymentPage()
        {
            InitializeComponent();
            UserRoleAuths = ucSitePicker.UserRoleAuths = SecurityHelper.GetUserRoleAuths((int)LayoutComponentType.MonthlyPayment);
            if (this.UserRoleAuths == null)
            {
                this.Content = SecurityHelper.GetNoPermissionInfoPanel();
                return;
            }
            FillLanguage();
            ucSitePicker.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(ucSitePicker_SelectionChanged);
            ucSitePicker.Init();
            //ucSitePicker.InitComplete += new EventHandler(ucSitePicker_InitComplete);
            btnSearch.Click += new RoutedEventHandler(btnSearch_Click);

            RefillDate();
            uiDateFrom.SelectionChanged += new Telerik.Windows.Controls.SelectionChangedEventHandler(uiDateFrom_SelectionChanged);
            uiDateFrom.LostFocus        += new RoutedEventHandler(uiDateFrom_LostFocus);

            gvwBookingPayment.CellEditEnded += new EventHandler <GridViewCellEditEndedEventArgs>(gvwBookingPayment_CellEditEnded);
            uiCustomers.SelectionChanged    += new System.Windows.Controls.SelectionChangedEventHandler(uiCustomers_SelectionChanged);
        }
Exemplo n.º 11
0
        public BookingAdminPage()
        {
            InitializeComponent();
            UserRoleAuths = ucSitePicker.UserRoleAuths = ucBookingAdmin.ucBookingNew.ucSitePicker.UserRoleAuths = SecurityHelper.GetUserRoleAuths((int)LayoutComponentType.BookingAdmin);
            if (this.UserRoleAuths == null)
            {
                this.Content = SecurityHelper.GetNoPermissionInfoPanel();
                return;
            }
            ucBookingAdmin.btnSaveBooking.IsEnabled = ucBookingAdmin.btnSaveBookingEquipment.IsEnabled = ucBookingAdmin.btnSaveBookingService.IsEnabled
                                                                                                             = ucBookingAdmin.btnNewBooking.IsEnabled = ucBookingAdmin.btnInsertBookingEquipment.IsEnabled = ucBookingAdmin.btnInsertBookingService.IsEnabled
                                                                                                                                                                                                                 = this.UserRoleAuths.Count(i => i.WriteRight == true) > 0;
            FillLanguage();

            //ucSitePicker.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(ucSitePicker_SelectionChanged);
            ucSitePicker.Init();
            ucSitePicker.InitComplete += new EventHandler(ucSitePicker_InitComplete);
            btnSearch.Click           += new RoutedEventHandler(btnSearch_Click);
            uiDateFrom.SelectedDate    = DateTime.Today.AddMonths(-1);

            ucBookingAdmin.RebindBookingList += new EventHandler(ucBookingAdmin_RebindBookingList);

            UiHelper.ApplyMouseWheelScrollViewer(scrollViewerBookings);
        }