public Response <QuotationRegisterDto> NewVersion(QuotationNewVersionDto data, string token) {//REFACTOR Response <QuotationRegisterDto> obj = null; var hCliente = _global.rspClient("Quotation/NewVersion/", data, token); if (hCliente.StatusCode == System.Net.HttpStatusCode.BadRequest) { obj = new JavaScriptSerializer().Deserialize <Response <QuotationRegisterDto> >(hCliente.Content.ReadAsStringAsync().Result); } if (hCliente.IsSuccessStatusCode) { obj = new JavaScriptSerializer().Deserialize <Response <QuotationRegisterDto> >(hCliente.Content.ReadAsStringAsync().Result); } return(obj); }
public JsonResult NewVersion(QuotationNewVersionDto data) { #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 #region AUDIT data.InsertUserId = sessione.SystemUserId; data.ResponsibleSystemUserId = sessione.SystemUserId; #endregion var response = _quotationBL.NewVersion(data, validated.Token); return(Json(response, "application/json", Encoding.UTF8, JsonRequestBehavior.AllowGet)); }