protected void saveBtn_Click(object sender, EventArgs e) { if (IsPostBack) { int intId = Int32.Parse(Request.QueryString["intId"]); Base sa = new Base(); String sql; string content1; content1 = content.Value; sql = "update JOLE_webSite set content = @content where Id =" + intId; String[,] ds = new String[1, 4]; ds[0, 0] = "@content"; //参数 ds[0, 1] = content1; //内容 ds[0, 2] = "2"; //类型 ds[0, 3] = "4000"; //大小 sa.ExecutePrem(sql, ds); showMessage("修改成功",Request.UrlReferrer.ToString()); } else { Response.Write("操作错误。"); Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Base re = new Base(); webName.Text = re.getSite(1); linkMan.Text = re.getSite(4); email.Text = re.getSite(5); telphone.Text = re.getSite(6); mobile.Text = re.getSite(7); fax.Value = re.getSite(8); bankName.Value = re.getSite(9); bankNumber.Value = re.getSite(10); address.Value = re.getSite(11); qq.Value = re.getSite(51); msn.Value = re.getSite(13); zhifubao.Value = re.getSite(14); webKeyword.Value = re.getSite(15); lawName.Value = re.getSite(16); icp.Value = re.getSite(2); webNum.Value = re.getSite(3); wangwang.Value = re.getSite(48); webPath.Value = WEBPATH; //dr.Clone; //rs.Close; } }
public void setInfo(int id,string str) { Base sd = new Base(); string sql = "update JOLE_webSite set content = @content where id = @id"; string [,] ds = new string[2,4]; ds[1, 0] = "@id"; ds[1, 1] = id.ToString(); ds[1, 2] = "1"; ds[1, 3] = "4"; ds[0, 0] = "@content"; //参数 ds[0, 1] = str; //内容 ds[0, 2] = "2"; //类型 ds[0, 3] = "4000"; //大小 sd.ExecutePrem(sql,ds); }
/// <summary> /// JOLE_webSite表操作 /// </summary> public string getSite(int id) { try { OleDbDataReader rs1 = new Base().Record1("select content from JOLE_webSite where id =" + id); if (rs1.Read()) { string str; str = rs1.GetValue(0).ToString(); rs1.Close(); return str; } else return "0"; } catch (NullReferenceException e) { Console.WriteLine(e.Message+"操作错误"); return "操作错误"; } finally { Console.WriteLine("清理"); } }