protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { stepCheck(); int houseId = (int)Session["houseId"]; GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == houseId select r; HOUSE_INFO house = result.FirstOrDefault(); string name = ""; string des = ""; if (house.houseName != null) { name = (string)house.houseName; initName(name); } if (house.houseDescription != null) { des = (string)house.houseDescription; initDes(des); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { stepCheck(); int houseId = (int)Session["houseId"]; GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == houseId select r; HOUSE_INFO house = result.FirstOrDefault(); string cellphone = ""; string weixin = ""; if (house.cellphone != null) { cellphone = (string)house.cellphone; this.cellphone.Text = cellphone; } if (house.weixin != null) { weixin = (string)house.weixin; this.weixin.Text = weixin; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Session["houseId"] = 3; int houseId = (int)Session["houseId"]; int customerId = (int)Session["customerId"]; GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == houseId select r; HOUSE_INFO house = result.FirstOrDefault(); houseName.Text = house.houseName; price.Text = house.price; province.Text = house.province; city.Text = house.city; startDate.Text = house.startDate; endDate.Text = house.endDate; string url = house.photo; string[] s = url.Split(new char[] { ';' }); Image1.ImageUrl = s[0]; string date = DateTime.Now.ToString("yyyy-MM-dd"); datenow.Text = date; var result1 = from r in lqdb.USER_PROFILE where r.userId == customerId select r; USER_PROFILE user = result1.FirstOrDefault(); name.Text = user.userName; Image2.ImageUrl = user.headImage; } }
protected void save_Click(object sender, EventArgs e) { int houseId = (int)Session["houseId"]; ArrayList al = new ArrayList(); string photo = ""; string headPhoto = ""; if (Session["fileList"] != null) { al = (ArrayList)Session["fileList"]; foreach (string photoPath in al) { photo += photoPath + ";"; } headPhoto = (string)al[0]; } GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == houseId select r; HOUSE_INFO house = result.FirstOrDefault(); house.photo = photo; house.headPhoto = headPhoto; lqdb.SubmitChanges(); nextStep(); Response.Redirect("~/housePublish6.aspx"); }
protected void Page_Load(object sender, EventArgs e) { //Session.Clear(); //addImage(); if (!IsPostBack) { stepCheck(); int houseId = (int)Session["houseId"]; GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == houseId select r; HOUSE_INFO house = result.FirstOrDefault(); Session["fileList"] = null; if (house.photo != null) { string[] photo = house.photo.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); ArrayList al = new ArrayList(); for (int i = 0; i < photo.Length; i++) { al.Add(photo[i]); } Session["fileList"] = al; } } addImage(); }
private void createNewHouseInfo() { GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); HOUSE_INFO houseInfo = new HOUSE_INFO(); lqdb.HOUSE_INFO.InsertOnSubmit(houseInfo); lqdb.SubmitChanges(); int id = houseInfo.houseId; Session["houseId"] = id; createNewRefInfo(id); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { stepCheck(); int houseId = (int)Session["houseId"]; GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == houseId select r; HOUSE_INFO house = result.FirstOrDefault(); int styleId = 0; int typeId = 0; int limitId = 0; int bedroomId = 0; int bedId = 0; int restroomId = 0; this.style.ClearSelection(); if (house.style != null) { styleId = (int)house.style; initStyle(styleId); } if (house.type != null) { typeId = (int)house.type; initType(typeId); } if (house.limit != null) { limitId = (int)house.limit; initLimit(limitId); } if (house.bedroom != null) { bedroomId = (int)house.bedroom; initBedroom(bedroomId); } if (house.bed != null) { bedId = (int)house.bed; initBed(bedId); } if (house.restroom != null) { restroomId = (int)house.restroom; initRestroom(restroomId); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { stepCheck(); int houseId = (int)Session["houseId"]; GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == houseId select r; HOUSE_INFO h = result.FirstOrDefault(); if (h.engage == 1) { this.engage.Checked = true; } if (h.brorrowCar == 1) { this.brorrowCar.Checked = true; } if (h.foodGuide == 1) { this.foodGuide.Checked = true; } if (h.shopGuide == 1) { this.shopGuide.Checked = true; } if (h.spotGuide == 1) { this.spotGuide.Checked = true; } if (h.foodMake == 1) { this.foodMake.Checked = true; } if (h.ticket == 1) { this.ticket.Checked = true; } if (h.translate == 1) { this.translate.Checked = true; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { stepCheck(); int houseId = (int)Session["houseId"]; GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == houseId select r; HOUSE_INFO house = result.FirstOrDefault(); string _province = ""; string _city = ""; string _street = ""; string _postCode = ""; string _department = ""; if (house.province != null) { _province = (string)house.province; initProvince(_province); } if (house.city != null) { _city = (string)house.city; initCity(_city); } if (house.street != null) { _street = (string)house.street; initStreet(_street); } if (house.postCode != null) { _postCode = (string)house.postCode; initPostCode(_postCode); } if (house.department != null) { _department = (string)house.department; initDepartment(_department); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { stepCheck(); HyperLink1.NavigateUrl = "~/housePublish1.aspx"; int houseId = (int)Session["houseId"]; GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == houseId select r; HOUSE_INFO house = result.FirstOrDefault(); string price = ""; if (house.price != null) { price = (string)house.houseName; this.price.Text = price; } } }
public static string getLocation() { HttpContext.Current.Session["userId"] = 2; int userId = (int)HttpContext.Current.Session["userId"]; GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.COLLECCTION where r.userId == userId select r; string json = "{\"location\":["; foreach (COLLECCTION c in result) { var resultHouse = from h in lqdb.HOUSE_INFO where h.houseId == c.houseId select h; HOUSE_INFO house = resultHouse.FirstOrDefault(); json = json + "{\"lng\":\"" + house.lng + "\",\"lat\":\"" + house.lat + "\",\"name\":\"" + house.houseName + "\",\"price\":\"" + house.price + "\"},"; } json = json.Substring(0, json.Length - 1); json = json + "]}"; return(json); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { stepCheck(); int houseId = (int)Session["houseId"]; GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == houseId select r; HOUSE_INFO h = result.FirstOrDefault(); if (h.must == 1) { this.must.Checked = true; } if (h.TV == 1) { this.TV.Checked = true; } if (h.airCondition == 1) { this.airCondition.Checked = true; } if (h.kiction == 1) { this.kiction.Checked = true; } if (h.network == 1) { this.net.Checked = true; } if (h.wifi == 1) { this.wifi.Checked = true; } if (h.time == 1) { this.time.Checked = true; } if (h.bath == 1) { this.bath.Checked = true; } if (h.wash == 1) { this.wash.Checked = true; } if (h.swimmingPool == 1) { this.swimmingPool.Checked = true; } if (h.breakfast == 1) { this.breakfast.Checked = true; } if (h.carPark == 1) { this.carPark.Checked = true; } if (h.workout == 1) { this.workout.Checked = true; } if (h.lift == 1) { this.lift.Checked = true; } if (h.guard == 1) { this.guard.Checked = true; } if (h.children == 1) { this.children.Checked = true; } if (h.smoke == 1) { this.smoke.Checked = true; } if (h.pet == 1) { this.pet.Checked = true; } if (h.disable == 1) { this.disable.Checked = true; } if (h.party == 1) { this.party.Checked = true; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { stepCheck(); int houseId = (int)Session["houseId"]; GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == houseId select r; HOUSE_INFO h = result.FirstOrDefault(); if (h.smokeAlert == 1) { this.smokeAlert.Checked = true; } if (h.coAlert == 1) { this.coAlert.Checked = true; } if (h.aid == 1) { this.aid.Checked = true; } if (h.aidCard == 1) { this.aidCard.Checked = true; } if (h.fire == 1) { this.fire.Checked = true; } string fireLocation = ""; string fireAlertLocation = ""; string coEnd = ""; string exitLocation = ""; string aidCall = ""; string fireCall = ""; string policeCall = ""; if (h.fireLocation != null) { fireLocation = (string)h.houseName; this.fireLocation.Text = fireLocation; } if (h.fireAlertLocation != null) { fireAlertLocation = (string)h.fireAlertLocation; this.fireAlertLocation.Text = fireAlertLocation; } if (h.coEnd != null) { coEnd = (string)h.coEnd; this.coEnd.Text = coEnd; } if (h.exitLocation != null) { exitLocation = (string)h.exitLocation; this.exitLocation.Text = exitLocation; } if (h.aidCall != null) { aidCall = (string)h.aidCall; this.aidCall.Text = aidCall; } if (h.fireCall != null) { fireCall = (string)h.fireCall; this.fireCall.Text = fireCall; } if (h.policeCall != null) { policeCall = (string)h.policeCall; this.policeCall.Text = policeCall; } } }