public static Cliente getCLienteFromRow(ClienteDS.ClienteRow row) { Cliente obj = new Cliente() { ClienteId = row.cliente_id, Nombre = row.nombre, Nit = row.nit }; return(obj); }
private static Cliente FillReccord(ClienteDS.ClienteRow row) { Cliente obj = new Cliente() { ClienteId = row.clienteId, CI = row.IsciNull() ? "" : row.ci, NombreCompleto = row.nombreCompleto, EsVendedor = row.esVendedor }; return(obj); }
public static Cliente GetClienteById(int ClienteId) { Cliente theData = null; try { ClienteDSTableAdapters.ClienteTableAdapter localAdapter = new ClienteDSTableAdapters.ClienteTableAdapter(); ClienteDS.ClienteDataTable table = localAdapter.GetClienteById(ClienteId); if (table != null && table.Rows.Count > 0) { ClienteDS.ClienteRow row = table[0]; theData = FillReccord(row); } } catch (Exception q) { throw new ArgumentException(q.Message, q); } return(theData); }