public ActionResult Index() { ITestBLL testBLL = Container.Resolve <ITestBLL>(); ViewBag.Name = testBLL.GetName(); return(View()); }
// // GET: /Test/Test/ public ActionResult Index() { ITestBLL bll = ServiceLocator.GetService <ITestBLL>(); TestSearchModel searchModel = new TestSearchModel(); var test = bll.GetModel(searchModel); return(View(test[0])); }
public static ITestBLL CreateInstance() { ITestBLL op1 = null; if (op1 == null) { op1 = ComponentFactory.Create <ITestBLL>(); } return(op1); }
public void GetModelTest() { try { ITestBLL bll = ServiceLocator.GetService <ITestBLL>(); TestSearchModel searchModel = new TestSearchModel(); var test = bll.GetModel(searchModel); foreach (var t in test) { } //Assert.Fail(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public ActionResult TestList() { this.SetSearchListAjaxOptions(); TestSearchModel searchModel = new TestSearchModel(); int pageSize = Convert.ToInt32(Request["PageSize"] ?? "10"); int pageIndex = Convert.ToInt32(Request["page"] ?? "1"); searchModel.CurrentPageIndex = pageIndex; searchModel.PageSize = pageSize; if (!string.IsNullOrWhiteSpace(Request["RoleName"])) { searchModel.RoleName = Request["RoleName"]; } //else //{ // List<TestModel> bm = new List<TestModel>(); // PagedList<TestModel> l = new PagedList<TestModel>(bm, 0, 0); // if (Request.IsAjaxRequest()) // { // return PartialView("_PartialTestList", l); // } // return View(l); //} searchModel.Trim(); ITestBLL bll = ServiceLocator.GetService <ITestBLL>(); var pagelist = bll.GetListModel(searchModel); if (Request.IsAjaxRequest()) { return(PartialView("_PartialTestList", pagelist)); } return(View(pagelist)); }
/// <summary> /// 构造方法注入依赖接口 /// </summary> /// <param name="iBaseBll"></param> public HomeController(ITestBLL iBaseBll) { _iBaseBll = iBaseBll; }