protected void Button1_Click(object sender, EventArgs e) { LVWEIBA.BLL.MemberHotel bllhotel = new LVWEIBA.BLL.MemberHotel(); MemberHotel memberHotel = bllhotel.GetModel(getHotelId()); memberHotel.Name = hotelname.Text; memberHotel.Card = card.Text; memberHotel.Mobile = Mobile.Text; memberHotel.Type = hotelType.SelectedValue; if (bllhotel.Update(memberHotel)) { refreshInfo(); Response.Write(String.Format("<script>alert('信息修改成功');window.location='hotel.aspx';</script>")); } }
protected void addContactPerson_Click(object sender, EventArgs e) { LVWEIBA.BLL.MemberHotel bllhotel = new LVWEIBA.BLL.MemberHotel(); System.Collections.Specialized.NameValueCollection nc = new System.Collections.Specialized.NameValueCollection(Request.Form); MemberHotel m = new MemberHotel(); m.Member = member; m.Mobile = nc.GetValues("mobile")[0].ToString(); m.Name = nc.GetValues("userName")[0].ToString(); m.Card = nc.GetValues("identityCard")[0].ToString(); m.Sj = DateTime.Now; m.Type = "0"; int id = bllhotel.GetMaxId(); if (bllhotel.Add(m) > 0) { string strhotel = string.Format(" <input id='Checkbox1' name='hotel' checked class='hotel' type='checkbox' value='{0}' />{1}", id, m.Name); contactPersonsLiteral.Text += strhotel; } }
protected void refreshInfo() { LVWEIBA.BLL.MemberHotel bllhotel = new LVWEIBA.BLL.MemberHotel(); MemberHotel memberHotel = bllhotel.GetModel(getHotelId()); hotelname.Text = memberHotel.Name; card.Text = memberHotel.Card; Mobile.Text = memberHotel.Mobile; hotelType.Items.Clear(); if (memberHotel.Type.Equals("0")) { hotelType.Items.Add(new ListItem("成人", "0")); hotelType.Items.Add(new ListItem("儿童", "1")); } if (memberHotel.Type.Equals("1")) { hotelType.Items.Add(new ListItem("儿童", "1")); hotelType.Items.Add(new ListItem("成人", "0")); } }
protected void Button1_Click(object sender, EventArgs e) { LVWEIBA.BLL.MemberHotel bllhotel = new LVWEIBA.BLL.MemberHotel(); System.Collections.Specialized.NameValueCollection nc = new System.Collections.Specialized.NameValueCollection(Request.Form); MemberHotel m = new MemberHotel(); m.Member = member; m.Mobile = nc.GetValues("Mobile")[0].ToString(); m.Name = nc.GetValues("hotelname")[0].ToString(); m.Card = nc.GetValues("card")[0].ToString(); m.Type = nc.GetValues("type")[0].ToString(); m.Sj = DateTime.Now; int id = bllhotel.GetMaxId(); if (bllhotel.Add(m) > 0) { string strhotel = string.Format("<li id='{0}'>{1}<span>{2}</span><i class='iconfont' id='{3}'></i></li>", m.Id, m.Name, m.Card, m.Id); Literal1.Text += strhotel; } }