Beispiel #1
0
        public void preenchegrid()
        {
            clsCliente    teste  = new clsCliente();
            clsClienteBLL teste1 = new clsClienteBLL();

            dtgw_dados.DataSource = teste1.SelectCliente(teste);
        }
        //Actualizar cliente
        public bool Update(clsCliente update)
        {
            try
            {
                con.conectarBD();

                cmd             = new MySqlCommand("update_cliente", con.conector);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("nom", update.Nombre);
                cmd.Parameters.AddWithValue("apell", update.Apellidos);
                cmd.Parameters.AddWithValue("sex", update.Sexo);
                cmd.Parameters.AddWithValue("t_document", update.Tipo_documento);
                cmd.Parameters.AddWithValue("document", update.Documento);
                cmd.Parameters.AddWithValue("dire", update.Direccion);
                cmd.Parameters.AddWithValue("cel", update.Celular);
                cmd.Parameters.AddWithValue("ema", update.Email);
                cmd.Parameters.AddWithValue("codigo", update.Id_Cliente);

                int resultado = cmd.ExecuteNonQuery();

                if (resultado != 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }

            catch (MySqlException ex) { throw ex; }

            finally { con.conector.Dispose(); cmd.Dispose(); con.desconectarBD(); }
        }
        public clsCliente getClient(int id)
        {
            clsManejadoraClienteDAL manejadora = new clsManejadoraClienteDAL();
            clsCliente res = manejadora.getClient(id);

            return(res);
        }
Beispiel #4
0
        public static void EncontrarCliente(long parCedula)
        {
            clsCliente varObjCliente = new clsCliente();

            varObjCliente.Encontrar(parCedula);
            atrMensajeResultado = varObjCliente.ObtenerNombre;
        }
        /*LLAMADA A FUNCIONES DAL PARA MANEJAR PERSONAS CON RESTICCIONES SEGUN
         *  PRETENDA LA EMPRESA.
         */

        public int insertaClienteBL(clsCliente cliente)
        {
            clsManejadoraClienteDAL manejadora = new clsManejadoraClienteDAL();
            int res = manejadora.insertClient(cliente);

            return(res);
        }
        public int updateClient(clsCliente cliente)
        {
            clsManejadoraClienteDAL manejadora = new clsManejadoraClienteDAL();
            int res = manejadora.updateClient(cliente);

            return(res);
        }
Beispiel #7
0
        private void btnFormClienteGuardar_Click(object sender, EventArgs e)
        {
            string msg = this.ValidarCliente();

            if (msg.Equals(string.Empty))
            {
                clsCliente cliente = new clsCliente(tbDni.Text, tbNombre.Text, tbApellido.Text, tbCorreo.Text, tbTelefono.Text, tbDireccion.Text);
                //Se esta guardando registro nuevo
                //se esta actualizando registro, por lo tanto no esta disponible btnLimpiar
                msg = (btnFormClienteLimpiar.Visible) ? cliente.Guardar() : cliente.Actualizar();
                if (msg.Equals(string.Empty))
                {
                    dgvClienteConfig();
                    btnFormClienteCancelar.PerformClick();
                    tbBuscar.Clear();
                }
                else
                {
                    MessageBox.Show(msg, "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show(msg, "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Beispiel #8
0
 public void EnviarAlertas()
 {
     clsCliente objCliente = new clsCliente();
     DataSet dt = objCliente.ConsultarCorreos();
     int n = dt.Tables[0].Rows.Count;
     if (n > 0)
     {
         String cadenaCorreos = dt.Tables[0].Rows[0].ItemArray[0] + "";
         for (int i = 1; i < n; i++)
         {
             cadenaCorreos = cadenaCorreos + ", " + dt.Tables[0].Rows[i].ItemArray[0];
         }
         System.Net.Mail.MailMessage correo = new System.Net.Mail.MailMessage();
         correo.From = new System.Net.Mail.MailAddress("*****@*****.**");
         correo.To.Add(cadenaCorreos);
         correo.Subject = "Nueva Norma publicada por SBDA";
         correo.Body = "SBDA acaba de publicar la norma " + this.txtNombre.Text + " en la plataforma de busqueda.";
         correo.IsBodyHtml = false;
         correo.Priority = System.Net.Mail.MailPriority.Normal;
         System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient();
         smtp.Host = "mail.sbda.org.bo";
         //smtp.Port = 25;
         //smtp.Host = "servidor de correo";
         smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "abc123ABC");
         //smtp.EnableSsl = false;
         try
         {
             smtp.Send(correo);
         }
         catch (Exception ex)
         {
             //ex.Message;
         }
     }
 }
Beispiel #9
0
        protected void btnConsultar_Click(object sender, ImageClickEventArgs e)
        {
            string strDocumento;

            strDocumento = txtDocumento.Text;

            clsCliente oCliente = new clsCliente();

            oCliente.Documento = strDocumento;

            if (oCliente.Consultar1())
            {
                txtNombre.Text          = oCliente.Nombre;
                txtPrimerApellido.Text  = oCliente.PrimerApellido;
                txtSegundoApellido.Text = oCliente.SegundoApellido;
                txtDireccion.Text       = oCliente.Direccion;
                lblError.Text           = "";
            }
            else
            {
                lblError.Text = oCliente.Error;

                txtNombre.Text          = "";
                txtPrimerApellido.Text  = "";
                txtSegundoApellido.Text = "";
                txtDireccion.Text       = "";
            }
            oCliente = null;
        }
Beispiel #10
0
        protected void btnActualizar_Click(object sender, EventArgs e)
        {
            string strDocumento, strNombre, strPrimerApellido, strSegundoApellido;
            string strDireccion;

            strDocumento       = txtDocumento.Text;
            strNombre          = txtNombre.Text;
            strPrimerApellido  = txtPrimerApellido.Text;
            strSegundoApellido = txtSegundoApellido.Text;
            strDireccion       = txtDireccion.Text;


            clsCliente oCliente = new clsCliente();

            oCliente.Documento       = strDocumento;
            oCliente.Nombre          = strNombre;
            oCliente.PrimerApellido  = strPrimerApellido;
            oCliente.SegundoApellido = strSegundoApellido;
            oCliente.Direccion       = strDireccion;


            if (oCliente.Actualizar())
            {
                lblError.Text = "Actualizó";
            }
            else
            {
                lblError.Text = oCliente.Error;
            }

            oCliente = null;
        }
        private void Buscar()
        {
            try
            {
                if (!validarBusqueda())
                {
                    return;
                }
                clsCliente objCliente = new clsCliente(strNombreApp);
                objCliente.Documento = this.txtDocumento.Text;


                if (!objCliente.BuscarCliente())
                {
                    this.lblMensaje.Text   = objCliente.Error;
                    this.pnlAlerta.Visible = true;
                    objCliente             = null;
                    return;
                }
                this.txtNombre.Text    = objCliente.Nombre;
                this.txtEmail.Text     = objCliente.Email;
                this.txtNombre.Enabled = false;
                this.txtEmail.Enabled  = false;
                this.pnlAlerta.Visible = false;
            }
            catch (Exception ex)
            {
                this.lblMensaje.Text   = ex.Message;
                this.pnlAlerta.Visible = true;
                return;
            }
        }
Beispiel #12
0
    protected void btnInsertar_Click(object sender, EventArgs e)
    {
        //CLIENTE 2
        clsUsuario objUsuario = new clsUsuario();
        objUsuario.TIPOUSUARIO = "2";
        int n = objUsuario.Insertar();

        clsCliente objCliente = new clsCliente();
        if ((!this.txtNombre.Text.Equals("")) && (!this.txtApellido.Text.Equals("")) && (!this.txtCuenta.Text.Equals("")) && (!this.txtClave.Text.Equals("")) && (!this.txtCorreo.Text.Equals("")) && (!this.txtEmpresa.Text.Equals("")) && (!this.txtLista.Text.Equals("")) && ((this.rbtnSi.Checked) || (this.rbtnNo.Checked)))
        {
            //aqui inserto un registro
            objCliente.ID = n +"";
            objCliente.NOMBRE = this.txtNombre.Text;
            objCliente.APELLIDO = this.txtApellido.Text;
            objCliente.CUENTA = this.txtCuenta.Text;
            objCliente.CLAVE = this.txtClave.Text;
            objCliente.CORREO = this.txtCorreo.Text;
            objCliente.EMPRESA = this.txtEmpresa.Text;
            objCliente.URL = this.txtLista.Text;
            if (this.rbtnSi.Checked)
                objCliente.ESTADO = "si";
            else
                objCliente.ESTADO = "no";
            objCliente.Insertar();
            Response.Redirect("listaCliente.aspx");
        }
        else
        {
            this.lblMensaje.Text = "Faltan campos por llenar, intente nuevamente.";
        }
    }
Beispiel #13
0
        protected void btnConsultar_Click(object sender, EventArgs e)
        {
            string sDocumento;

            sDocumento = txtDocumento.Text;

            clsCliente oCliente = new clsCliente();

            oCliente.Documento = sDocumento;

            if (oCliente.Consultar())
            {
                txtNombre.Text          = oCliente.Nombre;
                txtPrimerApellido.Text  = oCliente.PrimerApellido;
                txtSegundoApellido.Text = oCliente.SegundoApellido;
                txtTelefono.Text        = oCliente.Telefono;
                txtEmail.Text           = oCliente.Email;
                lblError.Text           = "";
            }
            else
            {
                lblError.Text           = oCliente.Error;
                txtNombre.Text          = "";
                txtPrimerApellido.Text  = "";
                txtSegundoApellido.Text = "";
                txtTelefono.Text        = "";
                txtEmail.Text           = "";
            }
            oCliente = null;
        }
        //Eliminar Cliente
        public bool Delete(clsCliente delete)
        {
            try
            {
                con.conectarBD();

                cmd = new MySqlCommand("delete_cliente", con.conector);
                cmd.Parameters.AddWithValue("codigo", delete.Id_Cliente);
                cmd.CommandType = CommandType.StoredProcedure;


                int resultado = cmd.ExecuteNonQuery();

                if (resultado != 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }

            catch (MySqlException ex) { throw ex; }

            finally { con.conector.Dispose(); cmd.Dispose(); con.desconectarBD(); }
        }
        public ActionResult Create(clsCliente cliente)
        {
            //if el cliente no es valido
            if (!ModelState.IsValid)
            {
                return(View(cliente));
            }
            else
            {
                try
                {
                    clsManejadoraclienteBL manejadora = new clsManejadoraclienteBL();

                    manejadora.insertaClienteBL(cliente);
                    clslistadosBL lista = new clslistadosBL();



                    return(View("listado", lista.getListadoClientesBL()));
                }
                catch
                {
                    return(View("Error"));
                }
            }
        }
        public ActionResult ModificarCliente(string idCliente)
        {
            clsServicioCooperativa objServicioCooperativa = new clsServicioCooperativa();

            try
            {
                if (Session["login"] != null)
                {
                    string strServicio = Session["cooperativa"].ToString();

                    lstCliente = (List <clsCliente>)Session["clientesRegistrados"];
                    clsCliente objCliente = lstCliente.Find(x => x.idCliente == int.Parse(idCliente));

                    if (objCliente != null)
                    {
                        return(View(objCliente));
                    }
                    else
                    {
                        return(RedirectToAction("Error", "Home"));
                    }
                }
                else
                {
                    return(RedirectToAction("Login", "Home"));
                }
            }
            catch (Exception)
            {
                return(RedirectToAction("Error", "Home"));
            }
        }
Beispiel #17
0
 private void txtCodCliente_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F1)
     {
         if (Application.OpenForms["frmClientesLista"] != null)
         {
             Application.OpenForms["frmClientesLista"].Activate();
         }
         else
         {
             frmClientesLista form = new frmClientesLista();
             form.Proceso = 3;
             //form.Tipo = cmbTipoCodigo.SelectedIndex;
             form.ShowDialog();
             cli        = form.cli;
             CodCliente = cli.CodCliente;
             if (CodCliente != 0)
             {
                 CargaCliente();
                 btnNuevo.Enabled = true; ProcessTabKey(true);
                 txtDocRef.Focus();
             }
         }
     }
 }
Beispiel #18
0
 private void CargaCliente()
 {
     cli = AdmCli.MuestraCliente(CodCliente);
     cli = AdmCli.CargaDeuda(cli);
     if (cli.Cantidad > 0)
     {
         DialogResult dlgResult = MessageBox.Show("El cliente selecionado presenta" + Environment.NewLine + "Facturas pendientes = " + cli.Cantidad + Environment.NewLine + "Deuda Total = " + cli.Deuda + " soles" + Environment.NewLine + "Linea de crédito = " + cli.LineaCredito + Environment.NewLine + " Desea continuar con la venta?", "Venta", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dlgResult == DialogResult.No)
         {
             ret = 1;
             //txtCotizacion.Text = "";
             return;
         }
         else
         {
             cargadatoscliente();
             ret = 0;
         }
     }
     else
     {
         cargadatoscliente();
         ret = 0;
     }
 }
Beispiel #19
0
        protected void btnActualizar_Click(object sender, EventArgs e)
        {
            string sNombre, sPrimerApellido, sDocumento, sSegundoApellido, sTelefono, sEmail;

            sDocumento       = txtDocumento.Text;
            sNombre          = txtNombre.Text;
            sPrimerApellido  = txtPrimerApellido.Text;
            sSegundoApellido = txtSegundoApellido.Text;
            sTelefono        = txtTelefono.Text;
            sEmail           = txtEmail.Text;

            clsCliente oCliente = new clsCliente();

            oCliente.Documento       = sDocumento;
            oCliente.Nombre          = sNombre;
            oCliente.PrimerApellido  = sPrimerApellido;
            oCliente.SegundoApellido = sSegundoApellido;
            oCliente.Telefono        = sTelefono;
            oCliente.Email           = sEmail;

            if (oCliente.Actualizar())
            {
                lblError.Text = "Actualizó";
            }
            else
            {
                lblError.Text = oCliente.Error;
            }
            oCliente = null;
        }
Beispiel #20
0
        private void btnupdate_Click(object sender, EventArgs e)
        {
            try
            {
                cCliente = new clsCliente();

                if (isValidate())
                {
                    cCliente.Id_Cliente     = Convert.ToInt32(textcodigo.Text);
                    cCliente.Nombre         = textnombre.Text.ToUpper();
                    cCliente.Apellidos      = txtapellidos.Text.ToUpper();
                    cCliente.Sexo           = combosexo.SelectedItem.ToString();
                    cCliente.Tipo_documento = combodocumento.SelectedItem.ToString().ToUpper();
                    cCliente.Documento      = txtdocumento.Text;
                    cCliente.Direccion      = textdireccion.Text.ToUpper();
                    cCliente.Celular        = textcelular.Text;


                    if (MessageBox.Show("¿ ESTA SEGURO DE MODIFICAR LOS DATOS DEL CLIENTE ?", "CONFIRMAR ACTUALIZACIÓN", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        if (AdminCliente.update(cCliente))
                        {
                            MessageBox.Show("CLIENTE MODIFICADO CORRECTAMENTE ", "CONFIRMAR ACTUALIZACIÓN", MessageBoxButtons.OK,
                                            MessageBoxIcon.Information);
                            LimpiarCajas("");
                            ListarClientes();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error del sistema : " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #21
0
        private void AgregarCliente()
        {
            lblMsj.Text = "";

            objCliente                   = new clsCliente();
            objCliente.gsIdCliente       = txtIdCliente.Text;
            objCliente.gsApellidoCliente = txtApellidos.Text;
            objCliente.gsEmailCliente    = txtEmail.Text;
            objCliente.gsIdCiudadCliente = Convert.ToInt16(ddlCiudad.SelectedValue);
            objCliente.gsNombreCliente   = txtNombres.Text;
            objCliente.gsTelefonoCliente = txtTelefono.Text;
            objCliente.gsFechaNacCliente = dtmFechaNac.SelectedDate;
            objCliente.gsIdGenero        = Convert.ToInt16(ddlGenero.SelectedValue);

            if (objCliente.GrabarCliente())
            {
                gvCliente.DataSource = (DataTable)Session["varDtDetalle"];
                gvCliente.DataBind();
                lblMsj.Text = "Se agrego el registro exitosamente";
            }
            else
            {
                lblMsj.Text = objCliente.gError;
            }
            gvCliente = null;
            LimpiarCliente();
        }
Beispiel #22
0
 public void AgregarRegistro(clsCliente cli)
 {
     if (EscribirRegistro(this.nregs, cli))
     {
         this.nregs++;
     }
 }
Beispiel #23
0
 private void CargaCliente(Int32 Codigo)
 {
     cli             = AdmCli.MuestraCliente(Codigo);
     txtUnCli.Text   = cli.RucDni;
     txtCodCli.Text  = cli.CodCliente.ToString();
     txtCliente.Text = cli.RazonSocial;
 }
Beispiel #24
0
 public bool EscribirRegistro(int i, clsCliente obj)
 {
     try
     {
         if (i >= 0 && i <= nregs)
         {
             if (obj.Tamaño + 4 > tamañoReg)
             {
                 Console.WriteLine("Tamaño de registro excedido.");
                 return(false);
             }
             else
             {
                 bw.BaseStream.Seek(i * this.tamañoReg, SeekOrigin.Begin);
                 bw.Write(obj.idcli);
                 bw.Write(obj.Nombre);
                 bw.Write(obj.Apellido);
                 bw.Write(obj.Dni);
                 bw.Write(obj.Domicilio);
                 bw.Write(obj.Telefono);
                 bw.Write(obj.Cuenta);
                 bw.Write(obj.Email);
                 return(true);
             }
         }
         else
         {
             return(false);
         }
     }
     catch (IOException e) { CerrarFichero(); Console.WriteLine(e.Message); return(false); }
 }
Beispiel #25
0
        IEnumerable <clsCliente> listado(string nombre)
        {
            List <clsCliente> temporal = new List <clsCliente>();

            if (nombre == "")
            {
                return(temporal);
            }
            else
            {
                SqlCommand cmd = new SqlCommand("sp_cliente_filtro", cn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@nombre", nombre);
                cn.Open();
                SqlDataReader dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    clsCliente reg = new clsCliente()
                    {
                        idcliente  = dr.GetString(0),
                        nombrecia  = dr.GetString(1),
                        direccion  = dr.GetString(2),
                        nombrepais = dr.GetString(3),
                        telefono   = dr.GetString(4)
                    };
                    temporal.Add(reg);
                }
                dr.Close();
                cn.Close();
            }
            return(temporal);
        }
Beispiel #26
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            try
            {
                if (Application.OpenForms["Formcliente"] != null)
                {
                    Application.OpenForms["Formcliente"].Activate();
                }
                else
                {
                    FormCliente form = new FormCliente();
                    form.ShowDialog();

                    if (form.cCliente != null && form.cCliente.Id_Cliente != 0)
                    {
                        cCliente          = form.cCliente;
                        txtidcliente.Text = cCliente.Id_Cliente.ToString();
                        textcliente.Text  = cCliente.Nombre.ToString() + " " + cCliente.Apellidos.ToString();
                        txtdocumento.Text = cCliente.Documento.ToString();
                        txtdireccion.Text = cCliente.Direccion.ToString();
                        txtcelular.Text   = cCliente.Celular;
                        textcliente.Select();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error del sistema : " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #27
0
        public clsCliente ConsultaCliente(String DNIRUC)
        {
            clsCliente cli = null;

            try
            {
                con.conectarBD();
                cmd = new MySqlCommand("ConsultaCliente", con.conector);
                cmd.Parameters.AddWithValue("cliDNIRUC", DNIRUC);
                cmd.CommandType = CommandType.StoredProcedure;
                dr = cmd.ExecuteReader();
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        cli                = new clsCliente();
                        cli.CodCliente     = Convert.ToInt32(dr.GetDecimal(0));
                        cli.Dni            = dr.GetString(1);
                        cli.Ruc            = dr.GetString(2);
                        cli.RazonSocial    = dr.GetString(3);
                        cli.DireccionLegal = dr.GetString(4);
                    }
                }
                return(cli);
            }
            catch (MySqlException ex)
            {
                throw ex;
            }
            finally { con.conector.Dispose(); cmd.Dispose(); con.desconectarBD(); }
        }
Beispiel #28
0
        public void actualizar_cliente()
        {
            try
            {
                if (lista_tipodoc == null)
                {
                    MessageBox.Show("No se ha poido cargar los tipos de documento...", "Advertencia");
                    return;
                }

                cliente = new clsCliente()
                {
                    Idcliente              = int.Parse(txt_codigo.Text),
                    Nombreyapellido        = txt_razon_social.Text,
                    Tipodocumentoidentidad = lista_tipodoc[cb_tipodoc.SelectedIndex],
                    Documento              = txt_documento.Text,
                    Direccion              = txt_direccion.Text,
                    Estado = (cb_estado.SelectedItem.ToString() == "ACTIVO") ? 1 : 0
                };

                if (admcli.actualizar_cliente(cliente) > 0)
                {
                    MessageBox.Show("Actualización correcta...", "Información");
                }
                else
                {
                    MessageBox.Show("Problemas para actulizar cliente...", "Advertencia");
                }
            }
            catch (Exception) { }
        }
Beispiel #29
0
        private void btnsave_Click(object sender, EventArgs e)
        {
            try
            {
                cCliente = new clsCliente();

                if (isValidate())
                {
                    cCliente.Nombre         = textnombre.Text.ToUpper();
                    cCliente.Apellidos      = txtapellidos.Text.ToUpper();
                    cCliente.Sexo           = combosexo.SelectedItem.ToString();
                    cCliente.Tipo_documento = combodocumento.SelectedItem.ToString().ToUpper();
                    cCliente.Documento      = txtdocumento.Text;
                    cCliente.Direccion      = textdireccion.Text.ToUpper();
                    cCliente.Celular        = textcelular.Text;
                    cCliente.Email          = textemail.Text.ToUpper();

                    if (AdminCliente.insert(cCliente))
                    {
                        MessageBox.Show("CLIENTE REGISTRADO CORRECTAMENTE", "CONFIRMAR REGISTRO", MessageBoxButtons.OK,
                                        MessageBoxIcon.Information);
                        ListarClientes();
                        LimpiarCajas("");
                        errorProvider1.Clear();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error del sistema : " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #30
0
 public clsCliente CargaFacturasVencidas(clsCliente cliente)
 {
     try
     {
         con.conectarBD();
         cmd = new MySqlCommand("ConsultarFacturasVencidas", con.conector);
         cmd.Parameters.AddWithValue("codcli", cliente.CodCliente);
         cmd.CommandType = CommandType.StoredProcedure;
         dr = cmd.ExecuteReader();
         if (dr.HasRows)
         {
             while (dr.Read())
             {
                 cliente.Cantidad = Convert.ToInt32(dr.GetDecimal(0));
                 cliente.Deuda    = dr.GetDecimal(1);
             }
         }
         return(cliente);
     }
     catch (MySqlException ex)
     {
         throw ex;
     }
     finally { con.conector.Dispose(); cmd.Dispose(); con.desconectarBD(); }
 }
Beispiel #31
0
 private void CargaNotaSalida()
 {
     try
     {
         venta = AdmVenta.CargaFacturaVenta(CodNotaS);
         if (venta != null)
         {
             txtDocRef.Text          = venta.SiglaDocumento + " - " + venta.Serie + " - " + venta.NumDoc;
             txtTipoCambio.Text      = venta.TipoCambio.ToString();
             cmbMoneda.SelectedValue = venta.Moneda;
             if (txtCodCliente.Enabled)
             {
                 CodCliente            = venta.CodCliente;
                 cli                   = AdmCli.MuestraCliente(CodCliente);
                 txtCodCliente.Text    = cli.RucDni;
                 txtNombreCliente.Text = cli.Nombre;
             }
             CargaDetalleNota();
         }
         else
         {
             MessageBox.Show("El documento solicitado no existe", "Nota de Credito", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         return;
     }
 }
Beispiel #32
0
 private void btnAgregar_Click(object sender, EventArgs e)
 {
     if (flgCodCli == 0)
     {
         cli = new clsCliente();
         if ((txtDNIRUC.Text).Length > 8)
         {
             cli.Ruc            = txtDNIRUC.Text;
             cli.RazonSocial    = txtRazSocial.Text;
             cli.DireccionLegal = txtDireccion.Text;
         }
         else
         {
             cli.Dni            = txtDNIRUC.Text;
             cli.Nombre         = txtRazSocial.Text;
             cli.RazonSocial    = txtRazSocial.Text;
             cli.DireccionLegal = txtDireccion.Text;
         }
         cli.FormaPago = 6;
         cli.CodUser   = frmLogin.iCodUser;
         AdmCliente.insert(cli);
         cli.CodCliente = cli.CodClienteNuevo;
     }
     AdmCliente.insertConCli(codEntConsExt, cli.CodCliente);
     CargaLista();
     flgCodCli         = 0;
     txtDNIRUC.Text    = "";
     txtRazSocial.Text = "";
     txtDireccion.Text = "";
     txtDNIRUC.Focus();
 }
Beispiel #33
0
    private void EliminarRegistro(String id)
    {
        clsCliente objCliente = new clsCliente();
        objCliente.ID = id;
        objCliente.Eliminar();

        clsUsuario objUsuario = new clsUsuario();
        objUsuario.ID = id;
        objUsuario.Eliminar();
    }
Beispiel #34
0
    protected void btnEnviar_Click(object sender, EventArgs e)
    {
        clsCliente objCliente = new clsCliente();
        DataSet dt = objCliente.ConsultarDatos(this.txtCorreo.Text);
        int n = dt.Tables[0].Rows.Count;
        if (n > 0)
        {
            String nombre = dt.Tables[0].Rows[0].ItemArray[0] + "";
            String apellido = dt.Tables[0].Rows[0].ItemArray[1] + "";
            String cuenta = dt.Tables[0].Rows[0].ItemArray[2] + "";
            String clave = dt.Tables[0].Rows[0].ItemArray[3] + "";

            System.Net.Mail.MailMessage correo = new System.Net.Mail.MailMessage();
            correo.From = new System.Net.Mail.MailAddress("*****@*****.**");
            correo.To.Add(this.txtCorreo.Text);
            correo.Subject = "Datos de acceso para SBDA";
            correo.Body = nombre + " " + apellido + ", Cuenta: " + cuenta + ", Clave: " + clave;
            correo.IsBodyHtml = false;
            correo.Priority = System.Net.Mail.MailPriority.Normal;
            //
            System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient();
            smtp.Host = "mail.sbda.org.bo";
            //smtp.Port = 25;
            //smtp.Host = "servidor de correo";
            smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "abc123ABC");
            //smtp.EnableSsl = false;
            try
            {
                smtp.Send(correo);
                Response.Redirect("login.aspx");
            }
            catch (Exception ex)
            {
                lblError.Text = "ERROR: " + ex.Message;
            }
        }
        else
        {
            this.lblError.Text = "Inserte los datos nuevamente.";
        }
    }
Beispiel #35
0
    protected void btnInsertar_Click(object sender, EventArgs e)
    {
        TextBox txtNombre = (TextBox)FormView1.FindControl("txtNombre");
        TextBox txtApellido = (TextBox)FormView1.FindControl("txtApellido");
        TextBox txtCuenta = (TextBox)FormView1.FindControl("txtCuenta");
        TextBox txtClave = (TextBox)FormView1.FindControl("txtClave");
        TextBox txtCorreo = (TextBox)FormView1.FindControl("txtCorreo");
        TextBox txtEmpresa = (TextBox)FormView1.FindControl("txtEmpresa");
        TextBox txtLista = (TextBox)FormView1.FindControl("txtLista");
        RadioButtonList rbtnList = (RadioButtonList)FormView1.FindControl("rbtnList");

        clsCliente objCliente = new clsCliente();
        objCliente.NOMBRE = txtNombre.Text;
        objCliente.APELLIDO = txtApellido.Text;
        objCliente.CUENTA = txtCuenta.Text;
        objCliente.CLAVE = txtClave.Text;
        objCliente.CORREO = txtCorreo.Text;
        objCliente.EMPRESA = txtEmpresa.Text;
        objCliente.URL = txtLista.Text;

        if (rbtnList.SelectedValue.Equals("si"))
            objCliente.ESTADO = "si";
        else
            objCliente.ESTADO = "no";

        if ((this.IDEN != null) && (!objCliente.EMPRESA.Equals("")) && (!objCliente.URL.Equals("")) && (!objCliente.NOMBRE.Equals("")) && (!txtApellido.Text.Equals("")) && (!txtCuenta.Text.Equals("")) && (!txtClave.Text.Equals("")) && (!txtCorreo.Text.Equals("")) && (!rbtnList.SelectedValue.Equals("")) && (txtCorreo.Text.Contains(".") && (txtCorreo.Text.Contains("@"))))
        {
            //aqui modifico el registro
            objCliente.ID = this.IDEN;
            objCliente.Modificar();
            Response.Redirect("listaCliente.aspx");
        }
        else
        {
            Label lblMensaje = (Label)FormView1.FindControl("lblMensaje");
            lblMensaje.Text = "Faltan campos por llenar, intente nuevamente.";
        }
    }
Beispiel #36
0
        private void btnDetalle_Click(object sender, EventArgs e)
        {
            try
            {
                // Listar Solicitud y Datos del Cliente

                SolicitudNegocio solNeg = new SolicitudNegocio();
                clsSolicitud solicitud = new clsSolicitud();
                int iCodigoSolicitud = (int)dgvSolicitud.CurrentRow.Cells["Codigo"].Value;
                solicitud = solNeg.ObtenerSolicitud(iCodigoSolicitud);

                if (solicitud != null)
                {
                    frmConfirmarSolicitud objfrmConfirmarSolicitud = new frmConfirmarSolicitud();

                    ProductosClient proxyProducto = new ProductosClient();
                    Producto producto = new Producto();

                    producto = proxyProducto.ObtenerProducto(solicitud.Producto);

                    if (producto != null)
                    {

                        clsProducto objProducto = new clsProducto();

                        objProducto.codProducto = producto.codProducto;
                        objProducto.codCliente = producto.codCliente;
                        objProducto.monto = producto.monto;
                        objProducto.codTipoProducto = producto.codTipoProducto;
                        objProducto.tipoMoneda = producto.tipoMoneda;
                        objProducto.cuotas = producto.cuotas;
                        objProducto.seguroDes = producto.seguroDes;
                        objProducto.seguroBien = producto.seguroBien;
                        objProducto.fechaVenc = producto.fechaVenc;
                        objProducto.fechaRegistro = producto.fechaRegistro;
                        objProducto.tasaInteres = producto.tasaInteres;
                        objProducto.montoPendiente = producto.montoPendiente;

                        objfrmConfirmarSolicitud.ProductoSolicitud = objProducto;

                        ClientesClient proxyCliente = new ClientesClient();
                        Cliente cliente = new Cliente();

                        cliente = proxyCliente.ObtenerCliente(solicitud.Cliente);

                        if (cliente!= null)
                        {
                            clsCliente objCliente = new clsCliente();

                            objCliente.CodCliente = cliente.CodCliente;
                            objCliente.Nombre = cliente.Nombre;
                            objCliente.ApePat = cliente.ApePat;
                            objCliente.ApeMat = cliente.ApeMat;
                            objCliente.Direccion = cliente.Direccion;
                            objCliente.Telefono = cliente.Telefono;
                            objCliente.Correo = cliente.Correo;
                            objCliente.EstadoCivil = cliente.EstadoCivil;
                            objCliente.FechaNacimiento = cliente.FechaNacimiento;

                            objfrmConfirmarSolicitud.clienteSolicitud = objCliente;

                            objfrmConfirmarSolicitud.codigoSolicitud = solicitud.Codigo;
                            objfrmConfirmarSolicitud.descripcionSolicitud = solicitud.Descripcion;

                            this.Hide();
                            objfrmConfirmarSolicitud.Show();

                        }
                    }

                }

            }
            catch (Exception ex)
            {
                MessageBox.Show("Ocurrió un problema al momento de obtener la Solicitud. " + "\r\n" + ex.Message.ToString(), "Sistema de Cambio de Moneda", MessageBoxButtons.OK);
            }
        }