protected void Page_Load(object sender, EventArgs e) { string phone = Request.QueryString["phone"]; string pass = Request.QueryString["password"]; string lat = Request.QueryString["lat"]; string lng = Request.QueryString["lng"]; string houseId = Request.QueryString["houseId"]; if (check(phone, pass)) { int id = Convert.ToInt32(houseId); GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == id select r; foreach (HOUSE_INFO h in result) { h.lat = Convert.ToDecimal(lat); h.lng = Convert.ToDecimal(lng);; } lqdb.SubmitChanges(); Response.Write("yes"); Response.End(); } else { Response.Write("no"); Response.End(); } }
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 next3_Click(object sender, EventArgs e) { double a = (double)Session["log"]; double b = (double)Session["lat"]; int houseId = (int)Session["houseId"]; string province = this.province.Text.ToString(); string city = this.city.Text.ToString(); string postCode = this.postCode.Text.ToString(); string street = this.street.Text.ToString(); string department = this.department.Text.ToString(); GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == houseId select r; foreach (HOUSE_INFO h in result) { h.department = department; h.postCode = postCode; h.province = province; h.city = city; h.street = street; h.lat = (decimal)b; h.lng = (decimal)a; } lqdb.SubmitChanges(); nextStep(); Response.Redirect("~/housePublish4.aspx"); }
protected void next8_Click(object sender, EventArgs e) { int houseId = (int)Session["houseId"]; string start = this.datetimepickerStart.Value.ToString(); string end = this.datetimepickerStop.Value.ToString(); if ((start == null) || (end == null) || (string.Compare(start, end) > 0)) { Response.Write("<script>alert('时间输入有误')</script>"); } else { GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == houseId select r; foreach (HOUSE_INFO h in result) { h.startDate = start; h.endDate = end; } lqdb.SubmitChanges(); nextStep(); Response.Redirect("~/housePublish9.aspx"); } }
protected void Button2_Click(object sender, EventArgs e) { int houseId = (int)Session["houseId"]; int customerId = (int)Session["customerId"]; string content = comment.Text.ToString(); GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.COMMENT where r.houseId == houseId select r; COMMENT com = new COMMENT(); com.houseId = houseId; com.commentContent = content; com.commentId = customerId; string pis = getHeadPicById(customerId); com.photo = pis; string date = DateTime.Now.ToString(); com.commentDate = date; lqdb.COMMENT.InsertOnSubmit(com); lqdb.SubmitChanges(); Response.Write("<script>alert('评论已经成功提交')</script>"); Response.Redirect("~/historyOrder.aspx"); }
protected void next_Click(object sender, EventArgs e) { int houseId = (int)Session["houseId"]; int style = getStyle(); int type = getType(); int limit = getLimit(); int bedroom = getBedroom(); int bed = getBed(); int restroom = getRestroom(); GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == houseId select r; foreach (HOUSE_INFO h in result) { h.style = style; h.type = type; h.limit = limit; h.bedroom = bedroom; h.bed = bed; h.restroom = restroom; } lqdb.SubmitChanges(); nextStep(); Response.Redirect("~/housePublish2.aspx"); }
protected void next5_Click(object sender, EventArgs e) { int houseId = (int)Session["houseId"]; int smokeAlert = 0; int coAlert = 0; int aid = 0; int aidCard = 0; int fire = 0; if (this.smokeAlert.Checked == true) { smokeAlert = 1; } if (this.coAlert.Checked == true) { coAlert = 1; } if (this.aid.Checked == true) { aid = 1; } if (this.aidCard.Checked == true) { aidCard = 1; } if (this.fire.Checked == true) { fire = 1; } string fireLocation = this.fireLocation.Text.ToString(); string fireAlertLocation = this.fireAlertLocation.Text.ToString(); string coEnd = this.coEnd.Text.ToString(); string exitLocation = this.exitLocation.Text.ToString(); string aidCall = this.aidCall.Text.ToString(); string fireCall = this.fireCall.Text.ToString(); string policeCall = this.policeCall.Text.ToString(); GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == houseId select r; foreach (HOUSE_INFO h in result) { h.smokeAlert = smokeAlert; h.coAlert = coAlert; h.aid = aid; h.aidCard = aidCard; h.fire = fire; h.fireLocation = fireLocation; h.fireAlertLocation = fireAlertLocation; h.coEnd = coEnd; h.exitLocation = exitLocation; h.aidCall = aidCall; h.fireCall = fireCall; h.policeCall = policeCall; } lqdb.SubmitChanges(); nextStep(); Response.Redirect("~/Service.aspx"); }
protected void save_Click(object sender, EventArgs e) { string name = Request.Form["name"].ToString(); string gender = Request.Form["gender"].ToString(); //string female = Request.Form["female"].ToString(); string phone = Request.Form["phone"].ToString(); string place = Request.Form["place"].ToString(); string description = Request.Form["description"].ToString(); string school = Request.Form["school"].ToString(); string work = Request.Form["work"].ToString(); string email = Request.Form["email"].ToString(); GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); //USER_PROFILE userProfile = new USER_PROFILE(); int id = (int)Session["ID"]; //int id = 10; var result = from r in lqdb.USER_PROFILE where r.userId == id select r; foreach (USER_PROFILE userProfile in result) { userProfile.gender = Convert.ToInt32(gender); userProfile.userName = name; userProfile.email = email; userProfile.phone = phone; userProfile.description = description; } lqdb.SubmitChanges(); Response.Redirect("~/Default.aspx"); }
private void addUserProfile(int id) { GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); USER_PROFILE userProfile = new USER_PROFILE(); userProfile.userId = id; lqdb.USER_PROFILE.InsertOnSubmit(userProfile); lqdb.SubmitChanges(); }
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 Button1_Click(object sender, EventArgs e) { Button button = (Button)sender; int _collectionId = Convert.ToInt32(button.CommandArgument.ToString()); GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.COLLECCTION where r.collectionId == _collectionId select r; lqdb.COLLECCTION.DeleteAllOnSubmit(result); lqdb.SubmitChanges(); dataBind(); }
private void SaveImage(String path) { int userId = (int)Session["userId"]; GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.USER_PROFILE where r.userId == userId select r; foreach (USER_PROFILE user in result) { user.headImage = path; } lqdb.SubmitChanges(); }
protected void Button1_Click(object sender, EventArgs e) { Button button = (Button)sender; int _orderId = Convert.ToInt32(button.CommandArgument.ToString()); int command = Convert.ToInt32(button.CommandName.ToString()); GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_ORDER where r.orderId == _orderId select r; if (command == 1) { foreach (HOUSE_ORDER h in result) { h.state = 2; h.stateNameCustomer = "已付款"; h.stateHintCustomer = "完成"; h.stateHintHost = "完成"; h.stateNameHost = "已付款"; h.isShowHost = 1; } } else if (command == 2) { foreach (HOUSE_ORDER h in result) { h.state = 3; h.stateHintCustomer = ""; h.stateNameCustomer = "等待对方完成"; h.isShowCustomer = 0; } } else if (command == 4) { foreach (HOUSE_ORDER h in result) { h.state = 5; h.stateHintCustomer = ""; h.stateNameCustomer = "已完成"; h.isShowCustomer = 0; h.stateHintHost = ""; h.stateNameHost = "已完成"; h.isShowHost = 0; h.customerCheck = 1; } } lqdb.SubmitChanges(); dataBind(); }
private void createNewRefInfo(int id) { GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); REF_USER_HOUSEINFO REF = new REF_USER_HOUSEINFO(); int userId = (int)Session["ID"]; //int userId = 1; REF.houseId = id; REF.userId = userId; REF.step = 1; Session["step"] = 1; REF.state = 0; lqdb.REF_USER_HOUSEINFO.InsertOnSubmit(REF); lqdb.SubmitChanges(); }
protected void next6_Click(object sender, EventArgs e) { int houseId = (int)Session["houseId"]; string price = this.price.Text.ToString().Trim(); GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == houseId select r; foreach (HOUSE_INFO h in result) { h.price = price; } lqdb.SubmitChanges(); nextStep(); Response.Redirect("~/housePublish7.aspx"); }
private bool addUser(string _phone, string _repassword) { GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); if (findIdByPhone(_phone) == false) { return(false); } else { USER user = new USER(); user.phone = _phone; user.password = _repassword; lqdb.USER.InsertOnSubmit(user); lqdb.SubmitChanges(); return(true); } }
protected void finish_Click(object sender, EventArgs e) { int houseId = (int)Session["houseId"]; string cellphone = this.cellphone.Text.ToString(); string weixin = this.weixin.Text.ToString(); GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == houseId select r; foreach (HOUSE_INFO h in result) { h.cellphone = cellphone; h.weixin = weixin; } lqdb.SubmitChanges(); nextStep(); Response.Redirect("~/Default.aspx"); }
protected void next2_Click1(object sender, EventArgs e) { int houseId = (int)Session["houseId"]; string name = getName(); string des = getDes(); GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == houseId select r; foreach (HOUSE_INFO h in result) { h.houseName = name; h.houseDescription = des; } lqdb.SubmitChanges(); nextStep(); Response.Redirect("~/housePublish3.aspx"); }
private void nextStep() { int houseId = (int)Session["houseId"]; GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.REF_USER_HOUSEINFO where r.houseId == houseId select r; foreach (REF_USER_HOUSEINFO ruf in result) { if (ruf.state == 0) { ruf.step = 7; Session["step"] = 7; break; } } lqdb.SubmitChanges(); }
protected void nextService_Click(object sender, EventArgs e) { int houseId = (int)Session["houseId"]; int engage = 0; int brorrowCar = 0; int foodGuide = 0; int shopGuide = 0; int spotGuide = 0; int ticket = 0; int foodMake = 0; int translate = 0; if (this.engage.Checked == true) { engage = 1; } if (this.brorrowCar.Checked == true) { brorrowCar = 1; } if (this.foodGuide.Checked == true) { foodGuide = 1; } if (this.shopGuide.Checked == true) { shopGuide = 1; } if (this.spotGuide.Checked == true) { spotGuide = 1; } if (this.ticket.Checked == true) { ticket = 1; } if (this.foodMake.Checked == true) { foodMake = 1; } if (this.translate.Checked == true) { translate = 1; GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == houseId select r; foreach (HOUSE_INFO h in result) { h.engage = engage; h.brorrowCar = brorrowCar; h.foodGuide = foodGuide; h.spotGuide = spotGuide; h.shopGuide = shopGuide; h.ticket = ticket; h.translate = translate; h.foodMake = foodMake; } lqdb.SubmitChanges(); nextStep(); Response.Redirect("~/iamge.aspx"); } }
protected void next4_Click(object sender, EventArgs e) { int houseId = (int)Session["houseId"]; int must = 0; int airCondition = 0; int tv = 0; int kiction = 0; int network = 0; int wifi = 0; int time = 0; int bath = 0; int wash = 0; int swimmingPool = 0; int breakfast = 0; int carPark = 0; int workout = 0; int lift = 0; int guard = 0; int children = 0; int smoke = 0; int pet = 0; int disable = 0; int party = 0; if (this.must.Checked == true) { must = 1; } if (this.TV.Checked == true) { tv = 1; } if (this.airCondition.Checked == true) { airCondition = 1; } if (this.kiction.Checked == true) { kiction = 1; } if (this.net.Checked == true) { network = 1; } if (this.wifi.Checked == true) { wifi = 1; } if (this.time.Checked == true) { time = 1; } if (this.bath.Checked == true) { bath = 1; } if (this.wash.Checked == true) { wash = 1; } if (this.swimmingPool.Checked == true) { swimmingPool = 1; } if (this.breakfast.Checked == true) { breakfast = 1; } if (this.carPark.Checked == true) { carPark = 1; } if (this.workout.Checked == true) { workout = 1; } if (this.lift.Checked == true) { lift = 1; } if (this.guard.Checked == true) { guard = 1; } if (this.children.Checked == true) { children = 1; } if (this.smoke.Checked == true) { smoke = 1; } if (this.pet.Checked == true) { pet = 1; } if (this.disable.Checked == true) { disable = 1; } if (this.party.Checked == true) { party = 1; } GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString()); var result = from r in lqdb.HOUSE_INFO where r.houseId == houseId select r; foreach (HOUSE_INFO h in result) { h.must = must; h.TV = tv; h.kiction = kiction; h.network = network; h.airCondition = airCondition; h.wifi = wifi; h.time = time; h.bath = bath; h.wash = wash; h.swimmingPool = swimmingPool; h.breakfast = breakfast; h.carPark = carPark; h.workout = workout; h.lift = lift; h.guard = guard; h.children = children; h.smoke = smoke; h.disable = disable; h.pet = pet; h.party = party; } lqdb.SubmitChanges(); nextStep(); Response.Redirect("~/housePublish5.aspx"); }