コード例 #1
0
        void btnSave_Click(object sender, RoutedEventArgs e)
        {
            Globals.IsBusy = true;
            List <RoleComponentPermission> saveList = ucContextComponentTree.GetSaveList();

            DataServiceHelper.SaveRoleComponentPermissionAsync(saveList, SaveRoleComponentPermissionCompleted);
        }
コード例 #2
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);
        }
コード例 #3
0
        void btnSaveRoomEquipment_Click(object sender, RoutedEventArgs e)
        {
            List <RoomEquipment> saveList = (List <RoomEquipment>)gvwRoomEquipment.ItemsSource;

            //Get delete items :
            foreach (RoomEquipment oldItem in _currentRoomEquipments)
            {
                bool isDeleted = true;
                foreach (RoomEquipment saveItem in saveList)
                {
                    if (saveItem.RoomEquipmentId == oldItem.RoomEquipmentId)
                    {
                        isDeleted = false;
                        break;
                    }
                }
                if (isDeleted)
                {
                    oldItem.IsDeleted = true;
                    saveList.Add(oldItem);
                }
            }
            Globals.IsBusy = true;
            DataServiceHelper.SaveRoomEquipmentAsync(saveList, SaveRoomEquipmentCompleted);
        }
コード例 #4
0
        public void Save()
        {
            List <BookingRoomEquipmentDetail> saveList = (List <BookingRoomEquipmentDetail>)gvwEquipmentDetails.ItemsSource;

            saveList = saveList.Where(i => i.IsChanged == true).ToList();
            //Get delete items :
            foreach (BookingRoomEquipmentDetail oldItem in _originalList)
            {
                bool isDeleted = true;
                foreach (BookingRoomEquipmentDetail saveItem in saveList)
                {
                    if (saveItem.BookingRoomEquipmentDetailId == oldItem.BookingRoomEquipmentDetailId)
                    {
                        isDeleted = false;
                        break;
                    }
                }
                if (isDeleted)
                {
                    oldItem.IsDeleted = true;
                    saveList.Add(oldItem);
                }
            }

            DataServiceHelper.SaveBookingRoomEquipmentDetailAsync(saveList, SaveBookingEquipmentDetailCompleted);
        }
コード例 #5
0
 public void RebindData()
 {
     if (this.BookingEquipmentId > 0)
     {
         DataServiceHelper.ListBookingRoomEquipmentAsync(this.BookingEquipmentId, null, null, ListBookingRoomEquipmentCompleted);
     }
 }
コード例 #6
0
 void ListSiteGroupCompleted(List <SiteGroup> siteGroupList)
 {
     siteGroupList.Insert(0, new SiteGroup());
     _siteGroup = siteGroupList;
     DataServiceHelper.ListAspUserAsync(Globals.UserLogin.UserOrganisationId, null, false, ListAllAspUserCompleted);
     //DataServiceHelper.ListSiteGroupSiteAsync(null, null, ListSiteGroupSiteCompleted);
 }
コード例 #7
0
        void ListUserRoleAuthCompleted(List <UserRoleAuth> userRoleAuthList)
        {
            uiUserRoleAuthList.Items.Clear();
            //userRoleAuthList = (from u in userRoleAuthList
            //                    join role in _aspRoles on u.RoleId equals role.RoleId
            //                    select u).ToList();
            userRoleAuthList = userRoleAuthList.Take(_nbrItemsShowed).ToList();

            foreach (UserRoleAuth dataItem in userRoleAuthList)
            {
                OneUserRoleAuth control = new OneUserRoleAuth();
                control.UserRoleAuthData = dataItem;
                control.AspRoles         = _aspRoles;
                control.AspUsers         = _aspUsers;
                control.SiteGroups       = _siteGroup;
                control.IsUserView       = true;
                control.RebindCombobox();
                control.DeleteButtonClicked += new EventHandler(control_DeleteButtonClicked);
                uiUserRoleAuthList.Items.Add(control);
            }

            _roleComponentItemSource.Clear();
            var roleList = (from i in userRoleAuthList
                            select i.RoleId).Distinct();

            _roleCount = roleList.Count();
            foreach (Guid roleId in roleList)
            {
                DataServiceHelper.ListRoleComponentPermissionAsync(roleId, null, ListRoleComponentCompleted);
            }

            Globals.IsBusy = false;
        }
