コード例 #1
0
ファイル: Program.cs プロジェクト: D6Designs/TrendTestApp
        static void Main()
        {
            IoCInit.InitialiseIoC();


            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1(IoCInit.GetScope().Resolve <ICompanyModelService>()));
        }
コード例 #2
0
        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"));
        }
コード例 #3
0
        // 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));
        }
コード例 #4
0
 // GET: Companies
 public ActionResult Index()
 {
     _companyModelService = IoCInit.GetScope().Resolve <ICompanyModelService>();
     AllCompanies         = _companyModelService.GetAllCompanies();
     return(View(AllCompanies));
 }