コード例 #1
0
 /// <summary>
 /// 得到一个对象实体,从缓存中
 /// </summary>
 public TDTK.PlatForm.MVC4.Model.TT_LoadWeightBackup GetModelByCache(long ID)
 {
     TT_LoadWeightBackup lb = new TT_LoadWeightBackup();
     lb.ID = ID;
     string CacheKey = "TT_LoadWeightBackupModel-" + ID;
     object objModel = Maticsoft.Common.DataCache.GetCache(CacheKey);
     if (objModel == null)
     {
         try
         {
             objModel = dal.GetModel(lb);
             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_LoadWeightBackup)objModel;
 }
コード例 #2
0
 public bool Delete(TT_LoadWeightBackup t)
 {
     return dal.Delete(t);
 }
コード例 #3
0
 public TT_LoadWeightBackup GetModel(TT_LoadWeightBackup t)
 {
     return dal.GetModel(t);
 }
コード例 #4
0
 public bool Update(TT_LoadWeightBackup t)
 {
     return dal.Update(t);
 }
コード例 #5
0
 public int Add(TT_LoadWeightBackup t)
 {
     return dal.Add(t);
 }
コード例 #6
0
 public bool Exists(TT_LoadWeightBackup t)
 {
     return dal.Exists(t);
 }
コード例 #7
0
 public Model.TT_LoadWeightBackup DataRowToModel(DataRow row)
 {
     TDTK.PlatForm.MVC4.Model.TT_LoadWeightBackup model = new TDTK.PlatForm.MVC4.Model.TT_LoadWeightBackup();
     if (row != null)
     {
         if (row["ID"] != null && row["ID"].ToString() != "")
         {
             model.ID = long.Parse(row["ID"].ToString());
         }
         if (row["WeightCode"] != null)
         {
             model.WeightCode = row["WeightCode"].ToString();
         }
         if (row["TrafficCode"] != null)
         {
             model.TrafficCode = row["TrafficCode"].ToString();
         }
         if (row["NavicertCode"] != null)
         {
             model.NavicertCode = row["NavicertCode"].ToString();
         }
         if (row["MarkedCardCode"] != null)
         {
             model.MarkedCardCode = row["MarkedCardCode"].ToString();
         }
         if (row["RemoteCardCode"] != null)
         {
             model.RemoteCardCode = row["RemoteCardCode"].ToString();
         }
         if (row["EmptyCode"] != null)
         {
             model.EmptyCode = row["EmptyCode"].ToString();
         }
         if (row["CollCode"] != null)
         {
             model.CollCode = row["CollCode"].ToString();
         }
         if (row["CollName"] != null)
         {
             model.CollName = row["CollName"].ToString();
         }
         if (row["CoalKindCode"] != null)
         {
             model.CoalKindCode = row["CoalKindCode"].ToString();
         }
         if (row["CoalKindName"] != null)
         {
             model.CoalKindName = row["CoalKindName"].ToString();
         }
         if (row["CarOwnerName"] != null)
         {
             model.CarOwnerName = row["CarOwnerName"].ToString();
         }
         if (row["CarNo"] != null)
         {
             model.CarNo = row["CarNo"].ToString();
         }
         if (row["CarType"] != null)
         {
             model.CarType = row["CarType"].ToString();
         }
         if (row["LoadWeight"] != null && row["LoadWeight"].ToString() != "")
         {
             model.LoadWeight = decimal.Parse(row["LoadWeight"].ToString());
         }
         if (row["EmptyWeight"] != null && row["EmptyWeight"].ToString() != "")
         {
             model.EmptyWeight = decimal.Parse(row["EmptyWeight"].ToString());
         }
         if (row["NetWeight"] != null && row["NetWeight"].ToString() != "")
         {
             model.NetWeight = decimal.Parse(row["NetWeight"].ToString());
         }
         if (row["OverWeight"] != null && row["OverWeight"].ToString() != "")
         {
             model.OverWeight = decimal.Parse(row["OverWeight"].ToString());
         }
         if (row["TaxAmount"] != null && row["TaxAmount"].ToString() != "")
         {
             model.TaxAmount = decimal.Parse(row["TaxAmount"].ToString());
         }
         if (row["FundAmount"] != null && row["FundAmount"].ToString() != "")
         {
             model.FundAmount = decimal.Parse(row["FundAmount"].ToString());
         }
         if (row["RoomCode"] != null)
         {
             model.RoomCode = row["RoomCode"].ToString();
         }
         if (row["RoomName"] != null)
         {
             model.RoomName = row["RoomName"].ToString();
         }
         if (row["BangType"] != null)
         {
             model.BangType = row["BangType"].ToString();
         }
         if (row["Operator"] != null)
         {
             model.Operator = row["Operator"].ToString();
         }
         if (row["WeightTime"] != null && row["WeightTime"].ToString() != "")
         {
             model.WeightTime = DateTime.Parse(row["WeightTime"].ToString());
         }
         if (row["RandomCode"] != null)
         {
             model.RandomCode = row["RandomCode"].ToString();
         }
         if (row["CustomerName"] != null)
         {
             model.CustomerName = row["CustomerName"].ToString();
         }
         if (row["TaxType"] != null)
         {
             model.TaxType = row["TaxType"].ToString();
         }
         if (row["IsFirstSite"] != null)
         {
             model.IsFirstSite = row["IsFirstSite"].ToString();
         }
         if (row["FrontImage"] != null)
         {
             model.FrontImage = row["FrontImage"].ToString();
         }
         if (row["BackImage"] != null)
         {
             model.BackImage = row["BackImage"].ToString();
         }
         if (row["UpImage"] != null)
         {
             model.UpImage = row["UpImage"].ToString();
         }
         if (row["RoomImage"] != null)
         {
             model.RoomImage = row["RoomImage"].ToString();
         }
         if (row["TaxGroup"] != null && row["TaxGroup"].ToString() != "")
         {
             model.TaxGroup = decimal.Parse(row["TaxGroup"].ToString());
         }
         if (row["IsSealed"] != null)
         {
             model.IsSealed = row["IsSealed"].ToString();
         }
         if (row["UpdateOperator"] != null)
         {
             model.UpdateOperator = row["UpdateOperator"].ToString();
         }
         if (row["UpdateTime"] != null && row["UpdateTime"].ToString() != "")
         {
             model.UpdateTime = DateTime.Parse(row["UpdateTime"].ToString());
         }
     }
     return model;
 }
コード例 #8
0
        public Model.TT_LoadWeightBackup GetModel(Model.TT_LoadWeightBackup t)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 ID,WeightCode,TrafficCode,NavicertCode,MarkedCardCode,RemoteCardCode,EmptyCode,CollCode,CollName,CoalKindCode,CoalKindName,CarOwnerName,CarNo,CarType,LoadWeight,EmptyWeight,NetWeight,OverWeight,TaxAmount,FundAmount,RoomCode,RoomName,BangType,Operator,WeightTime,RandomCode,CustomerName,TaxType,IsFirstSite,FrontImage,BackImage,UpImage,RoomImage,TaxGroup,IsSealed,UpdateOperator,UpdateTime from TT_LoadWeightBackup ");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters = {
					new SqlParameter("@ID", SqlDbType.BigInt)
			};
            parameters[0].Value = t.ID;

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