private void GetLoginLog() { Bll_AdminLog BAdmin_Log = new Bll_AdminLog(); DataSet ds = BAdmin_Log.GetList(2, " Model='AdminLogin' and UserID=" + AdminManage.AdminID + " ", " AddDate desc "); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 1) { //获取第二个 LastLoginTime = DateTime.Parse(ds.Tables[0].Rows[1]["AddDate"].ToString()).ToString("yyyy-MM-dd hh:mm:ss"); LastLoginIP = ds.Tables[0].Rows[1]["UserIP"].ToString(); } }
/// <summary> /// 管理员操作写入日志 /// </summary> public static void SetAdminLog(string Model, int AdminID, string AdminName, string IP, string Content) { Bll_AdminLog BAdmin_Log = new Bll_AdminLog(); Mod_AdminLog MAdmin_Log = new Mod_AdminLog(); MAdmin_Log.Model = Model; MAdmin_Log.UserID = AdminID; MAdmin_Log.UserName = AdminName; MAdmin_Log.UserIP = IP; MAdmin_Log.Content = Content; MAdmin_Log.AddDate = DateTime.Now; BAdmin_Log.Add(MAdmin_Log); }