/// <summary> /// Bind all the Corporate list /// </summary> /// <returns> /// action result with the partial view containing the Corporate list object /// </returns> public ActionResult BindCorporateList() { //Initialize the Corporate BAL object using (var corporateBal = new CorporateBal()) { //Get the corporate list var corporatId = Helpers.GetDefaultCorporateId(); var corporateList = corporateBal.GetCorporate(corporatId); //Pass the ActionResult with List of CorporateViewModel object to Partial View CorporateList return(PartialView(PartialViews.CorporateList, corporateList)); } }
public ActionResult GetCorporates() { //Initialize the Corporate BAL object using (var bal = new CorporateBal()) { //Get the corporate list var corporatId = Helpers.GetDefaultCorporateId(); var corporateList = bal.GetCorporate(corporatId); //Pass the ActionResult with List of CorporateViewModel object to Partial View CorporateList return(Json(new { iTotalRecords = corporateList.Count, iTotalDisplayRecords = corporateList.Count, aaData = corporateList.Select(x => new[] { x.CorporateID.ToString(), x.CorporateName, x.CorporateNumber, x.StreetAddress, x.Email, x.CorporateMainPhone }) }, JsonRequestBehavior.AllowGet)); } }
public ActionResult Index() { //Initialize the Corporate BAL object var corporateBal = new CorporateBal(); //Get the Entity list var corporatId = Helpers.GetDefaultCorporateId(); var corporateList = corporateBal.GetCorporate(corporatId); //var corporateList = corporateBal.GetCorporate(corporatId); //Intialize the View Model i.e. CorporateView which is binded to Main View Index.cshtml under Corporate var corporateView = new CorporateView { CorporateList = corporateList, CurrentCorporate = new Model.Corporate() }; //Pass the View Model in ActionResult to View Corporate return(View(corporateView)); }