/// <summary>
 /// 得到一个对象实体,从缓存中
 /// </summary>
 public TDTK.PlatForm.MVC4.Model.TT_BadHandle GetModelByCache(string HandleID)
 {
     TT_BadHandle b = new TT_BadHandle();
     b.HandleID = HandleID;
     string CacheKey = "TT_BadHandleModel-" + HandleID;
     object objModel = Maticsoft.Common.DataCache.GetCache(CacheKey);
     if (objModel == null)
     {
         try
         {
             objModel = dal.GetModel(b);
             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_BadHandle)objModel;
 }
 public bool Delete(TT_BadHandle t)
 {
     return dal.Delete(t);
 }
 public TT_BadHandle GetModel(TT_BadHandle t)
 {
     return dal.GetModel(t);
 }
 public bool Update(TT_BadHandle t)
 {
     return dal.Update(t);
 }
 public int Add(TT_BadHandle t)
 {
     return dal.Add(t);
 }
 public bool Exists(TT_BadHandle t)
 {
    return dal.Exists(t);
 }
 public Model.TT_BadHandle DataRowToModel(System.Data.DataRow row)
 {
     TDTK.PlatForm.MVC4.Model.TT_BadHandle model = new TDTK.PlatForm.MVC4.Model.TT_BadHandle();
     if (row != null)
     {
         if (row["HandleID"] != null)
         {
             model.HandleID = row["HandleID"].ToString();
         }
         if (row["BadRecordID"] != null)
         {
             model.BadRecordID = row["BadRecordID"].ToString();
         }
         if (row["Operator"] != null)
         {
             model.Operator = row["Operator"].ToString();
         }
         if (row["OperateDate"] != null && row["OperateDate"].ToString() != "")
         {
             model.OperateDate = DateTime.Parse(row["OperateDate"].ToString());
         }
         if (row["Result"] != null)
         {
             model.Result = row["Result"].ToString();
         }
         if (row["HandleOperator"] != null)
         {
             model.HandleOperator = row["HandleOperator"].ToString();
         }
         if (row["HandleDate"] != null && row["HandleDate"].ToString() != "")
         {
             model.HandleDate = DateTime.Parse(row["HandleDate"].ToString());
         }
     }
     return model;
 }
        public Model.TT_BadHandle GetModel(Model.TT_BadHandle t)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 HandleID,BadRecordID,Operator,OperateDate,Result,HandleOperator,HandleDate from TT_BadHandle ");
            strSql.Append(" where HandleID=@HandleID ");
            SqlParameter[] parameters = {
					new SqlParameter("@HandleID", SqlDbType.VarChar,32)			};
            parameters[0].Value = t.HandleID;

            TDTK.PlatForm.MVC4.Model.TT_BadHandle model = new TDTK.PlatForm.MVC4.Model.TT_BadHandle();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }