public void ActualizarCliente(int id, string codCliente, string nombre, string ci, string direccion, string telefono)
        {
            DCliente Cliente = new DCliente();

            Cliente.Id            = id;
            Cliente.CodigoCliente = codCliente;
            Cliente.Nombre        = nombre;
            Cliente.Ci            = ci;
            Cliente.Direccion     = direccion;
            Cliente.Telefono      = telefono;
            Cliente.UpdateCliente();
        }
        public static string Editar(int idcliente, string Nombre, string Apellido, int Dni, string Direccion, string Telefono)
        {
            DCliente Obj = new DCliente();

            Obj.Id        = idcliente;
            Obj.Direccion = Direccion;
            Obj.Nombre    = Nombre;
            Obj.Telefono  = Telefono;
            Obj.Dni       = Dni;
            Obj.Apellido  = Apellido;
            return(Obj.Editar(Obj));
        }
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            DCliente ds = new DCliente();

            global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
            global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
            global::System.Xml.Schema.XmlSchemaAny         any      = new global::System.Xml.Schema.XmlSchemaAny();
            any.Namespace = ds.Namespace;
            sequence.Items.Add(any);
            type.Particle = sequence;
            global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
            if (xs.Contains(dsSchema.TargetNamespace))
            {
                global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                try {
                    global::System.Xml.Schema.XmlSchema schema = null;
                    dsSchema.Write(s1);
                    for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                    {
                        schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                        s2.SetLength(0);
                        schema.Write(s2);
                        if ((s1.Length == s2.Length))
                        {
                            s1.Position = 0;
                            s2.Position = 0;
                            for (; ((s1.Position != s1.Length) &&
                                    (s1.ReadByte() == s2.ReadByte()));)
                            {
                                ;
                            }
                            if ((s1.Position == s1.Length))
                            {
                                return(type);
                            }
                        }
                    }
                }
                finally {
                    if ((s1 != null))
                    {
                        s1.Close();
                    }
                    if ((s2 != null))
                    {
                        s2.Close();
                    }
                }
            }
            xs.Add(dsSchema);
            return(type);
        }
Exemple #4
0
        //metodo editar que llama al metodo Editar de la clase DCliente
        public static string Editar(int id_cliente, int dni, int legajo, string apellido, string nombre, string telefono, string direccion, string email, int habilitado, string fecha_nac, int localidad, decimal monto_alcance, int cuenta_bancaria, byte[] foto, int id_tipo_cliente, int id_sexo, string fecha_compra, int cupo_compra)
        {
            DCliente Obj = new DCliente();

            Obj.Id_cliente = id_cliente;
            Obj.Dni        = dni;
            Obj.Legajo     = legajo;
            Obj.Apellido   = apellido;
            Obj.Nombre     = nombre;
            Obj.Telefono   = telefono;
            Obj.Direccion  = direccion;
            Obj.Email      = email;
            Obj.Habilitado = habilitado;
            if (fecha_nac != string.Empty)
            {
                try
                {
                    Obj.Fecha_nac = Convert.ToDateTime(fecha_nac);
                }
                catch (Exception)
                {
                    Obj.Fecha_nac = System.DateTime.Parse("1900-01-01");
                }
            }
            else
            {
                Obj.Fecha_nac = System.DateTime.Parse("1900-01-01");
            }
            Obj.Localidad       = localidad;
            Obj.Monto_alcance   = monto_alcance;
            Obj.Cuenta_bancaria = cuenta_bancaria;
            Obj.Foto            = foto;
            Obj.Id_tipo_cliente = id_tipo_cliente;
            Obj.Id_sexo         = id_sexo;
            if (fecha_compra != string.Empty)
            {
                try
                {
                    Obj.Fecha_compra = Convert.ToDateTime(fecha_compra);
                }
                catch (Exception)
                {
                    Obj.Fecha_compra = System.DateTime.Parse("1900-01-01");
                }
            }
            else
            {
                Obj.Fecha_compra = System.DateTime.Parse("1900-01-01");
            }
            Obj.Cupo_compra = cupo_compra;
            return(Obj.Editar(Obj));
        }
Exemple #5
0
        public static string EditarDelivery(int idCliente, string nombre, string tipoDoc, string nroDoc, string direccion, string email, string telefono)
        {
            DCliente Obj = new DCliente();

            Obj.IdCliente = idCliente;
            Obj.Nombre    = nombre;
            Obj.TipoDoc   = tipoDoc;
            Obj.NroDoc    = nroDoc;
            Obj.Direccion = direccion;
            Obj.Email     = email;
            Obj.Telefono  = telefono;
            return(Obj.EditarDelivery(Obj));
        }
