Beispiel #1
0
        static void Main()
        {
            IoCInit.InitialiseIoC();


            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1(IoCInit.GetScope().Resolve <ICompanyModelService>()));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            _companyModelService = IoCInit.GetScope().Resolve <ICompanyModelService>();
            FoundCompany         = _companyModelService.SearchByCompanyId(Convert.ToInt32(id));

            //      db.Companies.Remove(FoundCompany);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        // GET: Companies/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            _companyModelService = IoCInit.GetScope().Resolve <ICompanyModelService>();
            FoundCompany         = _companyModelService.SearchByCompanyId(Convert.ToInt32(id));

            if (FoundCompany == null)
            {
                return(HttpNotFound());
            }
            return(View(FoundCompany));
        }
 // GET: Companies
 public ActionResult Index()
 {
     _companyModelService = IoCInit.GetScope().Resolve <ICompanyModelService>();
     AllCompanies         = _companyModelService.GetAllCompanies();
     return(View(AllCompanies));
 }