/// <summary> /// Binds the indicators by order. /// </summary> /// <param name="sort">The sort.</param> /// <param name="sortdir">The sortdir.</param> /// <returns></returns> public ActionResult BindIndicatorsDataByOrder(string sort, string sortdir) { using (var bal = new DashboardIndicatorDataBal()) { //Get the Entity list var list = bal.GetDashboardIndicatorDataList(Helpers.GetSysAdminCorporateID(), Helpers.GetDefaultFacilityId()); //Intialize the View Model i.e. DashboardIndicatorsView which is binded to Main View Index.cshtml under DashboardIndicators var orderByExpression = HtmlExtensions.GetOrderByExpression <DashboardIndicatorDataCustomModel>(sort); var data = HtmlExtensions.OrderByDir <DashboardIndicatorDataCustomModel>(list, sortdir, orderByExpression); //Pass the View Model in ActionResult to View DashboardIndicators return(PartialView(PartialViews.DashboardIndicatorDataList, data)); } }
/// <summary> /// Get the details of the DashboardIndicatorData View in the Model DashboardIndicatorData such as DashboardIndicatorDataList, list of countries etc. /// </summary> /// <returns> /// returns the actionresult in the form of current object of the Model DashboardIndicatorData to be passed to View DashboardIndicatorData /// </returns> public ActionResult Index() { //Initialize the DashboardIndicatorData BAL object using (var bal = new DashboardIndicatorDataBal()) { //Get the Entity list var list = bal.GetDashboardIndicatorDataList(Helpers.GetSysAdminCorporateID(), Helpers.GetDefaultFacilityId()); //Intialize the View Model i.e. DashboardIndicatorDataView which is binded to Main View Index.cshtml under DashboardIndicatorData var viewModel = new DashboardIndicatorDataView { DashboardIndicatorDataList = list, CurrentDashboardIndicatorData = new DashboardIndicatorData() }; //Pass the View Model in ActionResult to View DashboardIndicatorData return(View(viewModel)); } }