/// <summary> /// You can delete a person from the database /// </summary> /// <param name="p">person id need to be valid</param> /// <returns>Returns that the process was successful or not</returns> public bool DeletePerson(Person person) { bool result = CommonPersonManager.CommonDeleteIPerson(person, JsonDataBase); JsonDataBase.CreateJson(filePath); return(result); }
/// <summary> /// You can update a person properties except its id /// </summary> /// <param name="person">person id need to be valid</param> /// <returns>Returns the updated Person</returns> public Person UpdatePerson(Person person) { Person selectedPerson = CommonPersonManager.CommonUpdatePerson(person, CSVDataBase); CSVDataBase.CreateCSV(filePath); return(selectedPerson); }
/// <summary> /// You can update a person properties except its id /// </summary> /// <param name="person">person id need to be valid</param> /// <returns>Returns the updated person</returns> public Person UpdatePerson(Person person) { Person updatedPerson = CommonPersonManager.CommonUpdatePerson(person, JsonDataBase); JsonDataBase.CreateJson(filePath); return(updatedPerson); }
/// <summary> /// You can delete an existing person from the Txt database /// </summary> /// <param name="p">person id need to be valid</param> /// <returns></returns> public bool DeletePerson(Person person) { bool result = CommonPersonManager.CommonDeleteIPerson(person, TxtDBdatabase); TxtDBdatabase.CreateTxt(filePath); return(result); }
public bool DeletePerson(Person person) { var result = CommonPersonManager.CommonDeleteIPerson(person, BinaryDatabase); BinaryDatabase.CreateBinarty(filePath); return(result); }
/// <summary> /// You can update a person properties except its id /// </summary> /// <param name="person">person id need to be valid</param> /// <returns></returns> public Person UpdatePerson(Person person) { Person updatedperson = CommonPersonManager.CommonUpdatePerson(person, TxtDBdatabase); TxtDBdatabase.CreateTxt(filePath); return(updatedperson); }
public Person UpdatePerson(Person person) { var updatedPerson = CommonPersonManager.CommonUpdatePerson(person, BinaryDatabase); BinaryDatabase.CreateBinarty(filePath); return(updatedPerson); }
/// <summary> /// Add a person to the Jsondatabase /// </summary> /// <param name="person">person object</param> /// <returns>Returns the added person object</returns> public Person AddPerson(Person person) { bool wasnull = false; Person addedPerson = CommonPersonManager.CommonAddPerson(person, JsonDataBase, ref wasnull); if (wasnull) { JsonDataBase.CreateJson(filePath); } return(addedPerson); }
/// <summary> /// You can delete an existing person from the Xml database /// </summary> /// <param name="p">person id need to be valid</param> /// <returns></returns> public bool DeletePerson(Person person) { bool result = CommonPersonManager.CommonDeleteIPerson(person, TomlDataBase); People people = new People { Persons = TomlDataBase }; people.CreateToml(filePath); return(result); }
/// <summary> /// You can update an exiting person's properties except its id /// </summary> /// <param name="person">person id need to be valid</param> /// <returns></returns> public Person UpdatePerson(Person person) { Person updatePerson = CommonPersonManager.CommonUpdatePerson(person, TomlDataBase); People people = new People { Persons = TomlDataBase }; people.CreateToml(filePath); return(updatePerson); }
public Person AddPerson(Person person) { bool wasnull = false; var addedPerson = CommonPersonManager.CommonAddPerson(person, BinaryDatabase, ref wasnull); if (wasnull) { addedPerson.CreateBinarty(filePath, true); } return(addedPerson); }
/// <summary> /// Add a person to the Txt database /// </summary> /// <param name="person">person object</param> /// <returns></returns> public Person AddPerson(Person person) { bool wasnull = false; Person addedPerson = CommonPersonManager.CommonAddPerson(person, TxtDBdatabase, ref wasnull); if (wasnull == true) { TxtDBdatabase.CreateTxt(filePath); } return(addedPerson); }
/// <summary> /// Add a person to the Xml database /// </summary> /// <param name="person">person object</param> /// <returns></returns> public Person AddPerson(Person person) { bool wasnull = false; Person addedPerson = CommonPersonManager.CommonAddPerson(person, TomlDataBase, ref wasnull); if (wasnull) { People people = new People { Persons = TomlDataBase }; people.CreateToml(filePath); } return(addedPerson); }
/// <summary> /// Add a person to the Xml database /// </summary> /// <param name="person">person object</param> /// <returns></returns> public Person AddPerson(Person person) { bool wasnull = false; Person addedPerson = CommonPersonManager.CommonAddPerson(person, xmlDatabase, ref wasnull); if (wasnull == true) { XDocument doc = XDocument.Load(filePath); XElement xElement = new XElement("Person", new XElement("Id", addedPerson.Id), new XElement("Name", addedPerson.Name), new XElement("DateOfBirth", addedPerson.DateOfBirth), new XElement("Email", addedPerson.Email) ); doc.Root.Add(xElement); doc.Save(filePath); } return(addedPerson); }
/// <summary> /// Search the database for records that meets our parameters /// </summary> /// <param name="name">Checks that any record contains this name</param> /// <param name="dateOfBirth">looks for records from this year</param> /// <param name="email">checks that any record contains this email</param> /// <returns>returns the list of people whos passed the filtering</returns> public List <Person> SearchResult(string name = null, DateTime?dateOfBirth = null, string email = null) { List <Person> result = GetPersons(); return(CommonPersonManager.CommonSearch(result, name, dateOfBirth, email).ToList()); }
public List <Person> SearchResult(string name = null, DateTime?dateOfBirth = null, string email = null) { return(CommonPersonManager.CommonSearch(BinaryDatabase, name, dateOfBirth, email).ToList()); }