protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //验证是否登录状态 try { if (!(Session["UserId"] != null && Session["UserName"] != null && Session["roule"] != null)) { Response.Redirect("Default.aspx"); } } catch (Exception ex) { } SystemMgr.BLL.Common data = new SystemMgr.BLL.Common(); string id = Session["UserId"].ToString(); SqlDataReader dr = SystemMgr.BLL.Common.GetDataReader("select * from Users where id=" + id); dr.Read(); txtname.Text = dr["UserName"].ToString(); XingMing.Text = dr["XingMing"].ToString(); Age.Text = dr["Age"].ToString(); txtds.Text = dr["Ds"].ToString(); txtemal.Text = dr["emal"].ToString(); XueXiao.Text = dr["XueXiao"].ToString(); pic.Text = dr["Photo"].ToString(); Image1.ImageUrl = "files/" + dr["Photo"].ToString(); Tel.Text = dr["Tel"].ToString(); } }
protected void Button1_Click(object sender, EventArgs e) { SystemMgr.BLL.Common data = new SystemMgr.BLL.Common(); bool b = SystemMgr.BLL.Common.RunSqlBool("insert into Topic(Topic,AddUser,Content)values('" + tb_title.Text + "','" + Session["UserName"].ToString() + "','" + ArticleContent.Value + "')"); Alert js = new Alert(); js.Alertjs("发布成功"); Response.Redirect("BBS.aspx"); }
public DataSet GetCodeBy(int iCount) { SystemMgr.BLL.Common date = new SystemMgr.BLL.Common(); string strTop = ""; if (iCount > 1) { strTop = "top " + iCount.ToString(); } string sql = "select " + strTop + " * from [FileInfo]"; return(SystemMgr.BLL.Common.GetDs(sql, "fileinfo")); }
public DataSet GetCodeBy(int iCount) { SystemMgr.BLL.Common date = new SystemMgr.BLL.Common(); string strTop = ""; if (iCount > 1) { strTop = "top " + iCount.ToString(); } string sql = "select " + strTop + " a.*,c.Xingming as stuName,d.Xingming as TeaName from [DoWorkList] a left join WorkInfo b on a.WorkID=b.ID left join Users c on a.UserID=c.ID left join Users d on b.UserID=d.ID where b.userid=" + hf_uid.Value + " order by a.addtime desc"; return(SystemMgr.BLL.Common.GetDs(sql, "workinfo")); }
public DataSet GetCodeBy(int iCount) { SystemMgr.BLL.Common date = new SystemMgr.BLL.Common(); string strTop = ""; if (iCount > 1) { strTop = "top " + iCount.ToString(); } string sql = "select " + strTop + " * from [WorkInfo] where userid=" + hf_uid.Value + " order by addtime desc"; return(SystemMgr.BLL.Common.GetDs(sql, "workinfo")); }
public DataSet GetCodeBy(int iCount) { SystemMgr.BLL.Common date = new SystemMgr.BLL.Common(); string strTop = ""; if (iCount > 1) { strTop = "top " + iCount.ToString(); } string sql = "select " + strTop + " * from [News] where typeid='" + DropDownList1.SelectedValue + "' "; DataSet ds = SystemMgr.BLL.Common.GetDs(sql, "news"); return(ds); }
//删除信息记录 protected void gvInfo_RowDeleting(object sender, GridViewDeleteEventArgs e) { SystemMgr.BLL.Common mydata = new SystemMgr.BLL.Common(); string ID = gvInfo.DataKeys[e.RowIndex].Values[0].ToString(); try { bool b = SystemMgr.BLL.Common.RunSqlBool("delete from News where id='" + ID + "'"); Label4.Text = "删除成功!"; gvInfo.EditIndex = -1; Get_Info(); } catch { Label4.Text = "删除失败!"; } }
}/// <summary> /// 修改密码 /// </summary> private void UPpwd() { SystemMgr.BLL.Common mydata = new SystemMgr.BLL.Common(); string Username = Session["UserId"].ToString(); try { string sql = "update [Users] set [pwd] ='" + txtpwd2.Text.ToString() + "' where [id]='" + Username + "' "; bool b = SystemMgr.BLL.Common.RunSqlBool(sql); LabelWarningMessage.Text = "修改成功!"; } catch { LabelWarningMessage.Text = "修改失败!"; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SystemMgr.BLL.Common data = new SystemMgr.BLL.Common(); string id = Request.QueryString["id"].ToString(); SqlDataReader dr = SystemMgr.BLL.Common.GetDataReader("select * from Users where id=" + id); dr.Read(); txtname.Text = dr["UserName"].ToString(); XingMing.Text = dr["XingMing"].ToString(); Age.Text = dr["Age"].ToString(); txtds.Text = dr["Ds"].ToString(); txtemal.Text = dr["emal"].ToString(); XueXiao.Text = dr["XueXiao"].ToString(); pic.Text = dr["Photo"].ToString(); Image1.ImageUrl = "../files/" + dr["Photo"].ToString(); Tel.Text = dr["Tel"].ToString(); } }
//加载数据方法 public DataSet GetCodeBy(int iCount) { SystemMgr.BLL.Common date = new SystemMgr.BLL.Common(); string strTop = ""; if (iCount > 1) { strTop = "top " + iCount.ToString(); } lab_allcount.Text = "0"; string sql = "select " + strTop + " * from [News] where typeid='" + DropDownList1.SelectedValue + "' and [name] like '%" + keyword.Text.Trim() + "%' order by addtime desc"; SqlConnection con = SystemMgr.BLL.Common.getConnection(); SqlCommand cmd = new SqlCommand(sql, con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = null; try { con.Open(); ds = new DataSet(); da.Fill(ds); lab_allcount.Text = ds.Tables[0].Rows.Count.ToString(); } catch (SqlException ex) { throw ex; } catch (Exception ex) { throw ex; } finally { con.Close(); } return(ds); }
public DataSet GetCodeBy(int iCount) { SystemMgr.BLL.Common date = new SystemMgr.BLL.Common(); string strTop = ""; if (iCount > 1) { strTop = "top " + iCount.ToString(); } string sql = "select " + strTop + " * from [Admin] "; SqlConnection con = SystemMgr.BLL.Common.getConnection(); SqlCommand cmd = new SqlCommand(sql, con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = null; try { con.Open(); ds = new DataSet(); da.Fill(ds); } catch (SqlException ex) { throw ex; } catch (Exception ex) { throw ex; } finally { con.Close(); } return(ds); }
public DataSet GetCodeBy(int iCount) { SystemMgr.BLL.Common date = new SystemMgr.BLL.Common(); string strTop = ""; if (iCount > 1) { strTop = "top " + iCount.ToString(); } //string sql = "select * from [FileInfo] where TitleName like '%" + keyword.Text.Trim() + "%' order by addtime desc"; string sql = "select " + strTop + " a.id,a.filetype,a.fileid,a.userid,a.sendMessage,a.sendtime,u.username,b.TitleName from SendMessage a left join FileInfo b on a.fileid=b.id left join users u on a.userid=u.id where a.filetype=" + hf_filetype.Value + " and (u.username like '%" + keyword.Text.Trim() + "%' or b.TitleName like '%" + keyword.Text.Trim() + "%') order by a.sendtime desc"; SqlConnection con = SystemMgr.BLL.Common.getConnection(); SqlCommand cmd = new SqlCommand(sql, con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = null; try { con.Open(); ds = new DataSet(); da.Fill(ds); } catch (SqlException ex) { throw ex; } catch (Exception ex) { throw ex; } finally { con.Close(); } return(ds); }
public DataSet GetCodeBy(int iCount) { SystemMgr.BLL.Common date = new SystemMgr.BLL.Common(); string strTop = ""; if (iCount > 1) { strTop = "top " + iCount.ToString(); } string sql = "select " + strTop + " * from [Video] where VideoName like '%" + keyword.Text.Trim() + "%' order by addtime desc"; SqlConnection con = SystemMgr.BLL.Common.getConnection(); SqlCommand cmd = new SqlCommand(sql, con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = null; try { con.Open(); ds = new DataSet(); da.Fill(ds); } catch (SqlException ex) { throw ex; } catch (Exception ex) { throw ex; } finally { con.Close(); } return(ds); }
public DataSet GetCodeBy(int iCount) { SystemMgr.BLL.Common date = new SystemMgr.BLL.Common(); string strTop = ""; if (iCount > 1) { strTop = "top " + iCount.ToString(); } string sql = "select " + strTop + " a.*,c.Xingming as stuName,d.Xingming as TeaName from [DoWorkList] a left join WorkInfo b on a.WorkID=b.ID left join Users c on a.UserID=c.ID left join Users d on b.UserID=d.ID where b.userid=" + hf_uid.Value + " order by a.addtime desc"; SqlConnection con = SystemMgr.BLL.Common.getConnection(); SqlCommand cmd = new SqlCommand(sql, con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = null; try { con.Open(); ds = new DataSet(); da.Fill(ds); } catch (SqlException ex) { throw ex; } catch (Exception ex) { throw ex; } finally { con.Close(); } return(ds); }