/// <summary> /// Get the details of the DashboardIndicators View in the Model DashboardIndicators such as DashboardIndicatorsList, list of countries etc. /// </summary> /// <returns> /// returns the actionresult in the form of current object of the Model DashboardIndicators to be passed to View DashboardIndicators /// </returns> public ActionResult IndexV1() { //Initialize the DashboardIndicators BAL object using (var bal = new DashboardIndicatorsBal()) { var corporateId = Helpers.GetSysAdminCorporateID(); //Get the Entity list var list = bal.GetDashboardIndicatorsListByCorporate(corporateId, Helpers.GetDefaultFacilityId()); var orderByExpression = HtmlExtensions.GetOrderByExpression <DashboardIndicatorsCustomModel>("Dashboard"); var data = HtmlExtensions.OrderByDir(list, "ASC", orderByExpression); //Intialize the View Model i.e. DashboardIndicatorsView which is binded to Main View Index.cshtml under DashboardIndicators var viewModel = new DashboardIndicatorsView { DashboardIndicatorsList = data, CurrentDashboardIndicators = new DashboardIndicators { IndicatorNumber = bal.GetIndicatorNextNumber(corporateId), OwnerShip = bal.GetNameByUserId(Helpers.GetLoggedInUserId()) } }; //Pass the View Model in ActionResult to View DashboardIndicators return(View(viewModel)); } }
public ActionResult BindDashboardIndicatorsList() { var list = new List <DashboardIndicatorsCustomModel>(); var oDashboardIndicatorsBal = new DashboardIndicatorsBal(); Int32 corporateId = Helpers.GetSysAdminCorporateID(); Int32 facilityId = 0; list = oDashboardIndicatorsBal.GetDashboardIndicatorsListByCorporate(corporateId, facilityId); return(PartialView(PartialViews.DashboardIndicatorsList, list)); }
/// <summary> /// Gets the indicatorby corporate. /// </summary> /// <returns></returns> public ActionResult GetIndicatorbyCorporate() { using (var bal = new DashboardIndicatorsBal()) { //Get the Entity list var list = bal.GetDashboardIndicatorsListByCorporate(Helpers.GetSysAdminCorporateID(), Helpers.GetDefaultFacilityId()); //Pass the View Model in ActionResult to View DashboardIndicators var orderByExpression = HtmlExtensions.GetOrderByExpression <DashboardIndicatorsCustomModel>("Dashboard"); var data = HtmlExtensions.OrderByDir <DashboardIndicatorsCustomModel>(list, "ASC", orderByExpression); //Pass the View Model in ActionResult to View DashboardIndicators return(PartialView(PartialViews.DashboardIndicatorsList, data)); } }
/// <summary> /// Gets the indicators. /// </summary> /// <returns></returns> public ActionResult GetIndicators() { using (var bal = new DashboardIndicatorsBal()) { var indicatorsObjList = bal.GetDashboardIndicatorsListByCorporate(Helpers.GetSysAdminCorporateID(), 0); var list = new List <SelectListItem>(); if (indicatorsObjList.Any()) { list.AddRange(indicatorsObjList.Select(item => new SelectListItem { Text = item.Dashboard, Value = item.IndicatorNumber })); } return(Json(list, JsonRequestBehavior.AllowGet)); } }