Beispiel #1
0
        public ActionResult Index()
        {
            ITestBLL testBLL = Container.Resolve <ITestBLL>();

            ViewBag.Name = testBLL.GetName();
            return(View());
        }
Beispiel #2
0
        //
        // GET: /Test/Test/

        public ActionResult Index()
        {
            ITestBLL        bll         = ServiceLocator.GetService <ITestBLL>();
            TestSearchModel searchModel = new TestSearchModel();

            var test = bll.GetModel(searchModel);

            return(View(test[0]));
        }
Beispiel #3
0
        public static ITestBLL CreateInstance()
        {
            ITestBLL op1 = null;

            if (op1 == null)
            {
                op1 = ComponentFactory.Create <ITestBLL>();
            }
            return(op1);
        }
Beispiel #4
0
 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);
     }
 }
Beispiel #5
0
        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));
        }
Beispiel #6
0
 /// <summary>
 /// 构造方法注入依赖接口
 /// </summary>
 /// <param name="iBaseBll"></param>
 public HomeController(ITestBLL iBaseBll)
 {
     _iBaseBll = iBaseBll;
 }
Beispiel #7
0
 /// <summary>
 /// 构造方法注入依赖接口
 /// </summary>
 /// <param name="iBaseBll"></param>
 public HomeController(ITestBLL iBaseBll)
 {
     _iBaseBll = iBaseBll;
 }