Exemplo n.º 1
0
        public ActionResult Create(CreateModelViewModel modelView)
        {
            var model = new DataAccess.Model();

            model.Name  = modelView.Name;
            model.Brand = modelView.Brand;
            repo.Create(model);

            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        public ActionResult Edit(ModelViewModel modelView)
        {
            var brand = new DataAccess.Model();

            brand.Name  = modelView.Name;
            brand.Brand = modelView.Brand.ID;
            brand.ID    = modelView.ID;
            repo.Save(brand);

            return(RedirectToAction("Index"));
        }
Exemplo n.º 3
0
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     //Program holds the responsibility of creating Model
     //It is passed on as a reference to Payslip(view) class
     DataAccess.Model model = new DataAccess.Model();
     try
     {
         model.Initialise();
     }
     catch(System.Exception ex)
     {
         MessageBox.Show("Error occured " + ex.ToString());
     }
     Application.Run(new Payslip(ref model));
 }
Exemplo n.º 4
0
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     //Program holds the responsibility of creating Model
     //It is passed on as a reference to Payslip(view) class
     DataAccess.Model model = new DataAccess.Model();
     try
     {
         model.Initialise();
     }
     catch (System.Exception ex)
     {
         MessageBox.Show("Error occured " + ex.ToString());
     }
     Application.Run(new Payslip(ref model));
 }