コード例 #8
0
 void uiSubmitButton_Click(object sender, RoutedEventArgs e)
 {
     if (Validate())
     {
         DataServiceHelper.ChangePasswordAsync(uiPassword.Password, uiNewPassword.Password, ChangePasswordCompleted);
     }
 }
コード例 #9
0
 public void RebindData()
 {
     if (this.BookingServiceId > 0)
     {
         DataServiceHelper.ListBookingRoomServiceAsync(this.BookingServiceId, null, null, ListBookingRoomServiceCompleted);
     }
 }
コード例 #10
0
        void btnSaveBookingService_Click(object sender, RoutedEventArgs e)
        {
            List <BookingRoomService> saveList = (List <BookingRoomService>)gvwBookingService.ItemsSource;

            //Get delete items :
            foreach (BookingRoomService oldItem in _currentBookingServices)
            {
                bool isDeleted = true;
                foreach (BookingRoomService saveItem in saveList)
                {
                    if (saveItem.BookingRoomServiceId == oldItem.BookingRoomServiceId)
                    {
                        isDeleted = false;
                        break;
                    }
                }
                if (isDeleted)
                {
                    oldItem.IsDeleted = true;
                    saveList.Add(oldItem);
                }
            }
            Globals.IsBusy = true;
            DataServiceHelper.SaveBookingRoomServiceAsync(saveList, SaveBookingServiceCompleted);
        }
コード例 #11
0
 void RebindUserList()
 {
     if (uiRoles.SelectedValue != null)
     {
         Guid roleId = (Guid)uiRoles.SelectedValue;
         DataServiceHelper.ListUserRoleAuthAsync(Globals.UserLogin.UserOrganisationId, null, roleId, ListUserRoleAuthCompleted);
     }
 }
コード例 #12
0
 public void RebindData()
 {
     Globals.IsBusy = true;
     _currentOrgId  = Globals.UserLogin.UserOrganisationId;
     ResetControlStatus();
     ucInformation.InfoMessage = ResourceHelper.GetReourceValue("UserAccount_NewRecord");
     DataServiceHelper.ListSiteGroupAsync(Globals.UserLogin.UserOrganisationId, null, ListSiteGroupCompleted);
 }
コード例 #13
0
 private void RebindBookingData()
 {
     if (_seletedCustomerId > 0)
     {
         Globals.IsBusy = true;
         DataServiceHelper.ListBookingAsync(Globals.UserLogin.UserOrganisationId, null, null, null, null, null, _seletedCustomerId, null, null, null, ListBookingCompleted);
     }
 }
コード例 #14
0
 void btnOK_Click(object sender, RoutedEventArgs e)
 {
     if (ucBookingNew.CheckValidation())
     {
         Booking newBooking = ucBookingNew.GetSavedBooking();
         DataServiceHelper.CheckExistBookingdAsync(newBooking.RoomId, newBooking.ContractDateStart.Value, newBooking.ContractDateEnd.Value, CheckExistBookingdCompleted);
     }
 }
コード例 #15
0
 void ListBookingRoomServiceCompleted(List <BookingRoomService> Services)
 {
     if (Services != null && Services.Count > 0)
     {
         _bookingRoomServiceItem = Services[0];
         DataServiceHelper.ListBookingRoomServiceDetailAsync(null, this.BookingServiceId, null, null, null, ListBookingRoomServiceDetailCompleted);
     }
 }
コード例 #16
0
 public void RebindData(int orgId)
 {
     Globals.IsBusy = true;
     _currentOrgId  = orgId;
     ResetControlStatus();
     ucInformation.InfoMessage = ResourceHelper.GetReourceValue("UserAccount_NewRecord");
     DataServiceHelper.ListOrgAdminAspUserAsync(orgId, SecurityHelper.OrganisationAdministratorRoleId, ListAllAspUserCompleted);
 }
