public static void AddMedOrgToPacient(int userId, int MedOrganizationId) { using (var db = new LiteDatabase(@"EgovMedDB.db")) { var collection = db.GetCollection <Pacient>("Pacient"); Pacient p = collection.FindOne(f => f.PacientId == userId); p.MedOrganizationId = MedOrganizationId; collection.Update(p); } }
public static bool AddPacient(Pacient pacient) { try { using (var db = new LiteDatabase(@"EgovMedDB.db")) { var collection = db.GetCollection <Pacient>("Pacient"); collection.Insert(pacient); } return(true); } catch (Exception ex) { return(false); } }