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"));
        }
Beispiel #2
0
        private void LoadCompanies()
        {
            this.FoundCompany = _companyModelService.SearchByCompanyId(27);


            this.AllCompanies = _companyModelService.GetAllCompanies();

            bsCompanies.DataSource = AllCompanies;

            dataGridView1.AutoGenerateColumns = false;
            dataGridView1.DataSource          = bsCompanies;
            dataGridView1.ClearSelection();
        }
        // 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));
        }