Ejemplo n.º 1
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public webs_YueyxShop.Model.RejectionSKUDetail DataRowToModel(DataRow row)
 {
     webs_YueyxShop.Model.RejectionSKUDetail model=new webs_YueyxShop.Model.RejectionSKUDetail();
     if (row != null)
     {
         if(row["rs_ID"]!=null && row["rs_ID"].ToString()!="")
         {
             model.rs_ID=int.Parse(row["rs_ID"].ToString());
         }
         if(row["sku_ID"]!=null && row["sku_ID"].ToString()!="")
         {
             model.sku_ID=int.Parse(row["sku_ID"].ToString());
         }
         if(row["r_ID"]!=null && row["r_ID"].ToString()!="")
         {
             model.r_ID=int.Parse(row["r_ID"].ToString());
         }
         if(row["rs_pCount"]!=null && row["rs_pCount"].ToString()!="")
         {
             model.rs_pCount=int.Parse(row["rs_pCount"].ToString());
         }
     }
     return model;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public webs_YueyxShop.Model.RejectionSKUDetail GetModel(int rs_ID)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("select  top 1 rs_ID,sku_ID,r_ID,rs_pCount from RejectionSKUDetail ");
            strSql.Append(" where rs_ID=@rs_ID ");
            SqlParameter[] parameters = {
                    new SqlParameter("@rs_ID", SqlDbType.Int,4)			};
            parameters[0].Value = rs_ID;

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