public static void Invoke_GuardaClienteNuevo(RemObjects.SDK.IROService @__Instance, RemObjects.SDK.IMessage @__Message, RemObjects.SDK.Server.IServerChannelInfo @__ServerChannelInfo, out RemObjects.SDK.Server.ResponseOptions @__oResponseOptions)
 {
     RemObjects.SDK.ObjectDisposer @__ObjectDisposer = new RemObjects.SDK.ObjectDisposer(1);
     try {
         TClienteNuevo Datos = ((TClienteNuevo)(@__Message.Read("Datos", typeof(TClienteNuevo), RemObjects.SDK.StreamingFormat.Default)));
         @__ObjectDisposer.Add(Datos);
         int Result;
         Result = ((IRPDataService)(@__Instance)).GuardaClienteNuevo(Datos);
         @__Message.InitializeResponseMessage(@__ServerChannelInfo, "RPSuiteServer", "RPDataService", "GuardaClienteNuevoResponse");
         @__Message.WriteInt32("Result", Result);
         @__Message.FinalizeMessage();
         @__oResponseOptions = RemObjects.SDK.Server.ResponseOptions.roDefault;
     }
     finally {
         @__ObjectDisposer.Dispose();
     }
 }
Ejemplo n.º 2
0
        public int GuardaClienteNuevo(TClienteNuevo Datos)
        {
            //string[] Params;
            //Params = new string[32];
            Datos.ClienteId = Folio("ClienteID", "");

            int Res = -1;

            //bool Res = false;
            try
            {
                //using (IDbCommand lcommand = this.ServiceSchema.NewCommand(this.Connection, "InsertarClienteNuevo", new string[] { }, new object[] { }))

                //using (IDbCommand lcommand = this.ServiceSchema.NewCommand(this.Connection, "InsertarClienteNuevo", new string[] {"ClienteID", "Codigo"
                //     ,"Nombre" ,"Grupo" ,"Calle" ,"Colonia" ,"Ciudad" ,"Telefono" ,"CodigoPostal" ,"RFC" ,"Curp" ,"LimiteCredito" ,"email"
                //     ,"Localidad" ,"Estado" ,"NoExterior" ,"NoInterior"  ,"CuentaBancaria" }, new object[] {
                //         Datos.ClienteId, Datos.Codigo,Datos.Nombre,Datos.Grupo,Datos.Calle,Datos.Colonia,Datos.Ciudad,Datos.Telefono,Datos.CodigoPostal,Datos.RFC,
                //      Datos.CURP,Datos.LimiteCredito, Datos.Email,Datos.Localidad,Datos.Estado,Datos.NoExterior,Datos.NoInterior,Datos.CuentaBancaria}))


                using (IDbCommand lcommand = this.ServiceSchema.NewCommand(this.Connection, "InsertarClienteNuevo", new string[] { "ClienteID", "Codigo"
                                                                                                                                   , "Nombre", "Grupo", "Calle", "Colonia", "Ciudad", "Telefono", "CodigoPostal", "RFC",
                                                                                                                                   "Curp", "Status", "AutorizaCheque", "TicketBoucher", "AutorizaValeCredito", "LimiteCredito", "email"
                                                                                                                                   , "Localidad", "Estado", "NoExterior", "NoInterior", "CuentaBancaria" }, new object[] {
                    Datos.ClienteId, Datos.Codigo, Datos.Nombre, Datos.Grupo, Datos.Calle, Datos.Colonia, Datos.Ciudad, Datos.Telefono, Datos.CodigoPostal, Datos.RFC,
                    Datos.CURP, Datos.Status, Datos.AutorizaCheque, Datos.TicketBoucher, Datos.AutorizaValeCredito, 0, Datos.Email, Datos.Localidad, Datos.Estado, Datos.NoExterior, Datos.NoInterior, Datos.CuentaBancaria
                }))
                {
                    lcommand.ExecuteNonQuery();
                    Res = Datos.ClienteId;
                }
                // Res = true;
            }
            catch (Exception ex)
            {
                Res = -1;
                // Res = false;
            }

            return(Res);
        }