//public void BindFllor() //{ // DataSet dt= //} public override void SonLoad() { if (!IsPostBack) { if (Session["User"] != null) { hotelID = Request.QueryString["hid"]; BindMenu(); BindNav(); } //if (Request.Cookies["User"] != null) //{ // BindMenu(); // BindNav(); //} //else //{ // Response.Redirect("login.aspx"); //} } modelsi = bllsi.GetModel(hotelID); }
/// <summary> /// 验证方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { string url = Request.Url.ToString(); try { Thread t = new Thread(new ThreadStart(Bind)); Thread t1 = new Thread(new ThreadStart(Bind2)); t.Start(); t1.Start(); t.Join(); t1.Join(); } catch (Exception ex) { throw; } List <Model.shopInfo> listif = bllsi.GetModelList(""); if (listif.Count > 0) { modelsi = listif[0]; } var user = Session["User"]; if (user == null) { //Page.ClientScript.RegisterStartupScript(GetType(), "info", "<script>alert('您还没有登录!');window.location='/Admin/login.aspx';</script>"); Response.Write("<script>alert('您还没有登录!');window.location='/Admin/login.aspx';</*script>"); Response.End(); } else { UserNow = user as Model.AccountsUsers; } SonLoad(); }
/// <summary> /// 验证方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { SysModel = bllsys.GetModel(1); List <Model.shopInfo> listif = bllsi.GetModelList(""); if (listif.Count > 0) { modelsi = listif[0]; } if (Request.Cookies["User"] == null) { //Page.ClientScript.RegisterStartupScript(GetType(), "info", "<script>alert('您还没有登录!');window.location='/Admin/login.aspx';</script>"); Response.Write("<script>alert('您还没有登录!');window.location='/Admin/login.aspx';</script>"); Response.End(); } else { //Session["User"] = UserNow; string uid = Request.Cookies["User"].Value; UserNow = bllu.GetModel(uid); } SonLoad(); }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnsave_Click(object sender, EventArgs e) { Model.shopInfo fmInfo = new Model.shopInfo(); fmInfo.id = txtid.Value; fmInfo.shop_Name = txtName.Value; fmInfo.shop_LxMan = txtContactName.Value; fmInfo.Shop_Telphone = txtPhone.Value; fmInfo.Shop_chuanzen = txtFax.Value; fmInfo.Shop_City = sc.Value; fmInfo.Shop_Province = sp.Value; fmInfo.Shop_Address = txtAddress.Value; fmInfo.Shop_Area = sc1.Value; fmInfo.Shop_x = txtMapX.Value; fmInfo.Shop_y = txtMapY.Value; fmInfo.Shop_Remaker = Discription.Value; if (fmshop.Update(fmInfo)) { ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('保存成功!系统刷新后生效!');</script>"); } else { ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('保存失败!');</script>"); } }
private void Bind() { List <Model.shopInfo> shopmodel = fmshop.GetModelList(""); if (shopmodel.Count > 0) { string[] strs = Request.Form.GetValues("s_province"); string[] strs1 = Request.Form.GetValues("s_city"); string[] strs2 = Request.Form.GetValues("s_county"); Model.shopInfo modelinfo = shopmodel[0]; txtName.Value = modelinfo.shop_Name; txtContactName.Value = modelinfo.shop_LxMan; txtPhone.Value = modelinfo.Shop_Telphone; txtFax.Value = modelinfo.Shop_chuanzen; sc.Value = modelinfo.Shop_City; sp.Value = modelinfo.Shop_Province; sc1.Value = modelinfo.Shop_Area; txtAddress.Value = modelinfo.Shop_Address; txtMapX.Value = modelinfo.Shop_x; txtMapY.Value = modelinfo.Shop_y; Discription.Value = modelinfo.Shop_Remaker; txtid.Value = modelinfo.id.ToString(); } }