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);
        }
Beispiel #2
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);
        }
        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);
        }
Beispiel #4
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);
        }
        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 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);
        }