public void InitData() { string strWhere = " 1=1 "; HttpCookie cookie = Request.Cookies["qx"]; if (cookie != null) { qx = cookie.Values["qxid"].ToString(); } if (qx == "2") { string username = HttpUtility.UrlDecode(cookie.Values["user"].ToString(), Encoding.UTF8); strWhere = "username='******'"; } if (qx == "3" || qx == "4") { Response.Write("Error.aspx"); } int PageIndex = 1; if (Request.QueryString["page"] != null) { int.TryParse(Request.QueryString["page"].ToString(), out PageIndex); } int PageSize = 10; int TotalCount = 0; DataTable dt = H_ServiceClass.GetList(PageSize, PageIndex, strWhere, out TotalCount); this.Repeater1.DataSource = dt; this.Repeater1.DataBind(); this.LiteralPage.Text = PageClass.BuildPage(PageIndex, TotalCount, PageSize); }
public void InitData() { if (Request.QueryString["pid"] != null) { string pid = Request.QueryString["pid"].ToString(); Model.H_Service service = H_ServiceClass.GetModel(pid); this.TextName.Value = service.name; this.TextTeamViewerID.Value = service.TeamViewerID; this.TextTel.Value = service.telephone; this.TextZhifubao.Value = service.zhifubao; this.TextBank.Value = service.bank; this.TextBank_name.Value = service.bankname; this.TextBank_number.Value = service.banknumber; } }
protected void Button1_Click(object sender, EventArgs e) { Model.H_Service service = new Model.H_Service(); service.name = this.TextName.Value.Trim(); service.TeamViewerID = this.TextTeamViewerID.Value.Trim(); service.telephone = this.TextTel.Value.Trim(); service.zhifubao = this.TextZhifubao.Value.Trim(); service.bank = this.TextBank.Value.Trim(); service.bankname = this.TextBank_name.Value.Trim(); service.banknumber = this.TextBank_number.Value.Trim(); service.id = int.Parse(Request.QueryString["pid"]); if (H_ServiceClass.Update(service)) { //JScript.Alert("操作成功", "a2", this); JScript.AlertAndRedirect("操作成功!", "ServiceList.aspx", this); } else { JScript.Alert("操作失败", "a2", this); } }
protected void Button1_Click(object sender, EventArgs e) { Model.H_Service service = new Model.H_Service(); string strSql = "update H_User set isoccupy=1 where id=" + userid + ""; int count = DbHelperSQL.ExecuteSql(strSql); service.username = username; service.name = this.TextName.Value.Trim(); service.TeamViewerID = this.TextTeamViewerID.Value.Trim(); service.telephone = this.TextTel.Value.Trim(); service.zhifubao = this.TextZhifubao.Value.Trim(); service.bank = this.TextBank.Value.Trim(); service.bankname = this.TextBank_name.Value.Trim(); service.banknumber = this.TextBank_number.Value.Trim(); if (H_ServiceClass.Add(service) && count > 0) { JScript.Alert("操作成功!", "a2", this); } else { JScript.Alert("操作失败!", "a2", this); } }