public Response <List <ListCompanyDto> > Companies(ParamsCompanyFilterModel data, string token) { Response <List <ListCompanyDto> > obj = null; var hCliente = _global.rspClient("Company/Filter", data, token); if (hCliente.IsSuccessStatusCode) { obj = new JavaScriptSerializer().Deserialize <Response <List <ListCompanyDto> > >(hCliente.Content.ReadAsStringAsync().Result); } return(obj); }
public ActionResult Index() { #region TOKEN var sessione = (SessionModel)Session[Resources.Constante.SessionUsuario]; LoginDto oLoginDto = new LoginDto(); oLoginDto.v_UserName = sessione.UserName; oLoginDto.v_Password = sessione.Pass; var validated = _securityBL.ValidateAccess(oLoginDto); if (validated == null) { return(Json("", "application/json", Encoding.UTF8, JsonRequestBehavior.AllowGet)); } #endregion var oParamsCompanyFilterModel = new ParamsCompanyFilterModel(); oParamsCompanyFilterModel.ResponsibleSystemUserId = validated.SystemUserId; var response = _companyBL.Companies(oParamsCompanyFilterModel, validated.Token); if (response.IsSuccess) { ViewBag.data = response.Data; } return(View()); }