コード例 #17
0
 void ListBookingRoomEquipmentCompleted(List <BookingRoomEquipment> equipments)
 {
     if (equipments != null && equipments.Count > 0)
     {
         _bookingRoomEquipmentItem = equipments[0];
         DataServiceHelper.ListBookingRoomEquipmentDetailAsync(null, this.BookingEquipmentId, null, null, null, ListBookingRoomEquipmentDetailCompleted);
     }
 }
コード例 #18
0
        void uiCountry_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int countryId = Convert.ToInt32(uiCountry.SelectedValue);

            if (countryId > 0 && this.ContactTypeId == (int)ContactType.Site)
            {
                DataServiceHelper.ListCityAsync(countryId, null, ListCityCompleted);
            }
        }
コード例 #19
0
 public ContactInformationPanel()
 {
     InitializeComponent();
     FillLanguage();
     btnSaveContact.Click += new RoutedEventHandler(btnSaveContact_Click);
     DataServiceHelper.ListCountryAsync(null, ListCountryCompleted);
     uiCountry.SelectionChanged += new SelectionChangedEventHandler(uiCountry_SelectionChanged);
     cbbCity.SelectionChanged   += new SelectionChangedEventHandler(cbbCity_SelectionChanged);
 }
コード例 #20
0
        public void TestDefaultCtor()
        {
            // set up
            var layerList = DataServiceHelper.GetInitialLayerList();
            var page      = new AddLayerPopupPage(layerList.First());

            // check
            Assert.IsNotNull(page.Content, "page content must have been set");
        }
コード例 #21
0
        void cbbCity_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int cityId = Convert.ToInt32(cbbCity.SelectedValue);

            if (cityId > 0 && this.ContactTypeId == (int)ContactType.Site)
            {
                DataServiceHelper.ListDistrictAsync(cityId, null, ListDistrictCompleted);
            }
        }
コード例 #22
0
 void RebindRoleComponentData()
 {
     if (uiRoles.SelectedValue != null)
     {
         Globals.IsBusy = true;
         Guid roleId = (Guid)uiRoles.SelectedValue;
         DataServiceHelper.ListRoleComponentPermissionAsync(roleId, null, ListRoleComponentCompleted);
     }
 }
コード例 #23
0
        void ucSitePicker_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (ucSitePicker.SiteId > 0)
            {
                string roomStatusId = ((int)RoomStatus.Available).ToString();

                DataServiceHelper.ListRoomAsync(Globals.UserLogin.UserOrganisationId, ucSitePicker.SiteId, null, null,
                                                roomStatusId, null, null, false, ListRoomCompleted);
            }
        }
コード例 #24
0
 void RebindUserRoleAuthList()
 {
     _deleteList.Clear();
     if (uiUsers.SelectedValue != null && Guid.Parse(uiUsers.SelectedValue.ToString()) != Guid.Empty)
     {
         Globals.IsBusy = true;
         Guid userId = Guid.Parse(uiUsers.SelectedValue.ToString());
         DataServiceHelper.ListUserRoleAuthAsync(Globals.UserLogin.UserOrganisationId, userId, null, ListUserRoleAuthCompleted);
     }
 }
コード例 #25
0
        private void RebindBookingServices()
        {
            Booking selectedBooking = gvwBooking.SelectedItem as Booking;

            if (selectedBooking != null && selectedBooking.RoomId > 0)
            {
                Globals.IsBusy = true;
                DataServiceHelper.ListRoomServiceAsync(null, selectedBooking.RoomId, ListRoomServiceCompleted);
            }
        }
コード例 #26
0
        public void TestDefaultCtor()
        {
            // set up
            var layerList = DataServiceHelper.GetInitialLayerList();
            var page      = new LayerDetailsPage(layerList.First());

            // check
            Assert.IsTrue(page.Title.Length > 0, "page title must have been set");
            Assert.IsNotNull(page.Content, "page content must have been set");
        }
コード例 #27
0
        private void RebindRoomServices()
        {
            Room selectedRoom = gvwRoom.SelectedItem as Room;

            if (selectedRoom != null && selectedRoom.RoomId > 0)
            {
                Globals.IsBusy = true;
                DataServiceHelper.ListRoomServiceAsync(null, selectedRoom.RoomId, ListRoomServiceCompleted);
            }
        }
