public ActionResult Vessels(int?companId) { var company = companId == null ? new CompanyModel() : new CompanyModel() { CompanyId = UserCompanyId }; VesselServices regSrv = new VesselServices(); return(Json(regSrv.Get(new VesselModel() { Company = company }))); }
public JsonResult List(DatatableModel dt, VesselModel filters) { VesselServices services = new VesselServices(); PagerModel pager = dt.ToPager(); filters.Company.CompanyId = SessionWeb.User.CompanyId; var collection = services.Get(pager, filters); return(Json(new { status = UI.Status.Success, sEcho = dt.sEcho, iTotalRecords = pager.TotalRecords, iTotalDisplayRecords = pager.TotalRecords, aaData = collection }, JsonRequestBehavior.AllowGet)); }