/// <summary>
 /// 得到一个对象实体,从缓存中
 /// </summary>
 public TDTK.PlatForm.MVC4.Model.TT_TransferAccounts GetModelByCache(long TransferID)
 {
     TT_TransferAccounts ta = new TT_TransferAccounts();
     ta.TransferID = TransferID;
     string CacheKey = "TT_TransferAccountsModel-" + TransferID;
     object objModel = Maticsoft.Common.DataCache.GetCache(CacheKey);
     if (objModel == null)
     {
         try
         {
             objModel = dal.GetModel(ta);
             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_TransferAccounts)objModel;
 }
 public Model.TT_TransferAccounts DataRowToModel(DataRow row)
 {
     TDTK.PlatForm.MVC4.Model.TT_TransferAccounts model = new TDTK.PlatForm.MVC4.Model.TT_TransferAccounts();
     if (row != null)
     {
         if (row["TransferID"] != null && row["TransferID"].ToString() != "")
         {
             model.TransferID = long.Parse(row["TransferID"].ToString());
         }
         if (row["FromCollCode"] != null)
         {
             model.FromCollCode = row["FromCollCode"].ToString();
         }
         if (row["ToCollCode"] != null)
         {
             model.ToCollCode = row["ToCollCode"].ToString();
         }
         if (row["TransferMoney"] != null && row["TransferMoney"].ToString() != "")
         {
             model.TransferMoney = decimal.Parse(row["TransferMoney"].ToString());
         }
         if (row["Operator"] != null)
         {
             model.Operator = row["Operator"].ToString();
         }
         if (row["OperateTime"] != null && row["OperateTime"].ToString() != "")
         {
             model.OperateTime = DateTime.Parse(row["OperateTime"].ToString());
         }
         if (row["OrgName"] != null)
         {
             model.OrgName = row["OrgName"].ToString();
         }
     }
     return model;
 }
        public Model.TT_TransferAccounts GetModel(Model.TT_TransferAccounts t)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 TransferID,FromCollCode,ToCollCode,TransferMoney,Operator,OperateTime,OrgName from TT_TransferAccounts ");
            strSql.Append(" where TransferID=@TransferID");
            SqlParameter[] parameters = {
					new SqlParameter("@TransferID", SqlDbType.BigInt)
			};
            parameters[0].Value = t.TransferID;

            TDTK.PlatForm.MVC4.Model.TT_TransferAccounts model = new TDTK.PlatForm.MVC4.Model.TT_TransferAccounts();
            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 TT_TransferAccounts GetModel(TT_TransferAccounts t)
 {
     return dal.GetModel(t);
 }
 public bool Delete(TT_TransferAccounts t)
 {
     return dal.Delete(t);
 }
 public bool Update(TT_TransferAccounts t)
 {
     return dal.Update(t);
 }
 public int Add(TT_TransferAccounts t)
 {
     return dal.Add(t);
 }
 public bool Exists(TT_TransferAccounts t)
 {
     return dal.Exists(t); 
 }