コード例 #28
0
        void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (chkChangePasswordQuestionAnswer.IsChecked == true &&
                (string.IsNullOrEmpty(txtPasswordQuestion.Text) || string.IsNullOrEmpty(txtPasswordAnswer.Text)))
            {
                MessageBox.Show(ResourceHelper.GetReourceValue("UserAccount_QuestionPasswordEmpty"), ResourceHelper.GetReourceValue("Common_ValidationError"), MessageBoxButton.OK);
                return;
            }

            if (uiUsers.SelectedValue != null && (Guid)uiUsers.SelectedValue != Guid.Empty)//Means update user
            {
                Guid    userId  = (Guid)uiUsers.SelectedValue;
                AspUser aspUser = _aspUsers.FirstOrDefault(i => i.UserId == userId);
                if (aspUser != null)
                {
                    Globals.IsBusy = true;
                    aspUser        = GetSaveAspUser(aspUser);
                    DataServiceHelper.SaveAspUserAsync(aspUser, SaveAspUserCompleted);
                }
                if (chkChangePasswordQuestionAnswer.IsChecked == true &&
                    string.IsNullOrEmpty(txtInputPassword.Password))
                {
                    MessageBox.Show(ResourceHelper.GetReourceValue("UserAccount_.InputPasswordEmpty"), ResourceHelper.GetReourceValue("Common_ValidationError"), MessageBoxButton.OK);
                    return;
                }
            }
            else//means create new user
            {
                if (string.IsNullOrEmpty(uiUsers.Text) || string.IsNullOrEmpty(txtPassword.Password))
                {
                    MessageBox.Show(ResourceHelper.GetReourceValue("UserAccount_.UserPasswordEmpty"), ResourceHelper.GetReourceValue("Common_ValidationError"), MessageBoxButton.OK);
                    return;
                }
                AspUser newUser = new AspUser();
                newUser.OrganisationId = Globals.UserLogin.UserOrganisationId;
                newUser.UserName       = uiUsers.Text;
                newUser.Password       = txtPassword.Password;
                newUser = GetSaveAspUser(newUser);
                if (_currentOrgId > 0)
                {
                    newUser.OrganisationId = _currentOrgId;
                }
                if (string.IsNullOrEmpty(newUser.PasswordQuestion))
                {
                    newUser.PasswordQuestion = ResourceHelper.GetReourceValue("UserAccount_DefaultPasswordQuestion");
                }
                if (string.IsNullOrEmpty(newUser.PasswordAnswer))
                {
                    newUser.PasswordAnswer = ResourceHelper.GetReourceValue("UserAccount_DefaultPasswordAnswer");
                }
                Globals.IsBusy = true;
                DataServiceHelper.SaveAspUserAsync(newUser, CreateAspUserCompleted);
            }
        }
コード例 #29
0
        void btnSaveBooking_Click(object sender, RoutedEventArgs e)
        {
            if (gvwBooking.SelectedItem != null)
            {
                _selectedBookingId = ((Booking)gvwBooking.SelectedItem).BookingId;
            }
            List <Booking> oldList  = (List <Booking>)gvwBooking.ItemsSource;
            List <Booking> saveList = oldList.Where(d => (d.IsChanged || d.NullableRecordId == null)).ToList();

            Globals.IsBusy = true;
            DataServiceHelper.SaveBookingAsync(saveList, SaveBookingCompleted);
        }
コード例 #30
0
        void btnSaveRoom_Click(object sender, RoutedEventArgs e)
        {
            if (gvwRoom.SelectedItem != null)
            {
                _selectedRoomId = ((Room)gvwRoom.SelectedItem).RoomId;
            }
            List <Room> oldList  = (List <Room>)gvwRoom.ItemsSource;
            List <Room> saveList = oldList.Where(d => (d.IsChanged || d.NullableRecordId == null)).ToList();

            Globals.IsBusy = true;
            DataServiceHelper.SaveRoomAsync(saveList, SaveRoomCompleted);
        }