/// <summary> /// 得到一个对象实体,从缓存中 /// </summary> public TDTK.PlatForm.MVC4.Model.TT_NavicertLog GetModelByCache(long LogID) { TT_NavicertLog nl = new TT_NavicertLog(); nl.LogID = LogID; string CacheKey = "TT_NavicertLogModel-" + LogID; object objModel = Maticsoft.Common.DataCache.GetCache(CacheKey); if (objModel == null) { try { objModel = dal.GetModel(nl); 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.TT_NavicertLog)objModel; }
public TT_NavicertLog GetModel(TT_NavicertLog t) { return dal.GetModel(t); }
public bool Delete(TT_NavicertLog t) { return dal.Exists(t); }
public bool Update(TT_NavicertLog t) { return dal.Exists(t); }
public int Add(TT_NavicertLog t) { return dal.Add(t); }
public Model.TT_NavicertLog DataRowToModel(DataRow row) { TDTK.PlatForm.MVC4.Model.TT_NavicertLog model = new TDTK.PlatForm.MVC4.Model.TT_NavicertLog(); if (row != null) { if (row["LogID"] != null && row["LogID"].ToString() != "") { model.LogID = long.Parse(row["LogID"].ToString()); } if (row["NavicertCode"] != null) { model.NavicertCode = row["NavicertCode"].ToString(); } if (row["BeforeState"] != null) { model.BeforeState = row["BeforeState"].ToString(); } if (row["AfterState"] != null) { model.AfterState = row["AfterState"].ToString(); } if (row["Event"] != null) { model.Event = row["Event"].ToString(); } if (row["Remark"] != null) { model.Remark = row["Remark"].ToString(); } if (row["Operator"] != null) { model.Operator = row["Operator"].ToString(); } if (row["OperateDate"] != null && row["OperateDate"].ToString() != "") { model.OperateDate = DateTime.Parse(row["OperateDate"].ToString()); } } return model; }
public Model.TT_NavicertLog GetModel(Model.TT_NavicertLog t) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 LogID,NavicertCode,BeforeState,AfterState,Event,Remark,Operator,OperateDate from TT_NavicertLog "); strSql.Append(" where LogID=@LogID"); SqlParameter[] parameters = { new SqlParameter("@LogID", SqlDbType.BigInt) }; parameters[0].Value = t.LogID; TDTK.PlatForm.MVC4.Model.TT_NavicertLog model = new TDTK.PlatForm.MVC4.Model.TT_NavicertLog(); DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return DataRowToModel(ds.Tables[0].Rows[0]); } else { return null; } }