static void Main(string[] args)
        {
            ServiceStudent st      = new ServiceStudent(new XMLRepoStudent(new ValidatorStudent(), "C:\\Users\\Deus\\documents\\visual studio 2015\\Projects\\Lab7Map\\Lab7Map\\XMLdata\\Studenti.xml"));
            ServiceTema    tm      = new ServiceTema(new XMLRepoTema(new ValidatorTema(), "C:\\Users\\Deus\\documents\\visual studio 2015\\Projects\\Lab7Map\\Lab7Map\\XMLdata\\Teme.xml"));
            ServiceNota    nt      = new ServiceNota(new XMLRepoNota(new ValidatorNota(), "C:\\Users\\Deus\\documents\\visual studio 2015\\Projects\\Lab7Map\\Lab7Map\\XMLdata\\Note.xml"));
            ServiceCatalog catalog = new ServiceCatalog(st, tm, nt);
            var            ui      = new UI.UI(catalog);

            ui.runMainMenu();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            ServiceStudent studentService = new ServiceStudent();

            //studentService.AddS(new Student { Name = "Ivan", Lastname = "Ivanow", Age = 20 });
            //studentService.AddS(new Student { Name = "Petro", Lastname = "Petrov", Age = 30 });
            //Random rnd = new Random();
            //foreach(Student el in studentService.Students)
            //{
            //    el.AddMark("C++", rnd.Next(1, 12));
            //    el.AddMark("C#", rnd.Next(1, 12));
            //}
            foreach (Student el in studentService.Students)
            {
                Console.WriteLine(el);
            }
            studentService.Save();
        }
        public ActionResult AddStudent(EEP_Models.Models.Student s)
        {
            if (s.btechDetails.BtechRollNo == null || s.degreeDetails.DRollNo == null)
            {
                //adding photo
                string filename = Path.GetFileName(s.image.FileName);
                string filexe   = Path.GetExtension(s.image.FileName);
                s.Photo  = "~/StudentImages/" + s.RollNo + filename;
                filename = Path.Combine(Server.MapPath("~/StudentImages/"), filename);
                s.image.SaveAs(filename);
                //adding tenth certiicate
                string filename1 = Path.GetFileName(s.tenthDetails.Timage.FileName);
                string filexe1   = Path.GetExtension(s.tenthDetails.Timage.FileName);
                s.tenthDetails.TCertificate = "~/StudentCertificate/Tenth/" + s.RollNo + filename1;
                //string a1 = filename1 + s.RollNo + filexe1;
                filename1 = Path.Combine(Server.MapPath("~/StudentCertificate/Tenth/"), filename1);
                s.image.SaveAs(filename1);
                //adding inter certificate
                string filename2 = Path.GetFileName(s.interDetails.Iimage.FileName);
                string filexe2   = Path.GetExtension(s.interDetails.Iimage.FileName);
                s.tenthDetails.TCertificate = "~/StudentCertificate/Inter/" + s.RollNo + filename2;
                // string a2 = filename2 + s.RollNo + filexe2;
                filename2 = Path.Combine(Server.MapPath("~/StudentCertificate/Inter/"), filename2);
                s.image.SaveAs(filename2);
            }


            EEP_Services.ServiceStudent obj = new ServiceStudent();
            int i = obj.addstudent(s);

            if (i == 1)
            {
                ViewData["message"] = "Add Successfully";
            }
            return(View());
        }
Exemple #4
0
        static void Main(string[] args)
        {
            IValidator <Student>      validatorS = new ValidareStudent();
            IValidator <Tema>         validatorT = new ValidareTema();
            IValidator <Inregistrare> validatorN = new ValidatorNota();

            ICrudRepository <int, Student> repoS = new InMemoryRepository <int, Student>(validatorS);
            ICrudRepository <int, Tema>    repoT
                = new InMemoryRepository <int, Tema>(validatorT);
            ICrudRepository <int, Inregistrare> repoN
                = new InMemoryRepository <int, Inregistrare>(validatorN);
            string filenameS = "D://Facultate Anul II//Metode Avansate de Programare//Laborator12-13//Laborator12-13//Date//Studenti.txt";
            string filenameT = "D://Facultate Anul II//Metode Avansate de Programare//Laborator12-13//Laborator12-13//Date//Teme.txt";
            string filenameC = "D://Facultate Anul II//Metode Avansate de Programare//Laborator12-13//Laborator12-13//Date//Catalog.txt";
            ICrudRepository <int, Student>      repoSF = new StudentInFileRepository(validatorS, filenameS);
            ICrudRepository <int, Tema>         repoTF = new TemeInFileRepository(validatorT, filenameT);
            ICrudRepository <int, Inregistrare> repoNF = new NoteInFileRepository(validatorN, filenameC);
            ServiceStudent serviceS   = new ServiceStudent(repoSF);
            ServiceTema    serviceT   = new ServiceTema(repoTF);
            ServiceCatalog serviceC   = new ServiceCatalog(repoNF, repoTF, repoSF);
            Controler      controller = new Controler(serviceC, serviceS, serviceT);

            controller.run();
        }
Exemple #5
0
 public ServiceCatalog(ServiceStudent serviceStudens, ServiceTema serviceTema, ServiceNota serviceNota)
 {
     this.serviceStudens = serviceStudens;
     this.serviceTema    = serviceTema;
     this.serviceNota    = serviceNota;
 }
Exemple #6
0
 public Controler(ServiceCatalog servC, ServiceStudent servS, ServiceTema servT)
 {
     this.servC = servC;
     this.servS = servS;
     this.servT = servT;
 }