using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data; using Stone.Entity; using Gm_WMS.DataAccess.DataService; namespace Stone.WinBiz.BasicData { public class F_Log : F_Base { public F_Log() { this.type = "Log"; this.name = "系统管理_日志查询"; this.entity = new Entity_t_Sys_Log(); this.dateWhere = "[AddTime]>='{0}' and [AddTime]<='{1}'"; } public override void BindPageData(string strWhere, int rows1, int rows2) { string strOrder = "id desc"; if (entityView == null) entityView = entity; dsMain = entityView.GetDataLimit(rows1, rows2, "", strWhere, strOrder); dsMain.Tables[0].TableName = "Data"; dsMain.Tables.Add(entityView.GetData("count(*) as AllCount", strWhere, "AllCount asc").Tables[0].Copy()); dsMain.Tables[1].TableName = "Page"; dsMain.Tables.Add(entity.Table.Copy()); dsMain.Tables[2].TableName = "Table"; } public override void GetView(DataGridView dgv) { base.GetView(dgv); dgv.Columns["UserName"].HeaderText = "操作员"; dgv.Columns["Message"].HeaderText = "日志内容"; dgv.Columns["AddTime"].HeaderText = "操作时间"; } public static void WriteLog(string Message) { Entity_t_Sys_Log t_Sys_Log = new Entity_t_Sys_Log(); DataRow drLog = t_Sys_Log.Table.NewRow(); drLog["UserName"] = User.UserInfo.UserName; drLog["Message"] = Message; t_Sys_Log.Add(drLog); } } }