コード例 #1
0
 /// <summary>
 /// 得到一个对象实体,从缓存中
 /// </summary>
 public TDTK.PlatForm.MVC4.Model.TT_RFCard GetModelByCache(string CardCode)
 {
     TT_RFCard rf = new TT_RFCard();
     rf.CardCode = CardCode;
     string CacheKey = "TT_RFCardModel-" + CardCode;
     object objModel = Maticsoft.Common.DataCache.GetCache(CacheKey);
     if (objModel == null)
     {
         try
         {
             objModel = dal.GetModel(rf);
             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_RFCard)objModel;
 }
コード例 #2
0
 public Model.TT_RFCard DataRowToModel(DataRow row)
 {
     TDTK.PlatForm.MVC4.Model.TT_RFCard model = new TDTK.PlatForm.MVC4.Model.TT_RFCard();
     if (row != null)
     {
         if (row["CardCode"] != null)
         {
             model.CardCode = row["CardCode"].ToString();
         }
         if (row["InitialTime"] != null && row["InitialTime"].ToString() != "")
         {
             model.InitialTime = DateTime.Parse(row["InitialTime"].ToString());
         }
         if (row["IntialPerson"] != null)
         {
             model.IntialPerson = row["IntialPerson"].ToString();
         }
     }
     return model;
 }
コード例 #3
0
        public Model.TT_RFCard GetModel(Model.TT_RFCard t)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 CardCode,InitialTime,IntialPerson from TT_RFCard ");
            strSql.Append(" where CardCode=@CardCode ");
            SqlParameter[] parameters = {
					new SqlParameter("@CardCode", SqlDbType.VarChar,12)			};
            parameters[0].Value = t.CardCode;

            TDTK.PlatForm.MVC4.Model.TT_RFCard model = new TDTK.PlatForm.MVC4.Model.TT_RFCard();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }
コード例 #4
0
 public TT_RFCard GetModel(TT_RFCard t)
 {
     return dal.GetModel(t);
 }
コード例 #5
0
 public bool Delete(TT_RFCard t)
 {
     return dal.Delete(t);
 }
コード例 #6
0
 public bool Update(TT_RFCard t)
 {
     return dal.Update(t);
 }
コード例 #7
0
 public int Add(TT_RFCard t)
 {
     return dal.Add(t);
 }
コード例 #8
0
 public bool Exists(TT_RFCard t)
 {
     return dal.Exists(t);
 }