Esempio n. 1
0
        static void Main(string[] args)
        {
            Student modal = RetriveStudentFromDatabase();

            StudentView view = new StudentView();

            StudentController controller = new StudentController(modal, view);

            controller.UpdateView();

            controller.SetStudentName("Jhon");

            controller.UpdateView();
        }
Esempio n. 2
0
        /// <summary>
        ///  https://www.tutorialspoint.com/design_pattern/mvc_pattern.htm
        /// </summary>
        /// <param name="args"></param>
        ///
        static void Main(string[] args)
        {
            //fetch student record based on his roll no from the database
            Student model = RetrieveStudentFromDatabase();

            //Create a view : to write student details on console
            StudentView view = new StudentView();

            StudentController controller = new StudentController(model, view);

            controller.UpdateView();

            //update model data
            controller.SetStudentName("John");

            controller.UpdateView();
        }
Esempio n. 3
0
        public static void Demo()
        {
            //fetch student record based on his roll no from the database
            Student s = new Student()
            {
                Name = "A", ID = 1
            };

            //Create a view : to write student details on console
            StudentView v = new StudentView();

            StudentController sc = new StudentController(s, v);

            sc.UpdateView();

            //update model
            sc.SetName("B");
            sc.UpdateView();
            Console.Read();
        }
Esempio n. 4
0
 public StudentController(Student modal, StudentView view)
 {
     _studentModal     = modal;
     _studentViewModal = view;
 }
Esempio n. 5
0
 public StudentController(Student model, StudentView view)
 {
     this.model = model;
     this.view  = view;
 }