public void Insert(long dealerId) { DBAccess.ExecuteNonQuery("INSERT INTO Contact (Surname, Name, Patronymic, Position, DealerId) VALUES (@param1, @param2, @param3, @param4, @param5)", Surname, Name, Patronymic, Position, dealerId); long contactId = DBAccess.ExecuteScalar <long>("SELECT MAX(Id) FROM Contact"); Phones.ForEach(x => x.Insert(contactId)); Faxes.ForEach(x => x.Insert(contactId)); Emails.ForEach(x => x.Insert(contactId)); }
/// <summary> /// Metodo para listar os faxes ordenando do mais antigo ao mais recente /// </summary> /// <returns>IList</returns> private IList <Fax> listarFaxesAsc() { User user = userService.OrigemFaxBox; if (user != null) { Faxes faxes = user.Faxes; SortedList <DateTime, Fax> listaFax = new SortedList <DateTime, Fax>(); foreach (Fax fax in faxes) { if (fax.IsReceived == BoolType.True && fax.FaxStatus == FaxStatusType.fsDoneOK && fax.Folder.ID.ToUpper().Equals("MAIN")) { listaFax.Add(fax.FaxRecordDateTime, fax); } } return(listaFax.Values); } return(null); }
public void FaxTest() { Faxes fax = new Faxes(9); Assert.AreEqual(9, fax.NumberOfFaxes); }