public JsonResult update(int id, string name) { try { if (PValidateHeader(Request.Headers["Authorization"].ToString())) { uspGEBrandSearch_Result data = new uspGEBrandSearch_Result(); data.idBrand = id; data.name = name; DABrand brand = new DABrand(PUser); ENResult result = brand.update(data); result.token = PCreateToken(); return(Json(result)); } else { return(PSecurityError()); } } catch (Exception ex) { return(PUnexpectedError(ex)); } }