Пример #1
0
        static void testAddingStudent(string afirstname, string afathername, string asurname, string firstname, string fathername, string surname,
                                      string email, string mobile, int departmentid, string regyear, string unnum, int userid, int groupid)
        {
            //Console.WriteLine("Hello World!");

            using (var context = new DBClasses.LogiTestDbContext())
            {
                var std = new DBClasses.Student();
                std.AFirstName   = afirstname;
                std.FirstName    = firstname;
                std.AFatherName  = afathername;
                std.FatherName   = fathername;
                std.ASurName     = asurname;
                std.SurName      = surname;
                std.Email        = email;
                std.Mobile       = mobile;
                std.DepartmentId = departmentid;
                std.RegYear      = regyear;
                std.UnNum        = unnum;
                std.UserId       = userid;
                std.GroupId      = groupid;

                context.Add(std);
                context.SaveChanges();
            }

            Console.WriteLine("done student");
        }
Пример #2
0
        static void testAddingAssignment(double mark, double decmark, int groupid, DateTime publishdate, DateTime deadline, DateTime tdeadline,
                                         string description, string template)//, string solution, string asstest, string note)
        {
            //Console.WriteLine("Hello World!");

            using (var context = new DBClasses.LogiTestDbContext())
            {
                var assi = new DBClasses.Assignment();
                assi.Mark        = mark;
                assi.DecMark     = decmark;
                assi.GroupId     = groupid;
                assi.PublishDate = publishdate;
                assi.Deadline    = deadline;
                assi.TDeadline   = tdeadline;
                assi.Description = description;
                assi.Template    = template;
                //assi.Solution = solution;
                //assi.AssTest = asstest;
                //assi.Note = note;

                context.Add(assi);
                context.SaveChanges();
            }

            Console.WriteLine("done assignment");
        }
Пример #3
0
        static void testAddingDepartment(string deptname)
        {
            //Console.WriteLine("Hello World!");

            using (var context = new DBClasses.LogiTestDbContext())
            {
                var dept = new DBClasses.Department();
                dept.DeptName = deptname;
                context.Add(dept);
                context.SaveChanges();
            }

            Console.WriteLine("done department");
        }
Пример #4
0
        static void testAddingUser(string username, string password, string hint, int type)
        {
            //Console.WriteLine("Hello World!");

            using (var context = new DBClasses.LogiTestDbContext())
            {
                var us = new DBClasses.User();
                us.UserName = username;
                us.Password = password;
                us.Hint     = hint;
                us.Type     = type;

                context.Add(us);
                context.SaveChanges();
            }

            Console.WriteLine("done user");
        }
Пример #5
0
        static void testAddingGroup(string groupsemester, int maxnum, int teacherid, string day, DateTime time)
        {
            //Console.WriteLine("Hello World!");

            using (var context = new DBClasses.LogiTestDbContext())
            {
                var gr = new DBClasses.Group();
                gr.GroupSemester = groupsemester;
                gr.MaxNum        = maxnum;
                gr.TeacherId     = teacherid;
                gr.Day           = day;
                gr.Time          = time;

                context.Add(gr);
                context.SaveChanges();
            }

            Console.WriteLine("done group");
        }
Пример #6
0
        static void testAddingSub(int studentid, int assid, DateTime date, string solution, int tryid)//,double mark)
        {
            //Console.WriteLine("Hello World!");

            using (var context = new DBClasses.LogiTestDbContext())
            {
                var sub = new DBClasses.Submission();
                sub.StudentId = studentid;
                sub.AssId     = assid;
                sub.Date      = date;
                sub.Solution  = solution;
                //sub.Mark = mark;
                sub.TryId = tryid;
                //sub.SubmissionId = submissionid;

                context.Add(sub);
                context.SaveChanges();
            }

            Console.WriteLine("done submission");
        }
Пример #7
0
        static void testAddingTeacher(string afirstname, string firstname, string afathername,
                                      string fathername, string asurname, string surname,
                                      string email, string mobile, int userid)
        {
            //Console.WriteLine("Hello World!");

            using (var context = new DBClasses.LogiTestDbContext())
            {
                var std = new DBClasses.Teacher();
                std.AFirstName  = afirstname;
                std.FirstName   = firstname;
                std.AFatherName = afathername;
                std.FatherName  = fathername;
                std.ASurName    = asurname;
                std.SurName     = surname;
                std.Email       = email;
                std.Mobile      = mobile;
                std.UserId      = userid;
                context.Add(std);
                context.SaveChanges();
            }

            Console.WriteLine("done teacher");
        }