public static void Update(AreaInfo _AreaInfo) { _AdoHelper.ExecuteNonQuery(ConnectionString,CommandType.StoredProcedure, "AreaUpdate", new SqlParameter("@AreaId", _AreaInfo.AreaId), new SqlParameter("@NombreArea", _AreaInfo.NombreArea) ); }
public static int Insert(AreaInfo _AreaInfo) { //Execute the query and return the new Guid object retval= _AdoHelper.ExecuteScalar(ConnectionString,"AreaInsert", new SqlParameter("@NombreArea", _AreaInfo.NombreArea) ); return Int32.Parse(retval.ToString()); }
/// <summary> /// Creates a new instance of the Area class and populates it with data from the specified SqlDataReader. /// </summary> private static AreaInfo MakeArea(SqlDataReader dataReader) { AreaInfo area = new AreaInfo(); if (dataReader.IsDBNull(AreaId) == false) area.AreaId = dataReader.GetInt32(AreaId); if (dataReader.IsDBNull(NombreArea) == false) area.NombreArea = dataReader.GetString(NombreArea); return area; }