public static Recuperacion GetRecuperacionById(int IdRecuperacion) { if (IdRecuperacion <= 0) { throw new ArgumentException("Id con valor invalido"); } DailyDB.App_Code.DAL.RecuperacionDSTableAdapters.RecuperacionTableAdapter adapter = new DailyDB.App_Code.DAL.RecuperacionDSTableAdapters.RecuperacionTableAdapter(); RecuperacionDS.RecuperacionDataTable table = adapter.GetRecuperacionById(IdRecuperacion); if (table.Rows.Count == 0) { return(null); } Recuperacion obj = GetRecuperacionFromRow(table[0]); return(obj); }
public static Recuperacion GetRecupByIdUserAndCodigo(int idUser, string codigo) { if (idUser <= 0 || string.IsNullOrEmpty(codigo)) { throw new ArgumentException("Id y codigo con valor invalido"); } DailyDB.App_Code.DAL.RecuperacionDSTableAdapters.RecuperacionTableAdapter adapter = new DailyDB.App_Code.DAL.RecuperacionDSTableAdapters.RecuperacionTableAdapter(); RecuperacionDS.RecuperacionDataTable table = adapter.GetRecuperacionByCodigoAndUserID(codigo, idUser); if (table.Rows.Count == 0) { return(null); } Recuperacion obj = GetRecuperacionFromRow(table[0]); return(obj); }