예제 #1
0
        // Verilen polikliniği veritabanından siler.
        public static void Delete(Polyclinic poly)
        {
            Database.client.Cypher
            .OptionalMatch("(polyclinic:Polyclinic)<-[r]-()")
            .Where((Polyclinic polyclinic) => polyclinic.name == poly.name)
            .Delete("r")
            .ExecuteWithoutResults();

            Database.client.Cypher
            .Match("(polyclinic:Polyclinic)")
            .Where((Polyclinic polyclinic) => polyclinic.name == poly.name)
            .Delete("polyclinic")
            .ExecuteWithoutResults();
        }
        public static void AddAction(Patient otherPatient, Polyclinic otherPolyclinic, Doctor otherDoctor, decimal order, string action, decimal quantity, string price)
        {
            var newAction = new Action {
                order = order, action = action, quantity = quantity, price = price, dateTime = DateTime.Now
            };

            Database.client.Cypher
            .Match("(patient:Patient)", "(polyclinic: Polyclinic)", "(doctor: Doctor)")
            .Where((Patient patient) => patient.id == otherPatient.id)
            .AndWhere((Polyclinic polyclinic) => polyclinic.name == otherPolyclinic.name)
            .AndWhere((Doctor doctor) => doctor.name == otherDoctor.name)
            .Create("(action:Action {newAction})-[:BELONGS_TO]->(patient), (action)-[:BELONGS_TO]->(polyclinic), (action)-[:BELONGS_TO]->(doctor)")
            .WithParam("newAction", newAction)
            .ExecuteWithoutResults();
        }
예제 #3
0
        // Veritabanında Yeni bir poliklinik oluşturur.
        public static void Create(string name, string description = "", bool status = true)
        {
            var newPolyclinic = new Polyclinic {
                name = name, description = description, status = status
            };

            Database.client.Cypher
            .Merge("(polyclinic: Polyclinic{ name: {name} })")
            .OnCreate()
            .Set("polyclinic = {newPolyclinic}")
            .WithParams(new
            {
                name = newPolyclinic.name,
                newPolyclinic
            })
            .ExecuteWithoutResults();
        }