/// <summary> /// /// </summary> /// <param name="Broker"></param> /// <returns></returns> public static int Update(PerfilClientes Broker) { using (MsSqlFacade<PerfilClientes, PerfilClientesMapper> facade = new MsSqlFacade<PerfilClientes, PerfilClientesMapper>()) { //// we use the Collection to build the broker entity on an abstract phase to manage it as a all return facade.Update(Broker); } }
/// <summary> /// /// </summary> /// <param name="context"></param> public void ProcessRequest(HttpContext context) { try { /// this is the empy response string Html = string.Empty; /// Dictionary Collection Native Encryption Dictionary<string, string> Collection = cl.maia.bus.Utils.ContextForm.ProcessNativeEncryptedForm(context.Request.Form); /// new expando object dynamic dynamic_obj = new ExpandoObject(); /// foreach string for the value collection foreach (KeyValuePair<string, string> kvp in Collection) { /// value for the parse id if (kvp.Key == "__id") { dynamic_obj.ID = kvp.Value; } /// value for the parse id if (kvp.Key == "__c") { dynamic_obj.Cliente = kvp.Value; } /// value for the parse id if (kvp.Key == "__t") { dynamic_obj.ToleranciaDistancia = kvp.Value; } /// value for the parse id if (kvp.Key == "__a") { dynamic_obj.AprendizajeCompras = kvp.Value; } /// value for the parse id if (kvp.Key == "__ta") { dynamic_obj.TipoAlerta = kvp.Value; } } PerfilClientes entity = new PerfilClientes(); entity.AprendizajeCompras = int.Parse(dynamic_obj.AprendizajeCompras); entity.Cliente = int.Parse(dynamic_obj.Cliente); entity.ID = int.Parse(dynamic_obj.ID); entity.TipoAlerta = int.Parse(dynamic_obj.TipoAlerta); entity.ToleranciaDistancia = int.Parse(dynamic_obj.ToleranciaDistancia); /// json string json = ClientLogics.UpdatePerfilCliente(entity).ToString(); /// context response context.Response.Write(json); } catch(Exception ex) { /// context response as an error context.Response.Write("{\"acknowledge\": {\"response\": \""+ex.ToString()+"\"}"); } }
/// <summary> /// /// </summary> /// <param name="cliente"></param> /// <returns></returns> public static int UpdatePerfilCliente(PerfilClientes cliente) { try { using (MsSqlFacade<PerfilClientes, PerfilClientesMapper> facade = new MsSqlFacade<PerfilClientes, PerfilClientesMapper>()) { return facade.Update(cliente); } } catch { /// in case that fails, we give an empty list return -1; } }