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));
 }
示例#4
0
        public Form1(ICompanyModelService companyModelService)
        {
            InitializeComponent();

            _companyModelService = companyModelService;
        }