Пример #1
0
        private void IngresarCliente()
        {
            C_Cliente objetoCliente = new C_Cliente();

            objetoCliente.Nombre           = Txt_I_Nombre.Text;
            objetoCliente.Dni              = Txt_I_Dni.Text;
            objetoCliente.Apellido_paterno = Txt_I_APaterno.Text;
            objetoCliente.Apellido_materno = Txt_I_AMaterno.Text;
            if (Txt_I_Nombre.Text != String.Empty)
            {
                if (Txt_I_Dni.Text != String.Empty)
                {
                    if (_shalong.Cliente(1, objetoCliente))
                    {
                        MessageBox.Show("Se Ingreso al Cliente Correctamente", "Gestion Ventas", MessageBoxButtons.OK);
                        this.Limpiar();
                    }
                    else
                    {
                        MessageBox.Show("Ingrese los datos Correctamente", "Gestion Ventas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                }
                else
                {
                    MessageBox.Show("No deje el campo DNI en blanco", "Gestion Ventas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            else
            {
                MessageBox.Show("No deje el campo Nombre en blanco", "Gestion Ventas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Пример #2
0
        private void txtDNI_KeyUp(object sender, KeyEventArgs e)
        {
            try
            {
                // detectar si ha presionado la tecla enter
                if (e.KeyCode == Keys.Return)
                {
                    dgbListaCliente.Rows.Clear();

                    C_Cliente      C_cliente = new C_Cliente();
                    List <Cliente> clientes  = new List <Cliente>();

                    string dni = txtDNI.Text;

                    clientes = C_cliente.C_buscarPorDNI_cliente(dni);

                    foreach (Cliente cliente in clientes)
                    {
                        dgbListaCliente.Rows.Add(dgbListaCliente.Rows.Count
                                                 , cliente.Nombre
                                                 , cliente.Apellido
                                                 , cliente.Dni
                                                 , cliente.Idcliente);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "aviso");
            }
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Login"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            ControlCliente  = (C_Cliente)Session["ControlCliente"];
            ControlArticulo = (C_Articulo)Session["ControlArticulo"];
            ControlPedido   = (C_Pedido)Session["ControlPedido"];
            ControlConfig   = (C_Configuracion)Session["ControlConfig"];
            ListaCant       = (List <int>)Session["ListaCant"];
            ListaArticulo   = (List <Articulo>)Session["ListaArticulo"];
            RadioSelecionadoART();
            RadioSelecionadoCLI();
            NroPedido = ControlConfig.DevolverUltimoPedido() + 1;

            if (!IsPostBack)
            {
                GrillaArticulos.DataSource = Lista;
                GrillaArticulos.DataBind();
                Session["ListaArticulo"] = new List <Articulo>();
                Session["ListaCant"]     = new List <int>();
                TxtNroPedido.Text        = Convert.ToString(NroPedido);
            }
        }
Пример #4
0
        public void Insertar(C_Cliente Dato)
        {
            try
            {
                abrirConexion();
                MySqlCommand cmd1 = new MySqlCommand("SELECT COUNT(*) FROM clientes", conn);
                string       id   = (cmd1.ExecuteScalar()).ToString();
                if (Convert.ToInt32(id) > 0)
                {
                    MySqlCommand idmax = new MySqlCommand("SELECT MAX(cliente_id) FROM clientes", conn);
                    string       _id   = (idmax.ExecuteScalar()).ToString();
                    MySqlCommand cmd   = new MySqlCommand("INSERT INTO clientes (cliente_id,nombre,telefono,direccion) VALUES ('" + (Convert.ToInt32(_id) + 1) + "', '" + Dato.Nombre + "', '" + Dato.Telefono + "', '" + Dato.Direccion + "')", conn);
                    cmd.ExecuteNonQuery();
                }
                else
                {
                    MySqlCommand cmd3 = new MySqlCommand("INSERT INTO clientes (cliente_id,nombre,telefono,direccion) VALUES ('" + 1 + "', '" + Dato.Nombre + "', '" + Dato.Telefono + "', '" + Dato.Direccion + "')", conn);
                    cmd3.ExecuteNonQuery();
                }

                conn.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error al registrar Ciudad " + ex);
                throw new Exception("Error !!!");
            }
        }
Пример #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["Login"] == null)
     {
         Response.Redirect("Login.aspx");
     }
     ControlCliente           = (C_Cliente)Session["ControlCliente"];
     ControlConfig            = (C_Configuracion)Session["ControlConfig"];
     TodosClientes.DataSource = ControlCliente.Listar();
     TodosClientes.DataBind();
     Aux = ControlCliente.Listar();
     if (Aux.Count == 0)
     {
         BtnConvtExcel.Enabled = false;
         BtnConvtPDF.Enabled   = false;
         BtnConvtWord.Enabled  = false;
         ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "erroralert();", true);
     }
     if (!IsPostBack)
     {
         TodosClientes.PageSize   = ControlConfig.DevolverNroMaxPaginacion();
         TodosClientes.DataSource = ControlCliente.Listar();
         TodosClientes.DataBind();
     }
 }
Пример #6
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////

        private void txtRUC_KeyUp(object sender, KeyEventArgs e)
        {
            try
            {
                // detectar si ha presionado la tecla enter
                if (e.KeyCode == Keys.Return)
                {
                    dgvListaRuc.Rows.Clear();

                    C_Cliente      C_cliente = new C_Cliente();
                    List <Cliente> clientes  = new List <Cliente>();

                    string ruc = txtRUC.Text;

                    clientes = C_cliente.C_buscarPorRuc_cliente(ruc);

                    foreach (Cliente cliente in clientes)
                    {
                        dgvListaRuc.Rows.Add(dgvListaRuc.Rows.Count
                                             , cliente.Ruc
                                             , cliente.Razonsocial
                                             , cliente.Idcliente
                                             );
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "aviso");
            }
        }
Пример #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Login"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            ControlCliente       = (C_Cliente)Session["ControlCliente"];
            ControlArticulo      = (C_Articulo)Session["ControlArticulo"];
            ControlPedido        = (C_Pedido)Session["ControlPedido"];
            ControlConfig        = (C_Configuracion)Session["ControlConfig"];
            ControlDetallePedido = (C_DetallePedido)Session["ControlDetallePedido"];

            if (!IsPostBack)
            {
                GrillaArticulos.DataSource = Lista;
                GrillaArticulos.DataBind();
                ListaDetalleDTO = new List <DetallePedidoDTO>();
                ListaDTO        = new List <PedidoDTO>();
                BusquedaClientePedido.PageSize = ControlConfig.DevolverNroMaxPaginacion();
                RefrescarTablaNombreApellido();
            }

            if (RadioButtonListBusqueda.SelectedValue == "nro")
            {
                TxtNro.Visible   = true;
                BtnCli.Visible   = true;
                TxtCli.Visible   = false;
                BtnCli.Visible   = false;
                TxtDesde.Visible = false;
                TxtHasta.Visible = false;
                BtnRango.Visible = false;
                TxtNro.Focus();
            }
            else
            {
                if (RadioButtonListBusqueda.SelectedValue == "cliente")
                {
                    TxtNro.Visible   = false;
                    BtnCli.Visible   = false;
                    TxtCli.Visible   = true;
                    BtnCli.Visible   = true;
                    TxtDesde.Visible = false;
                    TxtHasta.Visible = false;
                    BtnRango.Visible = false;
                    TxtCli.Focus();
                }
                else
                {
                    TxtNro.Visible   = false;
                    BtnCli.Visible   = false;
                    TxtCli.Visible   = false;
                    BtnCli.Visible   = false;
                    TxtDesde.Visible = true;
                    TxtHasta.Visible = true;
                    BtnRango.Visible = true;
                    TxtDesde.Focus();
                }
            }
        }
Пример #8
0
        private void Cmb_E_Nombre_SelectedIndexChanged(object sender, EventArgs e)
        {
            C_Cliente obj = _shalong.ClienteMostrar1(Int32.Parse(Cmb_E_Nombre.SelectedValue.ToString()));

            Txt_E_Dni.Text      = "" + obj.Dni;
            Txt_E_APaterno.Text = "" + obj.Apellido_paterno;
            Txt_E_AMaterno.Text = "" + obj.Apellido_materno;
        }
Пример #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["Login"] == null)
     {
         Response.Redirect("Login.aspx");
     }
     ControlCliente = (C_Cliente)Session["ControlCliente"];
     TxtRazonS.Focus();
 }
Пример #10
0
        private void comboCliente(string dato)
        {
            C_Cliente obj4 = new C_Cliente();

            comboBoxCliente.DataSource    = obj4.Listado(dato);
            comboBoxCliente.DisplayMember = "Nombre";
            comboBoxCliente.ValueMember   = "ID";
            C_Inicio.idcl = comboBoxCliente.SelectedValue.ToString();
            datostabla1("");
        }
Пример #11
0
        public bool ValidarDatos()
        {
            if (opcion == 1)
            {
                c_Emision = new C_Emision(TxtDescripcion.Text, TxtMes.Text, TxtAnio.Text, TxtRecaudacion.Text);
                //  objetoClienteC = new C_Cliente(TxtDescripcion.Text, TxtNombre.Text, TxtApellido.Text, CbxGenero.Text, Convert.ToInt32(CbxComunidad.SelectedValue), TxtTelefono.Text, TxtCelular.Text, TxtEmail.Text);

                //objetoClienteC=new C_Cliente(TxtCedula.Text,TxtNombre,)
                return(true);
            }
            else if (opcion == 2)
            {
                string idfacturacion = Convert.ToString(tablames.CurrentRow.Cells[0].Value);

                string idregistro = Convert.ToString(TablaEmision.CurrentRow.Cells[7].Value);
                string idcliente  = Convert.ToString(TablaEmision.CurrentRow.Cells[8].Value);
                string idmedidor  = Convert.ToString(TablaEmision.CurrentRow.Cells[9].Value);

                string lecturaanterior = Convert.ToString(TablaEmision.CurrentRow.Cells[2].Value);
                string lecturaactual   = Convert.ToString(TablaEmision.CurrentRow.Cells[3].Value);
                string consumom3       = Convert.ToString(TablaEmision.CurrentRow.Cells[4].Value);
                string valortarifa     = Convert.ToString(TablaEmision.CurrentRow.Cells[5].Value);
                string total           = Convert.ToString(TablaEmision.CurrentRow.Cells[6].Value);


                c_Emision = new C_Emision(idfacturacion, idregistro, idcliente, idmedidor, lecturaanterior, lecturaactual, consumom3, valortarifa, total);
                return(true);
            }
            else if (opcion == 3)
            {
                // objetoClienteC = new C_Cliente(idcliente);
                c_Emision = new C_Emision(TxtIdClienteAsignar.Text);
                return(true);
            }
            else if (opcion == 4)
            {
                DateTime FechaInstalacion = DateTime.Now;
                ObjetoAsignarClienteC = new C_AsignarMedidor(TxtIdClienteAsignar.Text, CbxNumeroMedidorAsignar.SelectedValue.ToString(), CbxBasePagar.SelectedValue.ToString(), TxtCostoRegistro.Text, TxtNumCuota.Text, FechaInstalacion, TxtFechaLimitePago.Text, TxtValorPagado.Text);

                return(true);
            }
            else if (opcion == 5)
            {
                return(true);
            }
            else if (opcion == 7)
            {
                objetoClienteC = new C_Cliente("OC", TxtIdMedidorFinalizar.Text);
                return(true);
            }
            else
            {
                return(true);
            }
        }
Пример #12
0
        private async void btnAsignarCon_Click(object sender, RoutedEventArgs e)
        {
            DateTime?f = dpFechaDesdeD.SelectedDate;

            if (dtgrdclientesCon.Items.Count > 0)
            {
                if (cmbConfirmador.SelectedValue != null)
                {
                    foreach (Clases.C_Cliente item in dtgrdclientesCon.ItemsSource)
                    {
                        if (item.IsSelected == true)
                        {
                            Clases.C_Cliente cli = new C_Cliente();
                            cli.guardarAsignacionCon((int)cmbConfirmador.SelectedValue, item.id_cliente);
                        }
                    }
                }

                MessageDialogResult result = await p.ShowMessageAsync("Confirmación", "Asignación guardada satisfactoriamente, ¿Desea imprimir el reporte al confirmador?", MessageDialogStyle.AffirmativeAndNegative);

                if (result == MessageDialogResult.Affirmative)
                {
                    reporteConfirmador rc = new reporteConfirmador();
                    if (cmbConfirmador.SelectedValue != null)
                    {
                        rc.idCom = (int)cmbConfirmador.SelectedValue;
                    }
                    if (f != null)
                    {
                        rc.fecha = dpFechaDesdeD.SelectedDate;
                    }
                    if (hora.Value != null)
                    {
                        if (min.Value != null)
                        {
                            rc.hora = hora.Value.ToString() + ":" + min.Value.ToString();
                        }
                    }
                    if (!txtCantidadCon.Text.Equals(""))
                    {
                        rc.cantidad = Convert.ToInt32(txtCantidadCon.Text);
                    }
                    rc.Show();
                }
                cmbConfirmador.SelectedIndex = -1;
                txtCantidadCon.Text          = "";
                dtgrdclientesCon.ItemsSource = null;
            }
            else
            {
                await p.ShowMessageAsync("Advertencia", "Debe haber al menos un prospecto para imprimir el reporte", MessageDialogStyle.Affirmative);
            }
        }
Пример #13
0
        private void EliminarCliente()
        {
            C_Cliente objetoCliente = new C_Cliente();

            objetoCliente.Codigo           = Int32.Parse(Cmb_E_Nombre.SelectedValue.ToString());
            objetoCliente.Dni              = Txt_E_Dni.Text;
            objetoCliente.Apellido_paterno = Txt_E_APaterno.Text;
            objetoCliente.Apellido_materno = Txt_E_AMaterno.Text;
            if (_shalong.Cliente(3, objetoCliente))
            {
                MessageBox.Show("Se Elimino Correctamente", "Gestion Ventas", MessageBoxButtons.OK);
                CargarComboBox();
            }
        }
Пример #14
0
        protected void Session_Start(object sender, EventArgs e)
        {
            C_Empleado ControlEmpleado = new C_Empleado();

            Session["ControlEmpleado"] = ControlEmpleado;
            C_Cliente ControlCliente = new C_Cliente();

            Session["ControlCliente"] = ControlCliente;
            C_Proveedor ControlProveedor = new C_Proveedor();

            Session["ControlProveedor"] = ControlProveedor;
            C_Articulo ControlArticulo = new C_Articulo();

            Session["ControlArticulo"] = ControlArticulo;
            C_ArticuloxProveedor ControlArticuloxProveedor = new C_ArticuloxProveedor();

            Session["ControlArticuloxProveedor"] = ControlArticuloxProveedor;
            C_Pedido ControlPedido = new C_Pedido();

            Session["ControlPedido"] = ControlPedido;
            C_Configuracion ControlConfig = new C_Configuracion();

            Session["ControlConfig"] = ControlConfig;
            C_DetallePedido ControlDetallePedido = new C_DetallePedido();

            Session["ControlDetallePedido"] = ControlDetallePedido;
            List <DetallePedidoDTO> ListaDetalleDTO = null;

            Session["ListaDetalleDTO"] = ListaDetalleDTO;
            Pedido PedidoSession = null;

            Session["PedidoSession"] = PedidoSession;
            C_Facturacion ControlFacturacion = new C_Facturacion();

            Session["ControlFacturacion"] = ControlFacturacion;
            string StockMin = null;

            Session["StockMin"] = StockMin;
            List <int> ListaCant = null;

            Session["ListaCant"] = ListaCant;
            List <Articulo> ListaArticulo = null;

            Session["ListaArticulo"] = ListaArticulo;
            double Auxdouble = 0;

            Session["Auxdouble"]    = Auxdouble;
            Session["Login"]        = null;
            Session["ImporteTotal"] = null;
        }
Пример #15
0
        private void txtApellidos_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
        {
            C_Cliente cli = new C_Cliente();

            dtgrdclientes.ItemsSource = cli.filtarCLientes(txtCedula.Text, txtTelefono.Text, txtNombres.Text, txtApellidos.Text);

            /*dtgrdclientes.ItemsSource = cli.filtarCLientes("", "", null, txtApellidos.Text);
             * if (!txtCedula.Text.Equals(""))
             *  dtgrdclientes.ItemsSource = cli.filtarCLientes(txtCedula.Text, "", null, txtApellidos.Text);
             * if (!txtNombres.Text.Equals(""))
             *  dtgrdclientes.ItemsSource = cli.filtarCLientes("", "", txtNombres.Text, txtApellidos.Text);
             * if (!txtTelefono.Text.Equals("") && !txtNombres.Text.Equals(""))
             *  dtgrdclientes.ItemsSource = cli.filtarCLientes("", txtTelefono.Text, txtNombres.Text, txtApellidos.Text);*/
        }
Пример #16
0
 public void Editar(C_Cliente Dato)
 {
     try
     {
         abrirConexion();
         MySqlCommand cmd = new MySqlCommand("UPDATE clientes SET nombre = '" + Dato.Nombre + "',telefono = '" + Dato.Telefono + "',direccion = '" + Dato.Direccion + "'WHERE cliente_id = '" + C_Cliente.IdCli + "'", conn);
         cmd.ExecuteNonQuery();
         conn.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error al Actualizar" + ex);
         throw new Exception("Error !!!");
     }
 }
Пример #17
0
        private void txtTelefono_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            C_Cliente cli = new C_Cliente();

            dtgrdclientes.ItemsSource = cli.filtarAfiliados("", txtTelefono.Text);
            if (!txtCedula.Text.Equals(""))
            {
                dtgrdclientes.ItemsSource = cli.filtarAfiliados(txtCedula.Text, txtTelefono.Text);
            }
            if (txtTelefono.Text.Equals(""))
            {
                txtCedula.Text            = "";
                dtgrdclientes.ItemsSource = cli.listarAfiliados();
            }
        }
Пример #18
0
        private void txtCedula_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
        {
            C_Cliente cli = new C_Cliente();

            dtgrdclientesHis.ItemsSource = cli.filtarCLientes(txtCedula.Text, "", null, null);
            if (!txtTelefono.Text.Equals(""))
            {
                dtgrdclientesHis.ItemsSource = cli.filtarCLientes(txtCedula.Text, txtTelefono.Text, null, null);
            }
            if (txtCedula.Text.Equals(""))
            {
                txtTelefono.Text             = "";
                dtgrdclientesHis.ItemsSource = cli.listarCLientes();
            }
        }
Пример #19
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            C_Cliente cli = new C_Cliente();

            dtgrdclientes.ItemsSource = cli.listarPendientes((int)user.telemark);
            //llenar los combobox con listas dependiendo del tipo


            C_TipoDocumento tdoc = new C_TipoDocumento();

            cmbtipo.ItemsSource       = tdoc.listarDocumento();
            cmbtipo.DisplayMemberPath = "descripcion";
            cmbtipo.SelectedValuePath = "id_td";

            cmbtipoA.ItemsSource       = tdoc.listarDocumento();
            cmbtipoA.DisplayMemberPath = "descripcion";
            cmbtipoA.SelectedValuePath = "id_td";

            C_Pais pais = new C_Pais();

            cmbPais.ItemsSource       = pais.listarPaises();
            cmbPais.DisplayMemberPath = "nombre";
            cmbPais.SelectedValuePath = "id_pais";

            statusPrincipal stsp = new statusPrincipal();

            cmbStatusPrincipal.ItemsSource       = stsp.listarStatusPrincipal();
            cmbStatusPrincipal.DisplayMemberPath = "descripcion";
            cmbStatusPrincipal.SelectedValuePath = "id_statusPrincipal";

            C_Locacion loc = new C_Locacion();

            cmbLocacion.ItemsSource       = loc.listarLocaciones();
            cmbLocacion.DisplayMemberPath = "codigo";
            cmbLocacion.SelectedValuePath = "idlocacion";
            cmbtipo.Focus();

            cmbPromotor.ItemsSource       = llenarCombo();
            cmbPromotor.DisplayMemberPath = "Value";
            cmbPromotor.SelectedValuePath = "Key";
            //lista de edos civiles
            cmbEdoCivil.Items.Add("CASADO(A)");
            cmbEdoCivil.Items.Add("SOLTERO(A) SOLO(A)");
            cmbEdoCivil.Items.Add("SOLTERO(A) CON PAREJA");
            cmbEdoCivil.Items.Add("VIUDO(A)");
            cmbEdoCivil.Items.Add("DIVORCIADO(A)");
            cmbEdoCivil.Items.Add("CONVIVIENTE");
        }
Пример #20
0
        private void Cmb_I_Cliente_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (Cmb_I_Cliente.SelectedIndex == -1)
            {
                Txt_P_Nombre.Clear();
            }

            if (Cmb_I_Cliente.SelectedIndex != -1)
            {
                Cmb_I_Empresa.SelectedIndex = -1;
                C_Cliente obj = _shalong.ClienteMostrar1(Int32.Parse(Cmb_I_Cliente.SelectedValue.ToString()));
                Txt_P_Nombre.Text       = " " + obj.Nombre + "  " + "" + obj.Apellido_paterno + "  " + "" + obj.Apellido_materno;
                Txt_P_Telefono.Enabled  = false;
                Txt_P_Direccion.Enabled = false;
            }
        }
Пример #21
0
        private async void txtTelefonoA_LostFocus(object sender, RoutedEventArgs e)
        {
            if (!txtTelefonoA.Text.Equals(""))
            {
                if (!telAcAnt.Equals(txtTelefonoA.Text))
                {
                    C_Cliente cli = new C_Cliente();
                    if (cli.existeNumero(txtTelefonoA.Text) == 1)
                    {
                        await p.ShowMessageAsync("Error", "El número ya está registrado", MessageDialogStyle.Affirmative);

                        txtTelefonoA.Text = "";
                        txtTelefonoA.Focus();
                    }
                }
            }
        }
Пример #22
0
        public void Eliminar(C_Cliente Dato)
        {
            try
            {
                abrirConexion();
                MySqlCommand cmd = new MySqlCommand("DELETE FROM clientes WHERE cliente_id = '" + Dato.ID + "'", conn);
                if (MessageBox.Show("¿Está seguro que que desea eliminar '" + C_Cliente.nom + "'?", "¡Advertencia!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                {
                    cmd.ExecuteNonQuery();
                }

                conn.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error al Eliminar" + ex);
                throw new Exception("Error !!!");
            }
        }
Пример #23
0
 public bool ValidarDatos()
 {
     if (opcion == 1)
     {
         string idregistro = Convert.ToString(TablaInscripcion.CurrentRow.Cells[0].Value);
         string idcliente  = Convert.ToString(TablaInscripcion.CurrentRow.Cells[11].Value);
         string idmedidor  = Convert.ToString(TablaInscripcion.CurrentRow.Cells[12].Value);
         string idpago     = Convert.ToString(TablaInscripcion.CurrentRow.Cells[13].Value);
         //objetoClienteC = new C_Cliente(TxtCedula.Text, TxtNombre.Text, TxtApellido.Text, CbxGenero.Text, Convert.ToInt32(CbxComunidad.SelectedValue), TxtTelefono.Text, TxtCelular.Text, TxtEmail.Text);
         ObjetoAsignarClienteC = new C_AsignarMedidor(idregistro, idcliente, idmedidor, idpago, TxtValoraPagar.Text);
         //objetoClienteC=new C_Cliente(TxtCedula.Text,TxtNombre,)
         return(true);
     }
     else if (opcion == 2)
     {
         // ObjetoMedidorC = new C_Medidor("OC", idcliente);
         ObjetoAsignarClienteC = new C_AsignarMedidor(LblTotalpagadoFinalizar.Text, LblIdpagounicoo.Text);
         return(true);
     }
     else if (opcion == 3)
     {
         objetoClienteC = new C_Cliente(idcliente);
         return(true);
     }
     else if (opcion == 4)
     {
         return(true);
     }
     else if (opcion == 5)
     {
         return(true);
     }
     else if (opcion == 7)
     {
         objetoClienteC = new C_Cliente("OC", LblIdpagounicoo.Text);
         return(true);
     }
     else
     {
         return(true);
     }
 }
Пример #24
0
 private void txtCantidad_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
 {
     if (!txtCantidad.Text.Equals(""))
     {
         C_Cliente cli = new C_Cliente();
         dtgrdclientes.ItemsSource = cli.listarAsignacion(Convert.ToInt16(txtCantidad.Text), null, null, null);
         if (dpFechaDesdeTele.SelectedDate != null && dpFechaHastaTele.SelectedDate != null && cmbLocacion.SelectedValue == null)
         {
             dtgrdclientes.ItemsSource = cli.listarAsignacion(Convert.ToInt16(txtCantidad.Text), dpFechaDesdeTele.SelectedDate.Value, dpFechaHastaTele.SelectedDate.Value, null);
         }
         if (dpFechaDesdeTele.SelectedDate == null && dpFechaHastaTele.SelectedDate == null && cmbLocacion.SelectedValue != null)
         {
             dtgrdclientes.ItemsSource = cli.listarAsignacion(Convert.ToInt16(txtCantidad.Text), null, null, (int)cmbLocacion.SelectedValue);
         }
         if (dpFechaDesdeTele.SelectedDate != null && dpFechaHastaTele.SelectedDate != null && cmbLocacion.SelectedValue != null)
         {
             dtgrdclientes.ItemsSource = cli.listarAsignacion(Convert.ToInt16(txtCantidad.Text), dpFechaDesdeTele.SelectedDate.Value, dpFechaHastaTele.SelectedDate.Value, (int)cmbLocacion.SelectedValue);
         }
     }
 }
Пример #25
0
        public bool ValidarDatos()
        {
            if (opcion == 1)
            {
                objetoClienteC = new C_Cliente(TxtCedula.Text, TxtNombre.Text, TxtApellido.Text, CbxGenero.Text, Convert.ToInt32(CbxComunidad.SelectedValue), TxtTelefono.Text, TxtCelular.Text, TxtEmail.Text);

                //objetoClienteC=new C_Cliente(TxtCedula.Text,TxtNombre,)
                return(true);
            }
            else if (opcion == 2)
            {
                ObjetoMedidorC = new C_Medidor("OC", idcliente);
                return(true);
            }
            else if (opcion == 3)
            {
                objetoClienteC = new C_Cliente(idcliente);
                return(true);
            }
            else if (opcion == 4)
            {
                DateTime FechaInstalacion = DateTime.Now;
                ObjetoAsignarClienteC = new C_AsignarMedidor(TxtIdClienteAsignar.Text, CbxNumeroMedidorAsignar.SelectedValue.ToString(), CbxBasePagar.SelectedValue.ToString(), TxtCostoRegistro.Text, TxtNumCuota.Text, FechaInstalacion, TxtFechaLimitePago.Text, TxtValorPagado.Text);

                return(true);
            }
            else if (opcion == 5)
            {
                return(true);
            }
            else if (opcion == 7)
            {
                objetoClienteC = new C_Cliente("OC", TxtIdMedidorFinalizar.Text);
                return(true);
            }
            else
            {
                return(true);
            }
        }
Пример #26
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            try
            {
                Int16 id;
                Int16.TryParse(txtIdCliente.Text, out id);


                if (id > 0)
                {
                    DialogResult dialog;
                    dialog = MessageBox.Show("¿Esta seguro de eliminar este registro?"
                                             , "Confirmacion"
                                             , MessageBoxButtons.YesNo
                                             , MessageBoxIcon.Question);


                    if (dialog == DialogResult.Yes)
                    {
                        C_Cliente clienteBLL = new C_Cliente();
                        clienteBLL.C_eliminar_cliente(id);

                        MessageBox.Show("CLIENTE ELIMINADO SATISFACTORIAMENTE", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.txtIdCliente.Clear();
                        this.txtNommbreCli.Clear();
                        this.txtApellidosCli.Clear();
                        this.txtDNICli.Clear();
                        this.txtDireccionCli.Clear();
                        this.txtTelefonoCli.Clear();
                        this.txtCorreoCli.Clear();
                        this.txtRuc.Clear();
                        this.txtrazonsocial.Clear();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Aviso");
            }
        }
Пример #27
0
        private async void txtTcelular2_LostFocus(object sender, RoutedEventArgs e)
        {
            if (!txtTcelular2.Text.Equals(""))
            {
                if (!telCel2Ant.Equals(txtTcelular2.Text))
                {
                    C_Cliente cli = new C_Cliente();
                    if (cli.existeNumero(txtTcelular2.Text) == 1)
                    {
                        await p.ShowMessageAsync("Error", "El número ya está registrado", MessageDialogStyle.Affirmative);

                        txtTcelular2.Text = "";
                        txtTcelular2.Focus();
                        error = true;
                    }
                    else
                    {
                        error = false;
                    }
                }
            }
        }
Пример #28
0
 private void txtCantidadCon_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
 {
     if (!txtCantidadCon.Text.Equals(""))
     {
         C_Cliente cli = new C_Cliente();
         if (hora.Value.Equals(null) && min.Value.Equals(null))
         {
             dtgrdclientesCon.ItemsSource = cli.listarParaConfirmar(Convert.ToInt16(txtCantidadCon.Text), "", dpFechaDesdeD.SelectedDate);
         }
         else
         {
             if (!hora.Value.Equals(null))
             {
                 if (!min.Value.Equals(null))
                 {
                     string ola = hora.Value.ToString() + ":" + min.Value.ToString();
                     dtgrdclientesCon.ItemsSource = cli.listarParaConfirmar(Convert.ToInt16(txtCantidadCon.Text), ola, dpFechaDesdeD.SelectedDate); ////************************************
                 }
             }
         }
     }
 }
Пример #29
0
        private void ModificarCliente()
        {
            C_Cliente objetoCliente = new C_Cliente();

            objetoCliente.Codigo           = Int32.Parse(Cmb_M_Nombre.SelectedValue.ToString());
            objetoCliente.Nombre           = Txt_M_Nombre.Text;
            objetoCliente.Dni              = Txt_M_Dni.Text;
            objetoCliente.Apellido_paterno = Txt_M_APaterno.Text;
            objetoCliente.Apellido_materno = Txt_M_AMaterno.Text;
            if (Txt_M_Nombre.Text != String.Empty)
            {
                if (Txt_M_Dni.Text != String.Empty)
                {
                    if (_shalong.Cliente(2, objetoCliente))
                    {
                        MessageBox.Show("Se Modifico correctamente", "Gestion Ventas", MessageBoxButtons.OK);
                        CargarComboBox();

                        /*Txt_M_Nombre.Clear();
                         * Txt_M_Dni.Clear();
                         * Txt_M_APaterno.Clear();
                         * Txt_M_AMaterno.Clear();*/
                    }
                    else
                    {
                        MessageBox.Show("Ingrese los datos Correctamente", "Gestion Ventas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                }
                else
                {
                    MessageBox.Show("No deje el campo DNI en blanco", "Gestion Ventas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            else
            {
                MessageBox.Show("No deje el campo Nombre en blanco", "Gestion Ventas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Пример #30
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            try
            {
                V_MantenimientoBuscarCliente form;
                form = new V_MantenimientoBuscarCliente();

                form.ShowDialog(this);


                if (form.id > 0)
                {
                    C_Cliente C_cliente = new C_Cliente();
                    Cliente   cliente   = C_cliente.C_buscarPorId_cliente(form.id);


                    txtIdCliente.Text    = cliente.Idcliente.ToString();
                    txtDNICli.Text       = cliente.Dni.ToString();
                    txtNommbreCli.Text   = cliente.Nombre.ToString();
                    txtApellidosCli.Text = cliente.Apellido.ToString();
                    txtDireccionCli.Text = cliente.Direccion.ToString();
                    txtTelefonoCli.Text  = cliente.Telefono.ToString();
                    txtCorreoCli.Text    = cliente.Correo.ToString();
                    txtRuc.Text          = cliente.Ruc.ToString();
                    txtrazonsocial.Text  = cliente.Razonsocial.ToString();


                    txtDNICli.Enabled = false;
                    txtRuc.Enabled    = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "aviso");
            }
        }