Esempio n. 1
0
 public static void CreateRelate(string Id, string Class_Name, string Teacher_Name, int School_Year)
 {
     //var client = ConnectNeo4J.Connection();
     //client.Cypher.Match("(a:Subject)", "(b:Class)").
     //    Where((Subject a) => a.id == Id).
     //    AndWhere((Class b) => b.id == Class_Name).
     //    Create("(a)<-[:Subject_Class]-(b)").ExecuteWithoutResults();
     //client.Cypher.Match("(a:Class)", "(b:Teacher)").
     //   Where((Class a) => a.id == Class_Name).
     //   AndWhere((Teacher b) => b.id == Teacher_Name).
     //   Create("(a)<-[:Class_Teacher]-(b)").ExecuteWithoutResults();
     RegisterSubjectAction.Regist_Subject(Id, Class_Name, Teacher_Name);
 }
Esempio n. 2
0
        /* CREATE */
        public static void Add_Subject(string Id, string Sub_name, int Numb_Credit, int Numb_Theory, int Numb_Practice, double Theory_Percent, int Numb_Student, string Class_Name, string Teacher_Name, int Year_Term)
        {
            var client  = ConnectNeo4J.Connection();
            var subject = new Subject {
                id = Id, sub_name = Sub_name, numb_credit = Numb_Credit, numb_theory = Numb_Theory, numb_practice = Numb_Practice, theory_percent = Theory_Percent, numb_student = Numb_Student, isDelete = false
            };

            client.Cypher.Create("(:Subject {subject})").WithParam("subject", subject).ExecuteWithoutResultsAsync().Wait();
            client.Cypher.Match("(a:Subject)", "(b:YearTerm)").Where((Subject a) => a.id == Id).
            AndWhere((YearTerm b) => b.year_term == Year_Term).
            Create("(a)<-[:Subject_YearTerm]-(b)").ExecuteWithoutResults();
            RegisterSubjectAction.Regist_Subject(Id, Class_Name, Teacher_Name);
        }