/// <summary> /// 得到一个对象实体,从缓存中 /// </summary> public TDTK.PlatForm.MVC4.Model.TT_TaxItemDetail GetModelByCache(long ItemDetailId) { TT_TaxItemDetail td = new TT_TaxItemDetail(); td.ItemDetailId = ItemDetailId; string CacheKey = "TT_TaxItemDetailModel-" + ItemDetailId; object objModel = Maticsoft.Common.DataCache.GetCache(CacheKey); if (objModel == null) { try { objModel = dal.GetModel(td); 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_TaxItemDetail)objModel; }
/// <summary> /// 得到一个对象实体 /// </summary> public TDTK.PlatForm.MVC4.Model.TT_TaxItemDetail DataRowToModel(DataRow row) { TDTK.PlatForm.MVC4.Model.TT_TaxItemDetail model = new TDTK.PlatForm.MVC4.Model.TT_TaxItemDetail(); if (row != null) { if (row["ItemDetailId"] != null && row["ItemDetailId"].ToString() != "") { model.ItemDetailId = long.Parse(row["ItemDetailId"].ToString()); } if (row["CoalKindCode"] != null) { model.CoalKindCode = row["CoalKindCode"].ToString(); } if (row["RoomCode"] != null) { model.RoomCode = row["RoomCode"].ToString(); } if (row["TaxItemCode"] != null) { model.TaxItemCode = row["TaxItemCode"].ToString(); } if (row["Amount"] != null && row["Amount"].ToString() != "") { model.Amount = decimal.Parse(row["Amount"].ToString()); } if (row["EffectTime"] != null && row["EffectTime"].ToString() != "") { model.EffectTime = DateTime.Parse(row["EffectTime"].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["TaxGroup"] != null && row["TaxGroup"].ToString() != "") { model.TaxGroup = decimal.Parse(row["TaxGroup"].ToString()); } if (row["IsAssigned"] != null) { model.IsAssigned = row["IsAssigned"].ToString(); } if (row["IsAll"] != null) { model.IsAll = row["IsAll"].ToString(); } } return model; }
public Model.TT_TaxItemDetail GetModel(Model.TT_TaxItemDetail t) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 ItemDetailId,CoalKindCode,RoomCode,TaxItemCode,Amount,EffectTime,Operator,OperateTime,TaxGroup,IsAssigned,IsAll from TT_TaxItemDetail "); strSql.Append(" where ItemDetailId=@ItemDetailId"); SqlParameter[] parameters = { new SqlParameter("@ItemDetailId", SqlDbType.BigInt) }; parameters[0].Value = t.ItemDetailId; TDTK.PlatForm.MVC4.Model.TT_TaxItemDetail model = new TDTK.PlatForm.MVC4.Model.TT_TaxItemDetail(); 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_TaxItemDetail GetModel(TT_TaxItemDetail t) { return dal.GetModel(t); }
public bool Delete(TT_TaxItemDetail t) { return dal.Delete(t); }
public bool Update(TT_TaxItemDetail t) { return dal.Update(t); }
public int Add(TT_TaxItemDetail t) { return dal.Add(t); }
public bool Exists(TT_TaxItemDetail t) { return dal.Exists(t); }