/// <summary>
 /// 得到一个对象实体,从缓存中
 /// </summary>
 public TDTK.PlatForm.MVC4.Model.Sys_OperateLog GetModelByCache(long LogID)
 {
     Sys_OperateLog sol = new Sys_OperateLog();
     sol.LogID = LogID;
     string CacheKey = "Sys_OperateLogModel-" + LogID;
     object objModel = Maticsoft.Common.DataCache.GetCache(CacheKey);
     if (objModel == null)
     {
         try
         {
             objModel = dal.GetModel(sol);
             if (objModel != null)
             {
                 int ModelCache = Maticsoft.Common.ConfigHelper.GetConfigInt("ModelCache");
                 Maticsoft.Common.DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero);
             }
         }
         catch { }
     }
     return (TDTK.PlatForm.MVC4.Model.Sys_OperateLog)objModel;
 }
예제 #2
0
 public Model.Sys_OperateLog DataRowToModel(DataRow row)
 {
     TDTK.PlatForm.MVC4.Model.Sys_OperateLog model = new TDTK.PlatForm.MVC4.Model.Sys_OperateLog();
     if (row != null)
     {
         if (row["LogID"] != null && row["LogID"].ToString() != "")
         {
             model.LogID = long.Parse(row["LogID"].ToString());
         }
         if (row["LogType"] != null)
         {
             model.LogType = row["LogType"].ToString();
         }
         if (row["RelationID"] != null)
         {
             model.RelationID = row["RelationID"].ToString();
         }
         if (row["OperateIP"] != null)
         {
             model.OperateIP = row["OperateIP"].ToString();
         }
         if (row["OperateDate"] != null && row["OperateDate"].ToString() != "")
         {
             model.OperateDate = DateTime.Parse(row["OperateDate"].ToString());
         }
         if (row["Operator"] != null)
         {
             model.Operator = row["Operator"].ToString();
         }
         if (row["OperateTable"] != null)
         {
             model.OperateTable = row["OperateTable"].ToString();
         }
         if (row["Remark"] != null)
         {
             model.Remark = row["Remark"].ToString();
         }
         if (row["SysCode"] != null)
         {
             model.SysCode = row["SysCode"].ToString();
         }
     }
     return model;
 }
예제 #3
0
        public Model.Sys_OperateLog GetModel(Model.Sys_OperateLog t)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 LogID,LogType,RelationID,OperateIP,OperateDate,Operator,OperateTable,Remark,SysCode from Sys_OperateLog ");
            strSql.Append(" where LogID=@LogID");
            SqlParameter[] parameters = {
					new SqlParameter("@LogID", SqlDbType.BigInt)
			};
            parameters[0].Value = t.LogID;

            TDTK.PlatForm.MVC4.Model.Sys_OperateLog model = new TDTK.PlatForm.MVC4.Model.Sys_OperateLog();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }
 public Sys_OperateLog GetModel(Sys_OperateLog t)
 {
     return dal.GetModel(t);
 }
 public bool Delete(Sys_OperateLog t)
 {
     return dal.Delete(t);
 }
 public bool Update(Sys_OperateLog t)
 {
     return dal.Update(t);
 }
 public int Add(Sys_OperateLog t)
 {
     return dal.Add(t);
 }
 public bool Exists(Sys_OperateLog t)
 {
     return dal.Exists(t);
 }