/// <summary> /// 获得数据列表 /// </summary> public List<Entity.AdminlogEntity> DataTableToList(DataTable dt) { List<Entity.AdminlogEntity> modelList = new List<Entity.AdminlogEntity>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Entity.AdminlogEntity model; for (int n = 0; n < rowsCount; n++) { model = new Entity.AdminlogEntity(); if (dt.Rows[n]["Adminlogid"].ToString() != "") { model.Adminlogid = int.Parse(dt.Rows[n]["Adminlogid"].ToString()); } model.Updatetitle = dt.Rows[n]["Updatetitle"].ToString(); if (dt.Rows[n]["Updatetime"].ToString() != "") { model.Updatetime = DateTime.Parse(dt.Rows[n]["Updatetime"].ToString()); } model.Updatetype = dt.Rows[n]["Updatetype"].ToString(); if (dt.Rows[n]["Uid"].ToString() != "") { model.Uid = int.Parse(dt.Rows[n]["Uid"].ToString()); } modelList.Add(model); } } return modelList; }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Entity.AdminlogEntity model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [OA_AdminLog]("); strSql.Append("Updatetitle,Updatetime,Updatetype,Uid)"); strSql.Append(" values ("); strSql.Append("@Updatetitle,@Updatetime,@Updatetype,@Uid)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@Updatetitle", SqlDbType.VarChar, 30), new SqlParameter("@Updatetime", SqlDbType.DateTime), new SqlParameter("@Updatetype", SqlDbType.VarChar, 50), new SqlParameter("@Uid", SqlDbType.Int, 4) }; parameters[0].Value = model.Updatetitle; parameters[1].Value = model.Updatetime; parameters[2].Value = model.Updatetype; parameters[3].Value = model.Uid; object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters); if (obj == null) { return(1); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 获得数据列表 /// </summary> public List <Entity.AdminlogEntity> DataTableToList(DataTable dt) { List <Entity.AdminlogEntity> modelList = new List <Entity.AdminlogEntity>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Entity.AdminlogEntity model; for (int n = 0; n < rowsCount; n++) { model = new Entity.AdminlogEntity(); if (dt.Rows[n]["Adminlogid"].ToString() != "") { model.Adminlogid = int.Parse(dt.Rows[n]["Adminlogid"].ToString()); } model.Updatetitle = dt.Rows[n]["Updatetitle"].ToString(); if (dt.Rows[n]["Updatetime"].ToString() != "") { model.Updatetime = DateTime.Parse(dt.Rows[n]["Updatetime"].ToString()); } model.Updatetype = dt.Rows[n]["Updatetype"].ToString(); if (dt.Rows[n]["Uid"].ToString() != "") { model.Uid = int.Parse(dt.Rows[n]["Uid"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 51aspx.com 提供下载 /// </summary> public void Update(Entity.AdminlogEntity model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update [OA_AdminLog] set "); strSql.Append("Updatetitle=@Updatetitle,"); strSql.Append("Updatetime=@Updatetime,"); strSql.Append("Updatetype=@Updatetype,"); strSql.Append("Uid=@Uid"); strSql.Append(" where Adminlogid=@Adminlogid "); SqlParameter[] parameters = { new SqlParameter("@Adminlogid", SqlDbType.Int, 4), new SqlParameter("@Updatetitle", SqlDbType.VarChar, 30), new SqlParameter("@Updatetime", SqlDbType.DateTime), new SqlParameter("@Updatetype", SqlDbType.VarChar, 50), new SqlParameter("@Uid", SqlDbType.Int, 4) }; parameters[0].Value = model.Adminlogid; parameters[1].Value = model.Updatetitle; parameters[2].Value = model.Updatetime; parameters[3].Value = model.Updatetype; parameters[4].Value = model.Uid; DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); }
public List <Entity.AdminlogEntity> getpage(int pageSize, int pageNum, out int count, string str) { string select, table, where, order; select = " *,(select uname FROM [OA_User] where uid=[OA_AdminLog].uid) as uname"; table = "[OA_AdminLog] "; StringBuilder sb = new StringBuilder(); sb.Append(" ( 1 = 1 ) " + str); where = sb.ToString(); order = "Adminlogid"; string sql = "exec Pagination @select, @table, @where, @orderField, @orderType, @pageSize, @pageNum "; SqlParameter[] paras = { new SqlParameter("@select", select), new SqlParameter("@table", table), new SqlParameter("@where", where), new SqlParameter("@orderField", order), new SqlParameter("@orderType", '1'), new SqlParameter("@pageSize", pageSize), new SqlParameter("@pageNum", pageNum) }; DataSet ds = DbHelperSQL.Query(sql, paras); count = Convert.ToInt32(ds.Tables[1].Rows[0][0]); List <Entity.AdminlogEntity> list = new List <Entity.AdminlogEntity>(); Entity.AdminlogEntity model; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { model = new Entity.AdminlogEntity(); if (ds.Tables[0].Rows[i]["Adminlogid"].ToString() != "") { model.Adminlogid = int.Parse(ds.Tables[0].Rows[i]["Adminlogid"].ToString()); } model.Updatetime = Convert.ToDateTime(ds.Tables[0].Rows[i]["Updatetime"].ToString()); model.Updatetitle = ds.Tables[0].Rows[i]["Updatetitle"].ToString(); model.Updatetype = ds.Tables[0].Rows[i]["Updatetype"].ToString(); model.Uid = Convert.ToInt32(ds.Tables[0].Rows[i]["Uid"].ToString()); model.Uname = ds.Tables[0].Rows[i]["Uname"].ToString(); list.Add(model); } return(list); }
//添加到管理员操作日志 void Adminlogadd(string name) { Entity.AdminlogEntity model = new Entity.AdminlogEntity(); model.Uid = UserId; model.Updatetitle = name; model.Updatetime = DateTime.Now; model.Updatetype = "删除用户"; int i = new JumbotOA.BLL.AdminlogBLL().Add(model); if (i > 0) FinalMessage("用户删除成功", "User_List.aspx", 0); else FinalMessage("用户删除失败", "User_List.aspx", 0); }
//添加管理员操作记录 void Addadminlog(string type) { Entity.AdminlogEntity model = new Entity.AdminlogEntity(); model.Uid = UserId; model.Updatetime = DateTime.Now; model.Updatetitle = this.txtUname.Text; model.Updatetype = type; int i = new JumbotOA.BLL.AdminlogBLL().Add(model); if (i > 0) FinalMessage("用户添加成功", "User_List.aspx", 0); else FinalMessage("用户添加失败", "User_List.aspx", 0); }
//往管理员日志添加数据 void Addadminlog(string title, string type) { Entity.AdminlogEntity model = new Entity.AdminlogEntity(); model.Uid = UserId; model.Updatetime = DateTime.Now; model.Updatetitle = title; model.Updatetype = type; int i = new JumbotOA.BLL.AdminlogBLL().Add(model); if (i > 0) { Response.Redirect("Success.aspx"); } }
//往管理员日志插入数据 void Addadminlog(string type) { Entity.AdminlogEntity model = new Entity.AdminlogEntity(); model.Uid = UserId; model.Updatetime = DateTime.Now; model.Updatetitle = this.txtUname.Text; model.Updatetype = type; int i = new JumbotOA.BLL.AdminlogBLL().Add(model); if (i > 0) { Response.Redirect("User_List.aspx"); } }
//往管理员日志插入数据 void Addadminlog(string type) { Entity.AdminlogEntity model = new Entity.AdminlogEntity(); model.Uid = UserId; model.Updatetime = DateTime.Now; model.Updatetitle = this.txtUname.Text; model.Updatetype = type; int i = new JumbotOA.BLL.AdminlogBLL().Add(model); if (i > 0) { FinalMessage("操作成功", "User_List.aspx", 0); } }
//添加到管理员操作日志 void Adminlogadd(string name) { Entity.AdminlogEntity model = new Entity.AdminlogEntity(); model.Uid = UserId; model.Updatetitle = name; model.Updatetime = DateTime.Now; model.Updatetype = "删除用户"; int i = new JumbotOA.BLL.AdminlogBLL().Add(model); if (i > 0) { FinalMessage("用户删除成功", "User_List.aspx", 0); } else { FinalMessage("用户删除失败", "User_List.aspx", 0); } }
void Adminlogadd(string name) { Entity.AdminlogEntity model = new Entity.AdminlogEntity(); model.Uid = UserId; model.Updatetitle = name; model.Updatetime = DateTime.Now; model.Updatetype = "删除班级"; int i = new Daiv_OA.BLL.AdminlogBLL().Add(model); if (i > 0) { FinalMessage("班级删除成功", "Grade_List.aspx?gid=" + gradeId, 0); } else { FinalMessage("班级删除失败", "Grade_List.aspx?gid=" + gradeId, 0); } }
void Adminlogadd(string name) { Entity.AdminlogEntity model = new Entity.AdminlogEntity(); model.Uid = UserId; model.Updatetitle = name; model.Updatetime = DateTime.Now; model.Updatetype = "删除设备"; int i = new Daiv_OA.BLL.AdminlogBLL().Add(model); if (i > 0) { FinalMessage("设备删除成功", "Mechanical_List.aspx", 0); } else { FinalMessage("设备删除失败", "Mechanical_List.aspx", 0); } }
void Adminlogadd(string name) { Entity.AdminlogEntity model = new Entity.AdminlogEntity(); model.Uid = UserId; model.Updatetitle = name; model.Updatetime = DateTime.Now; model.Updatetype = "删除学生"; int i = new Daiv_OA.BLL.AdminlogBLL().Add(model); if (i > 0) { FinalMessage("学生删除成功", "Student_List.aspx?cid=" + classId, 0); } else { FinalMessage("学生删除失败", "Student_List.aspx?cid=" + classId, 0); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Entity.AdminlogEntity GetEntity(int Adminlogid) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 Adminlogid,Updatetitle,Updatetime,Updatetype,Uid,(select uname FROM [OA_User] where uid=[OA_AdminLog].uid) as uname FROM [OA_AdminLog] "); strSql.Append(" where Adminlogid=@Adminlogid "); SqlParameter[] parameters = { new SqlParameter("@Adminlogid", SqlDbType.Int, 4) }; parameters[0].Value = Adminlogid; Entity.AdminlogEntity model = new Entity.AdminlogEntity(); DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["Adminlogid"].ToString() != "") { model.Adminlogid = int.Parse(ds.Tables[0].Rows[0]["Adminlogid"].ToString()); } model.Updatetitle = ds.Tables[0].Rows[0]["Updatetitle"].ToString(); if (ds.Tables[0].Rows[0]["Updatetime"].ToString() != "") { model.Updatetime = DateTime.Parse(ds.Tables[0].Rows[0]["Updatetime"].ToString()); } model.Updatetype = ds.Tables[0].Rows[0]["Updatetype"].ToString(); if (ds.Tables[0].Rows[0]["Uid"].ToString() != "") { model.Uid = int.Parse(ds.Tables[0].Rows[0]["Uid"].ToString()); } model.Uname = ds.Tables[0].Rows[0]["Uname"].ToString(); return(model); } else { return(null); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Entity.AdminlogEntity GetEntity(int Adminlogid) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 Adminlogid,Updatetitle,Updatetime,Updatetype,Uid,(select uname FROM [OA_User] where uid=[OA_AdminLog].uid) as uname FROM [OA_AdminLog] "); strSql.Append(" where Adminlogid=@Adminlogid "); SqlParameter[] parameters = { new SqlParameter("@Adminlogid", SqlDbType.Int,4)}; parameters[0].Value = Adminlogid; Entity.AdminlogEntity model = new Entity.AdminlogEntity(); DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["Adminlogid"].ToString() != "") { model.Adminlogid = int.Parse(ds.Tables[0].Rows[0]["Adminlogid"].ToString()); } model.Updatetitle = ds.Tables[0].Rows[0]["Updatetitle"].ToString(); if (ds.Tables[0].Rows[0]["Updatetime"].ToString() != "") { model.Updatetime = DateTime.Parse(ds.Tables[0].Rows[0]["Updatetime"].ToString()); } model.Updatetype = ds.Tables[0].Rows[0]["Updatetype"].ToString(); if (ds.Tables[0].Rows[0]["Uid"].ToString() != "") { model.Uid = int.Parse(ds.Tables[0].Rows[0]["Uid"].ToString()); } model.Uname = ds.Tables[0].Rows[0]["Uname"].ToString(); return model; } else { return null; } }
public List<Entity.AdminlogEntity> getpage(int pageSize, int pageNum, out int count, string str) { string select, table, where, order; select = " *,(select uname FROM [OA_User] where uid=[OA_AdminLog].uid) as uname"; table = "[OA_AdminLog] "; StringBuilder sb = new StringBuilder(); sb.Append(" ( 1 = 1 ) " + str); where = sb.ToString(); order = "Adminlogid"; string sql = "exec Pagination @select, @table, @where, @orderField, @orderType, @pageSize, @pageNum "; SqlParameter[] paras ={ new SqlParameter("@select", select), new SqlParameter("@table", table), new SqlParameter("@where", where), new SqlParameter("@orderField", order), new SqlParameter("@orderType", '1'), new SqlParameter("@pageSize", pageSize), new SqlParameter("@pageNum", pageNum) }; DataSet ds = DbHelperSQL.Query(sql, paras); count = Convert.ToInt32(ds.Tables[1].Rows[0][0]); List<Entity.AdminlogEntity> list = new List<Entity.AdminlogEntity>(); Entity.AdminlogEntity model; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { model = new Entity.AdminlogEntity(); if (ds.Tables[0].Rows[i]["Adminlogid"].ToString() != "") { model.Adminlogid = int.Parse(ds.Tables[0].Rows[i]["Adminlogid"].ToString()); } model.Updatetime = Convert.ToDateTime(ds.Tables[0].Rows[i]["Updatetime"].ToString()); model.Updatetitle = ds.Tables[0].Rows[i]["Updatetitle"].ToString(); model.Updatetype = ds.Tables[0].Rows[i]["Updatetype"].ToString(); model.Uid = Convert.ToInt32(ds.Tables[0].Rows[i]["Uid"].ToString()); model.Uname = ds.Tables[0].Rows[i]["Uname"].ToString(); list.Add(model); } return list; }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Entity.AdminlogEntity model) { return(dal.Add(model)); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Entity.AdminlogEntity model) { dal.Update(model); }