Ejemplo n.º 1
0
 private BusinessObjects.State MapToParents(DataRow dr)
 {
     BusinessObjects.State State = new BusinessObjects.State();
     State.ID = Convert.ToInt32(dr["PK_State_ID"]);
     State.Name = Convert.ToString(dr["State_Name"]);
     State.Abbr = Convert.ToString(dr["State_Abbr"]);
     State.Country = new BusinessObjects.Country() { ID = Convert.ToInt32(dr["PK_Country_ID"]), Name = Convert.ToString(dr["Country_Name"]), Icon = Convert.ToString(dr["Country_Icon"]), Image = Convert.ToString(dr["Country_Image"]) };
     return State;
 }
Ejemplo n.º 2
0
 public BusinessObjects.State Read(long ID)
 {
     BusinessObjects.State State = new BusinessObjects.State();
     List<SqlParameter> param = new List<SqlParameter>();
     param.Add(new SqlParameter("@StateID", ID));
     DataTable dt = Read(param.ToArray(), "SP_State_Read");
     if (dt.Rows.Count > 0)
     {
         State = MapToParents(dt.Rows[0]);
     }
     return State;
 }