/// <summary> /// 得到一个对象实体,从缓存中 /// </summary> public TDTK.PlatForm.MVC4.Model.TT_LoadWeightEditLog GetModelByCache(long LogID) { TT_LoadWeightEditLog lel = new TT_LoadWeightEditLog(); lel.LogID = LogID; string CacheKey = "TT_LoadWeightEditLogModel-" + LogID; object objModel = Maticsoft.Common.DataCache.GetCache(CacheKey); if (objModel == null) { try { objModel = dal.GetModel(lel); 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_LoadWeightEditLog)objModel; }
public Model.TT_LoadWeightEditLog DataRowToModel(DataRow row) { TDTK.PlatForm.MVC4.Model.TT_LoadWeightEditLog model = new TDTK.PlatForm.MVC4.Model.TT_LoadWeightEditLog(); if (row != null) { if (row["LogID"] != null && row["LogID"].ToString() != "") { model.LogID = long.Parse(row["LogID"].ToString()); } if (row["WeightCode"] != null) { model.WeightCode = row["WeightCode"].ToString(); } if (row["BeforeNetWeight"] != null && row["BeforeNetWeight"].ToString() != "") { model.BeforeNetWeight = decimal.Parse(row["BeforeNetWeight"].ToString()); } if (row["BeforeCollCode"] != null) { model.BeforeCollCode = row["BeforeCollCode"].ToString(); } if (row["BeforeKindCode"] != null) { model.BeforeKindCode = row["BeforeKindCode"].ToString(); } if (row["BeforeNavicertCode"] != null) { model.BeforeNavicertCode = row["BeforeNavicertCode"].ToString(); } if (row["BeforeMarkedCardCode"] != null) { model.BeforeMarkedCardCode = row["BeforeMarkedCardCode"].ToString(); } if (row["AfterNetWeight"] != null && row["AfterNetWeight"].ToString() != "") { model.AfterNetWeight = decimal.Parse(row["AfterNetWeight"].ToString()); } if (row["AfterCollCode"] != null) { model.AfterCollCode = row["AfterCollCode"].ToString(); } if (row["AfterKindCode"] != null) { model.AfterKindCode = row["AfterKindCode"].ToString(); } if (row["AfterNavicertCode"] != null) { model.AfterNavicertCode = row["AfterNavicertCode"].ToString(); } if (row["AfterMarkedCardCode"] != null) { model.AfterMarkedCardCode = row["AfterMarkedCardCode"].ToString(); } if (row["Remark"] != null) { model.Remark = row["Remark"].ToString(); } if (row["Operator"] != null) { model.Operator = row["Operator"].ToString(); } if (row["OperateDate"] != null && row["OperateDate"].ToString() != "") { model.OperateDate = DateTime.Parse(row["OperateDate"].ToString()); } } return model; }
public Model.TT_LoadWeightEditLog GetModel(Model.TT_LoadWeightEditLog t) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 LogID,WeightCode,BeforeNetWeight,BeforeCollCode,BeforeKindCode,BeforeNavicertCode,BeforeMarkedCardCode,AfterNetWeight,AfterCollCode,AfterKindCode,AfterNavicertCode,AfterMarkedCardCode,Remark,Operator,OperateDate from TT_LoadWeightEditLog "); strSql.Append(" where LogID=@LogID"); SqlParameter[] parameters = { new SqlParameter("@LogID", SqlDbType.BigInt) }; parameters[0].Value = t.LogID; TDTK.PlatForm.MVC4.Model.TT_LoadWeightEditLog model = new TDTK.PlatForm.MVC4.Model.TT_LoadWeightEditLog(); 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_LoadWeightEditLog GetModel(TT_LoadWeightEditLog t) { return dal.GetModel(t); }
public bool Delete(TT_LoadWeightEditLog t) { return dal.Delete(t); }
public bool Update(TT_LoadWeightEditLog t) { return dal.Update(t); }
public int Add(TT_LoadWeightEditLog t) { return dal.Add(t); }
public bool Exists(TT_LoadWeightEditLog t) { return dal.Exists(t); }