/// <summary>
 /// 得到一个对象实体
 /// </summary>
 public webs_YueyxShop.Model.ConsigneeInfoBase DataRowToModel(DataRow row)
 {
     webs_YueyxShop.Model.ConsigneeInfoBase model=new webs_YueyxShop.Model.ConsigneeInfoBase();
     if (row != null)
     {
         if(row["c_ID"]!=null && row["c_ID"].ToString()!="")
         {
             model.c_ID=int.Parse(row["c_ID"].ToString());
         }
         if(row["m_ID"]!=null && row["m_ID"].ToString()!="")
         {
             model.m_ID=int.Parse(row["m_ID"].ToString());
         }
         if(row["c_Name"]!=null)
         {
             model.c_Name=row["c_Name"].ToString();
         }
         if(row["c_Telephone"]!=null)
         {
             model.c_Telephone=row["c_Telephone"].ToString();
         }
         if(row["c_Mobilephone"]!=null)
         {
             model.c_Mobilephone=row["c_Mobilephone"].ToString();
         }
         IDAL.IRegionBase rb = new DAL.RegionBase();
         if(row["c_Provice"]!=null && row["c_Provice"].ToString()!="")
         {
             model.c_Provice=int.Parse(row["c_Provice"].ToString());
             if (rb.Exists(model.c_Provice.Value))
             {
                 model.c_CProvice = rb.GetModel(model.c_Provice.Value).reg_Name;
             }
         }
         if(row["c_City"]!=null && row["c_City"].ToString()!="")
         {
             model.c_City = int.Parse(row["c_City"].ToString());
             if (rb.Exists(model.c_City.Value))
             {
                 model.c_CCity = rb.GetModel(model.c_City.Value).reg_Name;
             }
         }
         if(row["c_Count"]!=null && row["c_Count"].ToString()!="")
         {
             model.c_Count = int.Parse(row["c_Count"].ToString());
             if (rb.Exists(model.c_Count.Value))
             {
                 model.c_CCount = rb.GetModel(model.c_Count.Value).reg_Name;
             }
         }
         if(row["c_Zipcode"]!=null)
         {
             model.c_Zipcode=row["c_Zipcode"].ToString();
         }
         if(row["c_Moren"]!=null && row["c_Moren"].ToString()!="")
         {
             model.c_Moren=int.Parse(row["c_Moren"].ToString());
         }
         if(row["c_StatusCode"]!=null && row["c_StatusCode"].ToString()!="")
         {
             model.c_StatusCode=int.Parse(row["c_StatusCode"].ToString());
         }
         if(row["c_IsDel"]!=null && row["c_IsDel"].ToString()!="")
         {
             model.c_IsDel=int.Parse(row["c_IsDel"].ToString());
         }
         if(row["c_FullAddress"]!=null)
         {
             model.c_FullAddress=row["c_FullAddress"].ToString();
         }
     }
     return model;
 }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public webs_YueyxShop.Model.ConsigneeInfoBase GetModel(int c_ID)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("select  top 1 c_ID,m_ID,c_Name,c_Telephone,c_Mobilephone,c_Provice,c_City,c_Count,c_Zipcode,c_Moren,c_StatusCode,c_IsDel,c_FullAddress from ConsigneeInfoBase ");
            strSql.Append(" where c_ID=@c_ID");
            SqlParameter[] parameters = {
                    new SqlParameter("@c_ID", SqlDbType.Int,4)
            };
            parameters[0].Value = c_ID;

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