/// <summary> /// 得到一个对象实体,从缓存中 /// </summary> public TDTK.PlatForm.MVC4.Model.SYS_ReceiveMessage2012 GetModelByCache(int RMID) { SYS_ReceiveMessage2012 srm = new SYS_ReceiveMessage2012(); srm.RMID = RMID; string CacheKey = "SYS_ReceiveMessage2012Model-" + RMID; object objModel = Maticsoft.Common.DataCache.GetCache(CacheKey); if (objModel == null) { try { objModel = dal.GetModel(srm); 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_ReceiveMessage2012)objModel; }
public Model.SYS_ReceiveMessage2012 DataRowToModel(System.Data.DataRow row) { TDTK.PlatForm.MVC4.Model.SYS_ReceiveMessage2012 model = new TDTK.PlatForm.MVC4.Model.SYS_ReceiveMessage2012(); if (row != null) { if (row["RMID"] != null && row["RMID"].ToString() != "") { model.RMID = int.Parse(row["RMID"].ToString()); } if (row["PhoneNumber"] != null) { model.PhoneNumber = row["PhoneNumber"].ToString(); } if (row["MContent"] != null) { model.MContent = row["MContent"].ToString(); } if (row["ReceiveDate"] != null && row["ReceiveDate"].ToString() != "") { model.ReceiveDate = DateTime.Parse(row["ReceiveDate"].ToString()); } } return model; }
public Model.SYS_ReceiveMessage2012 GetModel(Model.SYS_ReceiveMessage2012 t) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 RMID,PhoneNumber,MContent,ReceiveDate from SYS_ReceiveMessage2012 "); strSql.Append(" where RMID=@RMID"); SqlParameter[] parameters = { new SqlParameter("@RMID", SqlDbType.Int,4) }; parameters[0].Value = t.RMID; TDTK.PlatForm.MVC4.Model.SYS_ReceiveMessage2012 model = new TDTK.PlatForm.MVC4.Model.SYS_ReceiveMessage2012(); 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_ReceiveMessage2012 GetModel(SYS_ReceiveMessage2012 t) { return dal.GetModel(t); }
public bool Delete(SYS_ReceiveMessage2012 t) { return dal.Delete(t); }
public bool Update(SYS_ReceiveMessage2012 t) { return dal.Update(t); }
public int Add(SYS_ReceiveMessage2012 t) { return dal.Add(t); }
public bool Exists(SYS_ReceiveMessage2012 t) { return dal.Exists(t); }