Exemple #6
0
        private void BtnActualizar_Click(object sender, EventArgs e)
        {
            Cliente      rcliente = new Cliente(cliente.id, txtNombres.Text, txtApellidos.Text, txtDNI.Text, txtCelular.Text, txtTelEmer.Text, dtpNacimiento.Value.Date);
            DialogResult pregunta = MessageBox.Show("Desea actualizar los datos del cliente?", "Aviso", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (pregunta == DialogResult.Yes)
            {
                DCliente cliente = new DCliente();
                cliente.ActualizarCliente(rcliente);
                MessageBox.Show("Los datos del cliente han sido actualizados", "Realizado", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                this.Close();
            }
        }
Exemple #7
0
        public static string InsertarVenta(string nombre, DateTime fechaNac, string tipoDoc, string nroDoc, string direccion, string email, string telefono)
        {
            DCliente Obj = new DCliente();

            Obj.Nombre    = nombre;
            Obj.FechaNac  = fechaNac;
            Obj.TipoDoc   = tipoDoc;
            Obj.NroDoc    = nroDoc;
            Obj.Direccion = direccion;
            Obj.Email     = email;
            Obj.Telefono  = telefono;
            return(Obj.InsertarVenta(Obj));
        }
Exemple #8
0
 public static DataTable BuscarPorNombre(DCliente b)
 {
     using (MySqlConnection cn = new MySqlConnection(Conexion.Cadena))
     {
         var consulta = "SELECT cliente.Id_Cliente,cliente.Nombre as Cliente,cliente.Id_Categoria,categoria_cliente.Nombre as Categoria_Cliente,cliente.Direccion,cliente.Ubicacion,cliente.Zona,cliente.Telefono,cliente.Contacto,cliente.Correo FROM cliente,categoria_cliente where cliente.Id_Categoria=categoria_cliente.Id_Categoria and cliente.Nombre like'%" + b.nombre + "%';";
         var cmdd     = new MySqlCommand(consulta, cn);
         cmdd.Parameters.AddWithValue("@nom", b.nombre);
         MySqlDataAdapter mdatos  = new MySqlDataAdapter(cmdd);
         DataTable        dtDatos = new DataTable();
         cn.Open();
         mdatos.Fill(dtDatos);
         return(dtDatos);
     }
 }
Exemple #9
0
        private void BtnRegistrar_Click(object sender, EventArgs e)
        {
            bool estado = true;

            int edad = DateTime.Now.Year - dtpNacimiento.Value.Year;

            if (txtNombres.Text == string.Empty ||
                txtApellidos.Text == string.Empty ||
                txtDNI.Text == string.Empty ||
                txtTelEmer.Text == string.Empty ||
                txtCelular.Text == string.Empty)
            {
                estado = false;
            }

            Cliente  cliente      = new Cliente(0, txtNombres.Text, txtApellidos.Text, txtDNI.Text, txtCelular.Text, txtTelEmer.Text, dtpNacimiento.Value);
            DCliente datoscliente = new DCliente();



            if (estado == false)
            {
                MessageBox.Show("Todos los campos son obligatorios", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                if (edad <= 15)
                {
                    MessageBox.Show("Solo se permiten participnates de 16 a más", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    DialogResult pregunta = MessageBox.Show("Desea registrar el nuevo cliente", "Aviso", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (pregunta == DialogResult.Yes)
                    {
                        bool error = datoscliente.NuevoCliente(cliente);
                        if (error == true)
                        {
                            MessageBox.Show("Cliente registrado", "Realizado", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            this.Close();
                        }
                        else
                        {
                            MessageBox.Show("El dni ingresado ya ha sido registrado anteriormente", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                }
            }
        }
Exemple #10
0
        public static DCliente EntidadCliente(MySqlDataReader entidad)
        {
            var e = new DCliente();

            e.idcliente   = Convert.ToInt32(entidad["Id_Cliente"]);
            e.nombre      = Convert.ToString(entidad["Nombre"]);
            e.idcategoria = Convert.ToInt32(entidad["Id_Categoria"]);
            e.direccion   = Convert.ToString(entidad["Direccion"]);
            e.ubicacion   = Convert.ToString(entidad["Ubicacion"]);
            e.zona        = Convert.ToInt32(entidad["Zona"]);
            e.telefono    = Convert.ToInt32(entidad["Telefono"]);
            e.contacto    = Convert.ToString(entidad["Contacto"]);
            e.correo      = Convert.ToString(entidad["Correo"]);
            return(e);
        }
Exemple #11
0
        //metodo insertar que llama a insertar de dcategoria en datos
        public static string Insertar(string nombre, string apellidos, string sexo, DateTime fecha_nacimiento, string tipo_documento, string num_documento, string direccion, string telefono, string email)
        {
            DCliente obj = new DCliente();

            obj.Nombre           = nombre;
            obj.Apellidos        = apellidos;
            obj.Sexo             = sexo;
            obj.Fecha_nacimiento = fecha_nacimiento;
            obj.Tipo_documento   = tipo_documento;
            obj.Num_documento    = num_documento;
            obj.Direccion        = direccion;
            obj.Telefono         = telefono;
            obj.Email            = email;
            return(obj.Insertar(obj));
        }
Exemple #12
0
        public static string Editar(int idCliente, string nombre, DateTime fechaNac, string tipoDoc, string nroDoc, string direccion, string email, string telefono, int?idTipoCliente)
        {
            DCliente Obj = new DCliente();

            Obj.IdCliente     = idCliente;
            Obj.Nombre        = nombre;
            Obj.FechaNac      = fechaNac;
            Obj.TipoDoc       = tipoDoc;
            Obj.NroDoc        = nroDoc;
            Obj.Direccion     = direccion;
            Obj.Email         = email;
            Obj.Telefono      = telefono;
            Obj.IdTipoCliente = idTipoCliente;
            return(Obj.Editar(Obj));
        }
        private void button1_Click(object sender, EventArgs e)
        {
            //try
            //{
            if (textBox2.Text != "")
            {
                var c = new DCliente();
                c.idcliente   = Convert.ToInt32(textBox1.Text);
                c.nombre      = textBox2.Text.ToUpper();
                c.idcategoria = Convert.ToInt32(comboBox1.SelectedValue);
                c.direccion   = Convert.ToString(textBox3.Text);
                c.ubicacion   = textBox4.Text;
                c.zona        = Convert.ToInt32(textBox5.Text);
                c.telefono    = Convert.ToInt32(maskedTextBox1.Text);
                c.contacto    = textBox7.Text;;
                c.correo      = textBox8.Text;

                if (isValid(textBox8.Text))
                {
                    if (NCliente.Agregar(c))
                    {
                        MessageBox.Show("Datos guardados correctamente", "Aviso");
                        id();
                        listarcategoria();
                        listar();
                        limpiar();
                    }
                    else
                    {
                        MessageBox.Show("Error", "Aviso");
                    }
                }
                else
                {
                    MessageBox.Show("Revise que su correo electronico contenga el formato correcto", "Error");
                }
            }

            else
            {
                MessageBox.Show("Error", "Aviso");
            }
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message);
            //}
        }
        private void Guardar()
        {
            DateTime?fechnac = string.IsNullOrWhiteSpace(DtpFechaNacimiento.Text) ? (DateTime?)null : Convert.ToDateTime(DtpFechaNacimiento.Text);
            Cliente  be      = new Cliente
            {
                TipoDocumento   = CbxTipoDocumento.SelectedValue.ToString(),
                NumeroDocumento = TxtNumeroDocumento.Text,
                Nombre          = TxtNombres.Text,
                Apellido        = TxtApellidos.Text,
                FechaNacimiento = fechnac,
                Pais            = TxtPais.Text,
                Ciudad          = TxtCiudad.Text,
                Direccion       = TxtDireccion.Text,
                Email           = TxtEmail.Text,
                Telefono        = TxtTelefono.Text,
                Estado          = 1
            };
            DCliente bo = new DCliente();

            if (modificar == 0)
            {
                if (bo.Agregar(be))
                {
                    FrmClientes frm = Owner as FrmClientes;
                    frm.Listar();
                    Close();
                    FrmPrincipal.Main.ChangeMessage("Cliente agregado correctamente", "Success");
                }
                else
                {
                    FrmPrincipal.Main.ChangeMessage("Algo salio mal, Intente de nuevo", "Failed");
                }
            }
            else if (modificar == 1)
            {
                if (bo.Modificar(be))
                {
                    FrmClientes frm = Owner as FrmClientes;
                    frm.Listar();
                    Close();
                    FrmPrincipal.Main.ChangeMessage("Cliente modificado correctamente", "Success");
                }
                else
                {
                    FrmPrincipal.Main.ChangeMessage("Algo salio mal, Intente de nuevo", "Failed");
                }
            }
        }
Exemple #15
0
        //Método Editar que llama al método Insertar de la clase DProveedor
        //de la capaDatos
        public static string Editar(int idcliente, string nombre, string apellidos, string sexo, DateTime fecha_nacimiento,
                                    string tipo_documento, string num_documento, string direccion, string telefono, string email)
        {
            DCliente Obj = new DCliente();

            Obj.Nombre           = nombre;
            Obj.Apellidos        = apellidos;
            Obj.Sexo             = sexo;
            Obj.Fecha_Nacimiento = fecha_nacimiento;
            Obj.Tipo_Documento   = tipo_documento;
            Obj.Num_Documento    = num_documento;
            Obj.Direccion        = direccion;
            Obj.Telefono         = telefono;
            Obj.Email            = email;
            return(Obj.Editar(Obj));
        }
        public static string Insertar(string nombre, string apellidos, string sexo, int edad, DateTime fecha_nac, int ci, int telefono, string pais, string direccion, string email, DateTime fecha_regis)
        {
            DCliente obj = new DCliente();

            obj.Nombres          = nombre;
            obj.Apellidos        = apellidos;
            obj.Sexo             = sexo;
            obj.Edad             = edad;
            obj.FechaNa_cimiento = fecha_nac;
            obj.CI             = ci;
            obj.Telefono       = telefono;
            obj.Pais           = pais;
            obj.Direccion      = direccion;
            obj.Email          = email;
            obj.Fecha_Registro = fecha_regis;

            return(obj.Insertar(obj));
        }
Exemple #17
0
        private void TxtDNI_KeyDown(object sender, KeyEventArgs e)
        {
            DCliente dcliente = new DCliente();

            if (e.KeyCode == Keys.Enter)
            {
                cliente = dcliente.listarClienteDni(txtDNI.Text);
                if (cliente == null)
                {
                    MessageBox.Show("El cliente no encontrado", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    txtApellidos.Text = cliente.apellido;
                    txtNombres.Text   = cliente.nombre;
                }
            }
        }
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         var c = new DCliente();
         c.idcliente   = Convert.ToInt32(textBox1.Text);
         c.nombre      = textBox2.Text.ToUpper();
         c.idcategoria = Convert.ToInt32(comboBox1.SelectedValue);
         c.direccion   = Convert.ToString(textBox3.Text);
         c.ubicacion   = textBox4.Text;
         c.zona        = Convert.ToInt32(textBox5.Text);
         c.telefono    = Convert.ToInt32(maskedTextBox1.Text);
         c.contacto    = textBox7.Text;;
         c.correo      = textBox8.Text;
         if (isValid(textBox8.Text))
         {
             if (NCliente.Actualizar(c))
             {
                 MessageBox.Show("Se actualizo correctamente", "Aviso");
                 id();
                 listarcategoria();
                 listar();
                 limpiar();
                 button1.Enabled = true;
                 button2.Enabled = false;
                 button3.Enabled = false;
                 button4.Enabled = false;
             }
             else
             {
                 MessageBox.Show("Error", "Aviso");
             }
         }
         else
         {
             MessageBox.Show("Revise que su correo electronico contenga el formato correcto", "Error");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        public static string Ingresar(string estatus, string nombre, string apellido, string telefono,
                                      string direccion, string ciudad, string sector, string contacto, string telefonocontacto, string tipoidentificacion,
                                      string identificacion, string correoelectronico)
        {
            DCliente obj = new DCliente();

            obj.Estatus            = estatus;
            obj.Nombre             = nombre;
            obj.Apellido           = apellido;
            obj.Telefono           = telefono;
            obj.Direccion          = direccion;
            obj.Ciudad             = ciudad;
            obj.Sector             = sector;
            obj.Contacto           = contacto;
            obj.TelefonoContacto   = telefonocontacto;
            obj.TipoIdentificacion = tipoidentificacion;
            obj.Identificacion     = identificacion;
            obj.CorreoElectronico  = correoelectronico;
            return(obj.InsetarCliente(obj));
        }
Exemple #20
0
        //Metodo Editar que llama instancia el objeto dproveedor de la capa datos

        public static string Editar(int pIdcliente, string pNombre, string pApellidos,
                                    string pSexo, DateTime pFechaNac,
                                    string pTipoDocumento, string pNumDocumento,
                                    string pDireccion, string pTelefono,
                                    string pEmail)
        {
            DCliente objCliente = new DCliente();

            objCliente.Idcliente       = pIdcliente;
            objCliente.Nombre          = pNombre;
            objCliente.Apellido        = pApellidos;
            objCliente.Sexo            = pSexo;
            objCliente.FechaNacimiento = pFechaNac;
            objCliente.TipoDocumento   = pTipoDocumento;
            objCliente.NumDocumento    = pNumDocumento;
            objCliente.Direccion       = pDireccion;
            objCliente.Telefono        = pTelefono;
            objCliente.Email           = pEmail;

            return(objCliente.Editar(objCliente));
        }
 private void TxtNumeroDocumento_Leave(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(TxtNumeroDocumento.Text))
     {
         BtnGuardar.Enabled = false;
         TxtNumeroDocumento.Focus();
     }
     else
     {
         DCliente bo = new DCliente();
         if (bo.VerificarNumeroDocumento(TxtNumeroDocumento.Text))
         {
             BtnGuardar.Enabled           = true;
             TxtNumeroDocumento.BackColor = Color.FromArgb(126, 225, 154);
         }
         else
         {
             BtnGuardar.Enabled           = false;
             TxtNumeroDocumento.BackColor = Color.FromArgb(241, 115, 117);
             TxtNumeroDocumento.Focus();
         }
     }
 }
Exemple #22
0
        public static void BuscarPorDni(DataGridView dgv, string dni)
        {
            DCliente obj = new DCliente();

            obj.BuscarPorDni(dgv, dni);
        }
Exemple #23
0
        public static void BuscarPorNombre(DataGridView dgv, string nombre)
        {
            DCliente obj = new DCliente();

            obj.BuscarPorNombre(dgv, nombre);
        }
Exemple #24
0
        public static string Eliminar(int id)
        {
            DCliente obj = new DCliente();

            return(obj.Eliminar(id));
        }
        public static DataTable Mostrar()
        {
            DCliente obj = new DCliente();

            return(obj.Mostrar());
        }
Exemple #26
0
        public static bool DniExistente(string dniNuevo)
        {
            DCliente obj = new DCliente();

            return(obj.DniExistente(dniNuevo));
        }
Exemple #27
0
        public static void Mostrar(DataGridView dgv)
        {
            DCliente obj = new DCliente();

            obj.Mostrar(dgv);
        }
Exemple #28
0
        public static DataTable mostrarClienteVenta1()
        {
            DCliente Obj = new DCliente();

            return(Obj.mostrarClienteVenta1(Obj));
        }
Exemple #29
0
        public static DataTable consultaClienteCredito(string tipoCliente, int idVenta)
        {
            DCliente Obj = new DCliente();

            return(Obj.ConsultaClienteCredito(tipoCliente, idVenta));
        }
            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs)
            {
                global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
                global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
                DCliente ds = new DCliente();

                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
                any1.Namespace       = "http://www.w3.org/2001/XMLSchema";
                any1.MinOccurs       = new decimal(0);
                any1.MaxOccurs       = decimal.MaxValue;
                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any1);
                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
                any2.Namespace       = "urn:schemas-microsoft-com:xml-diffgram-v1";
                any2.MinOccurs       = new decimal(1);
                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any2);
                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute1.Name       = "namespace";
                attribute1.FixedValue = ds.Namespace;
                type.Attributes.Add(attribute1);
                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute2.Name       = "tableTypeName";
                attribute2.FixedValue = "ClienteDataTable";
                type.Attributes.Add(attribute2);
                type.Particle = sequence;
                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
                if (xs.Contains(dsSchema.TargetNamespace))
                {
                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                    try {
                        global::System.Xml.Schema.XmlSchema schema = null;
                        dsSchema.Write(s1);
                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                        {
                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                            s2.SetLength(0);
                            schema.Write(s2);
                            if ((s1.Length == s2.Length))
                            {
                                s1.Position = 0;
                                s2.Position = 0;
                                for (; ((s1.Position != s1.Length) &&
                                        (s1.ReadByte() == s2.ReadByte()));)
                                {
                                    ;
                                }
                                if ((s1.Position == s1.Length))
                                {
                                    return(type);
                                }
                            }
                        }
                    }
                    finally {
                        if ((s1 != null))
                        {
                            s1.Close();
                        }
                        if ((s2 != null))
                        {
                            s2.Close();
                        }
                    }
                }
                xs.Add(dsSchema);
                return(type);
            }