protected void btnSearchHouse_Click(object sender, EventArgs e) { // Currently available search fields. int buildingTypeId = getIntValue(cboType.SelectedValue, -1); string postalCode = txtPostalCode.Text; int cityId = getIntValue(cboHouseCity.SelectedValue, -1); int bedrooms = getIntValue(cboBedrooms.SelectedValue, -1); double priceMin = -1; double priceMax = -1; // Currently non-available search fields. string street = string.Empty; string apartmentNo = string.Empty; int countryId = -1; string makingYear = string.Empty; int bathrooms = -1; double area = -1; string description = string.Empty; int sellerId = -1; HouseList houseList = new HouseList(buildingTypeId, street, apartmentNo, postalCode, cityId, countryId, makingYear, bathrooms, bedrooms, area, description, priceMin, priceMax, sellerId); displayHouses(houseList.AsDataSet()); return; }
public ActionResult Register(Registration registration) { try { db.Residents.Add(new Resident( registration.Name, registration.Password, registration.Email, registration.ResidenceType, registration.MobileNo, registration.HouseNo )); HouseList tempHouse = db.HouseLists.Single(house => house.HouseID == registration.HouseNo); tempHouse.HouseIsFree = "occupied"; db.SaveChanges(); //TempData["reg_status_res"] = "Registration Successful"; return(RedirectToAction("Login")); } catch (Exception e) { TempData["reg_status_res"] = "Something went wrong. " + e.Message; } return(View()); }
private void RefreshHouses(StreetDto street) { HouseList.Clear(); if (street == null) { return; } RequestService.GetHouses(street.Id, SelectedCompany?.Id).ToList().ForEach(h => HouseList.Add(h)); }
public async Task <HouseList> UpdateIsFreeHouse(int?id) { HouseList house = await _context.HouseList.FindAsync(id); house.IsFree = "Occupied"; await _context.SaveChangesAsync(); return(house); }
private void AddHouseList(HouseInformation houseInformation) { var houseInfosElementJson = HouseList.Add(); houseInfosElementJson.Date = houseInformation.Date.ToShortDateString(); houseInfosElementJson.Address = houseInformation.Number + ", " + houseInformation.Street + ", " + houseInformation.City + houseInformation.Country; houseInfosElementJson.Price = houseInformation.Price; houseInfosElementJson.Commission = houseInformation.Commission; }
private void ChangeStreet(int?streetId) { HouseList.Clear(); if (!streetId.HasValue) { return; } foreach (var house in _requestService.GetHouses(streetId.Value).OrderBy(s => s.Building?.PadLeft(6, '0')).ThenBy(s => s.Corpus?.PadLeft(6, '0'))) { HouseList.Add(house); } OnPropertyChanged(nameof(HouseList)); }
public JsonResult IsHouseFree(int HouseNo) { HouseList tempHouse = db.HouseLists.SingleOrDefault(h => h.HouseID == HouseNo); if (tempHouse.HouseIsFree == "free") { return(Json(true, JsonRequestBehavior.AllowGet)); } else { return(Json(false, JsonRequestBehavior.AllowGet)); } }
public async Task ChoseHouseAsync(int deck) { if (_gameContainer.CanSendMessage()) { await _gameContainer.Network !.SendAllAsync("chosehouse", deck); } HouseInfo thisHouse = CardsModule.GetHouseCard(deck); await _gameContainer.ShowCardAsync(thisHouse); _gameContainer.SingleInfo !.Hand.Add(thisHouse); _gameContainer.SaveRoot !.HouseList.Clear(); PopulatePlayerProcesses.FillInfo(_gameContainer.SingleInfo); //i think here too. _gameContainer.TakeOutExpense(thisHouse.HousePrice); _gameContainer.GameStatus = EnumWhatStatus.NeedToSpin; await _gameContainer.ContinueTurnAsync !.Invoke(); }
public async Task <IActionResult> PostHouse(HouseList item) { _log4net.Info("Post House Was Called !!"); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { var addHouse = await _context.PostHouse(item); return(Ok(addHouse)); } catch (Exception) { return(BadRequest()); } }
public static HouseList GetAll() { HouseList currentHouses = new HouseList(); if (System.IO.File.Exists(dataPath)) { using (var reader = new StreamReader(dataPath)) { XmlSerializer deserializer = new XmlSerializer(typeof(HouseList), new XmlRootAttribute("Houses_List")); currentHouses = (HouseList)deserializer.Deserialize(reader); } } else { SaveChanges(); } return(currentHouses); }
List <string> houseToStringListBH; //read-only public frmBrowseHouses() { InitializeComponent(); //for passing info between forms. List<string> holding ToString() is refreshed, List<House> isn't. houseListBH = frmAddHouse.houseListAH; houseToStringListBH = new List <string>(); //populating controls browsingIndex = houseListBH.IndexOfFirstUnaddedHouse(); PopulateControls(browsingIndex); browsingLimit = houseListBH.MasterListOfHouses.Count() - 1; txtAveragePrice.Text = string.Format("{0:c}", houseListBH.GetAskingAverage()); txtTotalPrice.Text = string.Format("{0:c}", houseListBH.GetAskingTotal()); //window placement this.Top = (Screen.PrimaryScreen.Bounds.Height - this.Height) / 2; //System.Windows.SystemParameters.VirtualScreenWidth; this.Left = 100 + Application.OpenForms[0].Width; }
public async Task <HouseList> PostHouse(HouseList item) { HouseList house = null; if (item == null) { throw new NullReferenceException(); } else { house = new HouseList() { HouseId = item.HouseId, IsFree = item.IsFree }; await _context.HouseList.AddAsync(house); await _context.SaveChangesAsync(); } return(house); }
public void OnResourceStart() { housedb = new DataBase("House.db", "resources\\shadowscity\\db\\"); if (housedb.isDataBase() == false) { API.consoleOutput("house database not found."); } else { API.requestIpl("apa_v_mp_h_08_c"); housedb.connectOpenToDataBase(); API.consoleOutput("house loading.."); DataBaseSdon[] hall = housedb.sqlCommandReturn("House", "", "ID", "Name", "Owner", "Price", "oX", "oY", "oZ", "iX", "iY", "iZ"); foreach (DataBaseSdon v in hall) { HouseList h = new HouseList(Convert.ToInt32(v.Get("ID")), v.Get("Name"), v.Get("Owner"), Convert.ToInt32(v.Get("Price")), Convert.ToSingle(v.Get("oX")), Convert.ToSingle(v.Get("oY")), Convert.ToSingle(v.Get("oZ")), Convert.ToSingle(v.Get("iX")), Convert.ToSingle(v.Get("iY")), Convert.ToSingle(v.Get("iZ"))); h_List.Add(h); } } }
private void EditAddress() { if (RequestId == 0) { return; } var model = new EditAddressOnRequestDialogViewModel(RequestId); var view = new EditAddressOnRequestDialog(); view.DataContext = model; view.Owner = Application.Current.MainWindow; model.SetView(view); if (view.ShowDialog() != true) { return; } SelectedCity = CityList.FirstOrDefault(c => c.Id == model.SelectedCity.Id); SelectedStreet = StreetList.FirstOrDefault(s => s.Id == model.SelectedStreet.Id); SelectedHouse = HouseList.FirstOrDefault(h => h.Id == model.SelectedHouse.Id); SelectedFlat = FlatList.FirstOrDefault(f => f.Id == model.SelectedFlat.Id); _requestService.RequestChangeAddress(RequestId, model.SelectedFlat.Id); }
public static MailInfo CreateMail(this WebBooking bookingInfo, string htmlTemplate, HouseList houseList, RoomTypeList roomTypeList) { var result = new MailInfo { Subject = "New Customer Reservation", IsBodyHtml = true, To = new[] { ConfigManager.ReservationEmail } }; var house = houseList?.Houses.SingleOrDefault(h => h.Id.Equals(bookingInfo.HouseId)); var roomType = roomTypeList?.RoomTypes.SingleOrDefault(r => r.Id.Equals(bookingInfo.RoomTypeId)); var body = htmlTemplate.Replace("{{fullName}}", bookingInfo.Fullname); body = body.Replace("{{gender}}", bookingInfo.IsMale ? "Male" : "Female"); body = body.Replace("{{email}}", bookingInfo.Email); body = body.Replace("{{phone}}", bookingInfo.Phone); body = body.Replace("{{houseName}}", house == null ? "[Not Specified]" : house.Name); body = body.Replace("{{roomType}}", roomType == null ? "[Not Specified]" :roomType.Name + " - " + roomType.Price + "$"); body = body.Replace("{{dateRange}}", bookingInfo.From.ToString("d") + " - " + bookingInfo.To.ToString("d")); body = body.Replace("{{numPersons}}", bookingInfo.NumberOfPersons.ToString()); body = body.Replace("{{numRooms}}", bookingInfo.NumberOfRooms.ToString()); result.Body = body; return(result); }
static void Main(string[] args) { IWebDriver driver = new ChromeDriver { Url = "https://portal.onehome.com/en-US/properties/map?token=eyJPU04iOiJZRVMtTUxTIiwidHlwZSI6IjEiLCJjb250YWN0aWQiOjE3MjQwMzgsInNldGlkIjoiMTAzNDkwNyIsInNldGtleSI6IjEzNCIsImVtYWlsIjoib21pa29sYWoxQGdtYWlsLmNvbSIsInJlc291cmNlaWQiOjAsImFnZW50aWQiOjM2MzIxMCwiaXNkZWx0YSI6ZmFsc2V9&searchId=e10abdb1-869b-3e1a-a413-cde27f0cdf10", }; driver.Manage().Window.Maximize(); Thread.Sleep(1000); var modal = Wait.WaitUntilElementVisible(By.ClassName("modal-content"), driver, 1000); if (modal != null) { var button = modal.FindElement(By.TagName("button")); button.Click(); } HouseList list = new HouseList(driver); var houses = list.Houses; for (int i = 0; i < houses.Count; i++) { PropertyInfo propertyInfo = new PropertyInfo(); try { try { var house = new HouseList(driver).Houses.ElementAt(i); OpenQA.Selenium.Interactions.Actions actions = new OpenQA.Selenium.Interactions.Actions(driver); actions.MoveToElement(house).Build().Perform(); IJavaScriptExecutor je = (IJavaScriptExecutor)driver; je.ExecuteScript("arguments[0].scrollIntoView(true);", house); house.Click(); } catch { var modal3 = Wait.WaitUntilElementVisible(By.ClassName("fsrInvite"), driver, 10); if (modal3 != null) { var button = modal3.FindElement(By.TagName("button")); button.Click(); } var house = new HouseList(driver).Houses.ElementAt(i); OpenQA.Selenium.Interactions.Actions actions = new OpenQA.Selenium.Interactions.Actions(driver); actions.MoveToElement(house).Build().Perform(); actions.MoveToElement(house).Build().Perform(); IJavaScriptExecutor je = (IJavaScriptExecutor)driver; je.ExecuteScript("arguments[0].scrollIntoView(true);", house); house.Click(); } var status = Wait.WaitUntilElementVisible(By.ClassName("heading"), driver); if (status != null) { if (status.Text == "For Sale") { string city = string.Empty; propertyInfo.Address = ExtractHouseAddress(driver, out city); Console.WriteLine($"Analyzing: {propertyInfo.Address}"); propertyInfo.ZipCode = int.Parse(propertyInfo.Address.Split('_').Last()); if (ExistsInDesiredNeighborhood(propertyInfo.ZipCode, city) == true) { propertyInfo.Price = ExtractHousePrice(driver); ExtractPropertyDetails(driver, ref propertyInfo); ExcelWorker worker = new ExcelWorker { PropertyInfo = propertyInfo }; worker.AnalyzeProperty(); } } } //driver.Navigate().Back(); } //catch (Exception ex) //{ // driver.Navigate().Back(); //} finally { driver.Navigate().Back(); } } }
//protected override async Task ShowHumanCanPlayAsync() //{ // await base.ShowHumanCanPlayAsync(); // if (BasicData.IsXamarinForms && (SaveRoot.GameStatus == EnumWhatStatus.NeedTradeSalary || SaveRoot.GameStatus == EnumWhatStatus.NeedStealTile)) // { // await UIPlatform.ShowMessageAsync("Trying to show human can continue"); // if (_gameContainer.SubmitPlayerCommand == null) // { // //UIPlatform.ShowError("Nobody set up the submit player command. Rethink"); // return; // } // _gameContainer.SubmitPlayerCommand.ReportCanExecuteChange(); //try this way. // //await Task.Delay(200); //try delay to fix second bug. // //await UIPlatform.ShowMessageAsync("Choose Player Or End Turn"); // //_gameContainer.Command.ManualReport(); // } //} async Task IMiscDataNM.MiscDataReceived(string status, string content) { switch (status) //can't do switch because we don't know what the cases are ahead of time. { //put in cases here. case "spin": SpinnerPositionData spin = await js.DeserializeObjectAsync <SpinnerPositionData>(content); await _spinnerProcesses.StartSpinningAsync(spin); return; case "gender": EnumGender gender = await js.DeserializeObjectAsync <EnumGender>(content); if (_gameContainer.SelectGenderAsync == null) { throw new BasicBlankException("Nobody is handling the selecting gender. Rethink"); } await _gameContainer.SelectGenderAsync.Invoke(gender); return; case "firstoption": EnumStart firsts = await js.DeserializeObjectAsync <EnumStart>(content); await _boardProcesses.OpeningOptionAsync(firsts); return; case "chosecareer": await _careerProcesses.ChoseCareerAsync(int.Parse(content)); return; case "purchasecarinsurance": await _boardProcesses.PurchaseCarInsuranceAsync(); return; case "purchasedstock": await _boardProcesses.PurchaseStockAsync(); return; case "tradedlifeforsalary": await _boardProcesses.Trade4TilesAsync(); //i think return; case "tradedsalary": await _tradeSalaryProcesses.TradedSalaryAsync(content); return; case "stole": await _stolenTileProcesses.TilesStolenAsync(content); return; case "purchasedhouseinsurance": await _boardProcesses.PurchaseHouseInsuranceAsync(); return; case "attendednightschool": await _boardProcesses.AttendNightSchoolAsync(); return; case "choseretirement": EnumFinal finals = await js.DeserializeObjectAsync <EnumFinal>(content); await _boardProcesses.RetirementAsync(finals); return; case "chosestock": await _chooseStockProcesses.ChoseStockAsync(int.Parse(content)); return; case "chosesalary": await _basicSalaryProcesses.ChoseSalaryAsync(int.Parse(content)); return; case "stockreturned": await _returnStockProcesses.StockReturnedAsync(int.Parse(content)); return; case "chosehouse": await _houseProcesses.ChoseHouseAsync(int.Parse(content)); return; case "willsellhouse": await _boardProcesses.SellHouseAsync(); return; case "twins": CustomBasicList <EnumGender> gList = await js.DeserializeObjectAsync <CustomBasicList <EnumGender> >(content); await _twinProcesses.GetTwinsAsync(gList); return; case "houselist": CustomBasicList <int> tempList = await js.DeserializeObjectAsync <CustomBasicList <int> >(content); SaveRoot !.HouseList.Clear(); tempList.ForEach(thisIndex => SaveRoot.HouseList.Add(CardsModule.GetHouseCard(thisIndex))); await ContinueTurnAsync(); return; default: throw new BasicBlankException($"Nothing for status {status} with the message of {content}"); } }