Esempio n. 1
0
        private void EditDepartmentButtonClick(object sender, EventArgs e)
        {
            if (NoFoundRegionText.Visible)
            {
                MessageBox.Show("Редактирование невозможно, нет региона");
                return;
            }

            RegionResultText.Hide();
            RegionText.Hide();
            DepartmentResultText.Hide();
            DepartmentText.Hide();
            MainDepartmentResultText.Hide();
            MainDepartmentText.Hide();
            SelectRegionField.Show();
            SelectRegionText.Show();
        }
Esempio n. 2
0
        //Fill out the property details form
        internal void AddPropertyDetails()
        {
            // Populating the data from Excel
            ExcelLib.PopulateInCollection(Base.ExcelPath, "Property Details");

            PropertyTypeDropdownButton.Click();
            Driver.driver.FindElement(By.XPath("//div[@class='item'][contains(text(),'Short-Term Rental')]")).Click();

            // Navigating to Property Details using value from Excel
            PropertyNameText.SendKeys(ExcelLib.ReadData(2, "Property Name"));
            NumberText.SendKeys(ExcelLib.ReadData(2, "Number"));
            StreetText.SendKeys(ExcelLib.ReadData(2, "Street"));
            DescriptionText.SendKeys(ExcelLib.ReadData(2, "Description"));
            CityText.SendKeys(ExcelLib.ReadData(2, "City"));
            PostCodeText.SendKeys(ExcelLib.ReadData(2, "PostCode"));
            RegionText.SendKeys(ExcelLib.ReadData(2, "Region"));
            YearBuiltText.SendKeys(ExcelLib.ReadData(2, "Year Built"));
            TargetRentText.SendKeys(ExcelLib.ReadData(2, "Target Rent"));
            BedroomsText.SendKeys(ExcelLib.ReadData(2, "Bedrooms"));
            BathroomsText.SendKeys(ExcelLib.ReadData(2, "Bathrooms"));
            CarparksText.SendKeys(ExcelLib.ReadData(2, "Carparks"));

            UploadFileButton.SendKeys(ExcelLib.ReadData(2, "Choose Files"));
        }
Esempio n. 3
0
        private void InitFields()
        {
            var context     = new PSOConnect();
            var coordinator = context.coordinator.FirstOrDefault(coord => coord.idTeam == Login.CurrentUser.idTeam);

            var departments = from region in context.region
                              join department in context.department on region.idDepartment equals department.idDepartment
                              join mainDepartment in context.mainDepartment on department.idMainDepartment equals mainDepartment.idMainDepartment
                              select new
            {
                Id                    = region.idRegion,
                AddressRegion         = region.address,
                AddressDepartment     = department.address,
                AddressMainDepartment = mainDepartment.address
            };

            foreach (var dep in departments)
            {
                SelectRegionField.Items.Add($"{dep.Id}-АДРЕС РЕГИОНА: {dep.AddressRegion} АДРЕС ДЕПАРТАМЕНТА: {dep.AddressDepartment} АДРЕС ГЛАВНОГО ДЕПАРТАМЕНТА: {dep.AddressMainDepartment}");

                if (coordinator.idRegion == null || coordinator.idRegion != dep.Id)
                {
                    continue;
                }

                SelectRegionField.SelectedItem = SelectRegionField.Items[SelectRegionField.Items.Count - 1];

                RegionResultText.Text         = dep.AddressRegion;
                DepartmentResultText.Text     = dep.AddressDepartment;
                MainDepartmentResultText.Text = dep.AddressMainDepartment;
            }

            NoFoundRegionText.Hide();

            if (coordinator.idRegion == null)
            {
                RegionResultText.Hide();
                RegionText.Hide();
                DepartmentResultText.Hide();
                DepartmentText.Hide();
                MainDepartmentResultText.Hide();
                MainDepartmentText.Hide();
                SelectRegionField.Show();
                SelectRegionText.Show();

                if (SelectRegionField.Items.Count > 0)
                {
                    SelectRegionField.SelectedIndex = 0;
                }
                else
                {
                    SelectRegionField.Hide();
                    NoFoundRegionText.Show();
                }
            }
            else
            {
                RegionResultText.Show();
                RegionText.Show();
                DepartmentResultText.Show();
                DepartmentText.Show();
                MainDepartmentResultText.Show();
                MainDepartmentText.Show();
                SelectRegionField.Hide();
                SelectRegionText.Hide();
            }

            if (SelectRegionField.Items.Count == 0)
            {
                SelectRegionField.Hide();
                NoFoundRegionText.Show();
            }
        }