Пример #1
0
        private void btnEditarCliente_Click(object sender, EventArgs e)
        {
            Cliente _cliente = new Cliente();

            _cliente.idUsuario         = 1;
            _cliente.Dni               = "33222444";
            _cliente.Sexo              = "Masculino";
            _cliente.Apellido          = "Hola";
            _cliente.Nombre            = "Mundo";
            _cliente.Email             = "*****@*****.**";
            _cliente.Telefono          = "221-5230508";
            _cliente.FechaDeNacimiento = DateTime.Now;
            _cliente.idPerfil          = 1;
            _cliente.idPlan            = 2;
            _cliente.Contraseña        = "BBBB";
            _cliente.Contraseña2       = "BBBB";
            _cliente.FechaDeAlta       = DateTime.Now;
            _cliente.Estado            = "Activo";
            bool Exito = ClienteNeg.EditarCliente(_cliente);

            if (Exito == true)
            {
                const string message2 = "Se registro la edición del cliente exitosamente.";
                const string caption2 = "Éxito";
                var          result2  = MessageBox.Show(message2, caption2,
                                                        MessageBoxButtons.OK,
                                                        MessageBoxIcon.Asterisk);
            }
        }
Пример #2
0
 public void cmbProvincia_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         string var = cmbProvincia.SelectedValue; //aca ya tenes el id
         if (var != "0")
         {
             //var split1 = var.Split(',')[0];
             //split1 = split1.Trim();
             int           idProvinciaSeleccionada = Convert.ToInt32(var);
             List <string> Localidades             = new List <string>();
             Localidades = ClienteNeg.CargarComboLocalidadesPorIdProvincia(idProvinciaSeleccionada);
             cmbLocalidad.Items.Clear();
             cmbLocalidad.Text = "Seleccione";
             cmbLocalidad.Items.Add("Seleccione");
             foreach (string item in Localidades)
             {
                 cmbLocalidad.Text = "Seleccione";
                 cmbLocalidad.Items.Add(item);
             }
             this.cmbLocalidad.Enabled = true;
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #3
0
    public List <Clientes> MotrarAllCliente()
    {
        ClienteNeg cneg  = new ClienteNeg();
        var        lista = cneg.MostrarAllCliente();

        return(lista.ToList());
    }
Пример #4
0
        protected void btnRegistrar_Click(object sender, EventArgs e)
        {
            Cliente    cliente    = new Cliente();
            ClienteNeg clienteNeg = new ClienteNeg();
            VoucherNeg voucherNeg = new VoucherNeg();

            //try
            //{
            //    cliente.Apellido = txtApellido.text();
            //    cliente.Nombre = txtNombre.text();
            //    cliente.Domicilio = txtDomicilio.text();
            //    cliente.DNI = Convert.ToInt32(txtDNI.text);
            //    cliente.Ciudad = txtCiudad.text();
            //    cliente.CP = Convert.ToInt32(txtCP.text());
            //    cliente.email = txtEmail.text();
            //    clienteNeg.AltaCliente(cliente.DNI, cliente.Nombre, cliente.Apellido, cliente.email, cliente.Domicilio, cliente.Ciudad, cliente.CP);
            //    cliente=clienteNeg.GetCliente(cliente.DNI);
            //    voucherNeg.VoucherXCliente(voucherActual, IDPremioElegido, cliente.ID);
            //}
            //catch (Exception)
            //{

            //    throw;
            //}
        }
Пример #5
0
 public VendaController()
 {
     objVendaNeg    = new VendaNeg();
     objClienteNeg  = new ClienteNeg();
     objProdutoNeg  = new ProdutoNeg();
     objModoPagoNeg = new ModoPagoNeg();
 }
Пример #6
0
        public ActionResult EditarNota(NotaFiscal nota)
        {
            if (nota.Produto == null)
            {
                ViewBag.Clientes = new SelectList(ClienteNeg.Listar(), "Codigo", "Nome");
                ViewBag.Produtos = new SelectList(ProdutoNeg.Listar(), "Codigo", "Nome");
                NotaFiscal nota3 = NotaFiscalNeg.Buscar(nota.Codigo);
                nota3.Produto    = new Produto();
                nota3.Produto    = nota3.Itens[0].Produto;
                nota3.Quantidade = nota3.Itens[0].Quantidade;

                return(View(nota3));
            }
            else
            {
                if (nota.Produto.Codigo > 0)
                {
                    nota.Produto = ProdutoNeg.Buscar(nota.Produto.Codigo);
                    nota.Itens   = new List <Item>();

                    Item item = new Item();
                    item.Produto    = nota.Produto;
                    item.Quantidade = nota.Quantidade;
                    nota.Itens.Add(item);

                    nota.ValorTotal = nota.Produto.Preco * nota.Quantidade;
                }

                NotaFiscalNeg.Atualizar(nota);

                return(RedirectToAction("Index"));
            }
        }
Пример #7
0
        private void BuscarEmpresaPorCuit()
        {
            List <Cliente> _cliente = new List <Cliente>();
            var            cuit     = txtCuitBuscar.Text;

            _cliente = ClienteNeg.BuscarClientePorCuit(cuit);
            if (_cliente.Count > 0)
            {
                dgvTodosLosClientes.Rows.Clear();
                DiseñoGrilla();
                dgvTodosLosClientes.Visible = true;
                foreach (var item in _cliente)
                {
                    dgvTodosLosClientes.Rows.Add(item.IdCliente, item.NombreRazonSocial, item.Cuit, item.Actividad, item.CondicionAntiAfip);
                }
                dgvTodosLosClientes.AllowUserToAddRows = false;
            }
            else
            {
                txtBuscarRazonSocial.Focus();
                const string message = "No existe ningun cliente con el cuit ingresado.";
                const string caption = "Atención";
                var          result  = MessageBox.Show(message, caption,
                                                       MessageBoxButtons.OK,
                                                       MessageBoxIcon.Exclamation);
                throw new Exception();
            }
        }
Пример #8
0
        protected void btnBuscar_Click1(object sender, EventArgs e)
        {
            List <Sico.Entidades.SubCliente> ListaFacturas = new List <Sico.Entidades.SubCliente>();

            try
            {
                if (txtBuscarPorNombreRazonSocial.Text != "")
                {
                    var ApellidoNombre = txtBuscarPorNombreRazonSocial.Text;
                    ListaFacturas = ClienteNeg.BuscarSubClientePorApellidoNombre(txtBuscarPorNombreRazonSocial.Text, lblCuit.Text);
                    if (ListaFacturas.Count > 0)
                    {
                        this.Session["usuarios"] = ListaFacturas;
                        this.gvVentas.DataSource = ListaFacturas;
                        this.gvVentas.DataBind();
                        this.lblTotalRegistros.Text = ListaFacturas.Count.ToString();
                    }
                }
                if (txtNroFactura.Text != "" & txtBuscarPorNombreRazonSocial.Text == "")
                {
                    var ApellidoNombre = txtBuscarPorNombreRazonSocial.Text;
                    ListaFacturas = ClienteNeg.BuscarSubClientePorNroFactura(txtNroFactura.Text, lblCuit.Text);
                    if (ListaFacturas.Count > 0)
                    {
                        this.Session["usuarios"] = ListaFacturas;
                        this.gvVentas.DataSource = ListaFacturas;
                        this.gvVentas.DataBind();
                        this.lblTotalRegistros.Text = ListaFacturas.Count.ToString();
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Пример #9
0
        protected void btnBuscar_Click(object sender, EventArgs e)
        {
            List <Sico.Entidades.SubCliente> SubCliente = new List <Sico.Entidades.SubCliente>();
            var ApellidoNombre = txtApellido.Text;
            var Dni            = txtDni.Text;
            var cuit           = lblCuit.Text;

            if (Dni != "")
            {
                SubCliente = ClienteNeg.BuscarSubClientePorDni(Dni, cuit);
            }
            if (ApellidoNombre != "")
            {
                SubCliente = ClienteNeg.BuscarSubClientePorApellido(ApellidoNombre, cuit);
            }
            if (SubCliente.Count > 0)
            {
                this.gvSubClientes.Visible    = true;
                lblMensaje.Visible            = false;
                this.Session["usuarios"]      = SubCliente;
                this.gvSubClientes.DataSource = SubCliente;
                this.gvSubClientes.DataBind();
                this.lblTotalRegistros.Text = SubCliente.Count.ToString();
                lblTotal.Visible            = true;
                lblTotalRegistros.Visible   = true;
            }
            else
            {
                txtApellido = null;
                string msg = "<script language=\"javascript\">";
                msg += "Atencion('" + "No se encontraron datos para el sub-cliente ingresado." + "');";
                msg += "</script>";
                Response.Write(msg);
            }
        }
Пример #10
0
        private void BuscarFacturaParaClienteSeleccionado()
        {
            txtFactura.Clear();
            string NuevoNroFactura = ClienteNeg.BuscarNroFactura(Sesion.UsuarioLogueado.idEmpresaSeleccionado);

            txtFactura.Text = NuevoNroFactura;
        }
Пример #11
0
 protected void btnGuardar_Click(object sender, EventArgs e)
 {
     try
     {
         Sico.Entidades.SubCliente _subCliente = CargarEntidad();
         var cuit = lblCuit.Text;
         if (EsEditar == 1)
         {
             bool Exito = ClienteNeg.EditarSubCliente(_subCliente, cuit);
             if (Exito == true)
             {
                 ShowMessage("Se Edito exitosamente el Sub-Cliente ingresado.", "Éxito");
                 //LimpiarCampos();
             }
             else
             {
             }
         }
         else
         {
             bool Exito = ClienteNeg.GuardarNuevoSubCliente(_subCliente, cuit);
             if (Exito == true)
             {
                 ShowMessage("Se registro exitosamente el Sub-Cliente ingresado.", "Success");
                 //LimpiarCampos();
             }
             else
             {
             }
         }
     }
     catch (Exception ex)
     { }
 }
Пример #12
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            string Año             = cmbAño.Text;
            var    TipoVencimiento = cmbTipoVencimiento.Text;
            var    split1          = TipoVencimiento.Split('-')[0];

            split1 = split1.Trim();
            int    idTipoVencimiento = Convert.ToInt32(split1);
            string DiaVencimiento    = txtDia.Text;
            bool   Exito             = ClienteNeg.GuardarVencimiento(Año, idTipoVencimiento, DiaVencimiento);

            if (Exito == true)
            {
                ProgressBar();
                const string message2 = "Se registro el vencimiento exitosamente.";
                const string caption2 = "Éxito";
                var          result2  = MessageBox.Show(message2, caption2,
                                                        MessageBoxButtons.OK,
                                                        MessageBoxIcon.Asterisk);
                LimpiarCampos();
            }
            else
            {
            }
        }
Пример #13
0
 protected void btnGuardar_Click(object sender, EventArgs e)
 {
     try
     {
         string Cuit = lblCuit.Text;
         Sico.Entidades.SubCliente _subCliente = CargarEntidad();
         if (ClienteSeleccionado.Funcion == 0)
         {
             bool Exito = ClienteNeg.GuardarFacturaSubCliente(_subCliente, Cuit);
             if (Exito == true)
             {
                 ShowMessage("Se registro exitosamente la factura cargada.", "Éxito");
                 LimpiarCampos();
             }
             else
             {
             }
         }
         if (ClienteSeleccionado.Funcion == 4)
         {
             bool Exito = ClienteNeg.GuardarNotaDeCredito(_subCliente, Cuit);
             if (Exito == true)
             {
                 ShowMessage("Se registro exitosamente la Nota de Crédito cargada.", "Success");
                 LimpiarCampos();
             }
             else
             {
             }
         }
     }
     catch (Exception ex) { }
 }
Пример #14
0
        private void cmbProvincia_Click(object sender, EventArgs e)
        {
            try
            {
                string var = cmbProvincia.Text;
                if (var != "Seleccione")
                {
                    var split1 = var.Split(',')[0];
                    split1 = split1.Trim();
                    int idProvinciaSeleccionada = Convert.ToInt32(split1);


                    List <string> Localidades = new List <string>();
                    Localidades = ClienteNeg.CargarComboLocalidadesPorIdProvincia(idProvinciaSeleccionada);
                    cmbLocalidad.Items.Clear();
                    cmbLocalidad.Text = "Seleccione";
                    cmbLocalidad.Items.Add("Seleccione");
                    foreach (string item in Localidades)
                    {
                        cmbLocalidad.Text = "Seleccione";
                        cmbLocalidad.Items.Add(item);
                    }
                    this.cmbLocalidad.Enabled = true;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #15
0
        public void ClienteNaoExiste()
        {
            string cpf = "00000000011";

            var cliente = ClienteNeg.Buscar(cpf);

            // Assert
            Assert.AreEqual(0, cliente.id);
        }
Пример #16
0
        private void ConsultaVencimientosWF_Load(object sender, EventArgs e)
        {
            lblNombreEdit.Text = razonSocial;
            lblCuitEdit.Text   = cuit;
            CargarCombos();
            DateTime FechaHoy = DateTime.Now;

            ListaVencimientos = ClienteNeg.BuscarTodosLosVencimientos(cuit, FechaHoy);
        }
Пример #17
0
        public void ExisteCliente()
        {
            string cpf = "00000000002";

            var cliente = ClienteNeg.Buscar(cpf);

            // Assert
            Assert.IsNotNull(cliente.id);
        }
Пример #18
0
 public VentaController()
 {
     objVentaNeg        = new VentaNeg();
     objClienteNeg      = new ClienteNeg();
     objProductoNeg     = new ProductoNeg();
     objModoPagoNeg     = new ModoPagoNeg();
     objFacturaNeg      = new FacturaNeg();
     objDetalleVentaNeg = new DetalleVentaNeg();
 }
Пример #19
0
 public VendaController()
 {
     objVendaNeg    = new VendaNeg();
     objClienteNeg  = new ClienteNeg();
     objProdutoNeg  = new ProdutoNeg();
     objModoPagoNeg = new ModoPagoNeg();
     //add agora
     objFaturaNeg       = new FaturaNeg();
     objDetalheVendaNeg = new DetalheVendaNeg();
 }
Пример #20
0
        protected void cmbPersonas_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                ClienteSeleccionado = (Cliente)HttpContext.Current.Session["usuarios"];
                string cuit    = ClienteSeleccionado.Cuit;
                string persona = cmbPersonas.Text;
                if (ClienteSeleccionado.Funcion == 1)
                {
                    string NroFactura = ClienteNeg.BuscarNroFactura(ClienteSeleccionado.Cuit);
                    txtFactura.Text = NroFactura;
                }
                if (ClienteSeleccionado.Funcion == 2)
                {
                    string NroFactura = ClienteNeg.BuscarNuevoNroFacturaNotaDeCredito(ClienteSeleccionado.Cuit);
                    txtFactura.Text = NroFactura;
                }
                dtFecha.Enabled = true;
                string            apellidoNombre  = cmbPersonas.Text;
                List <SubCliente> DatosPersonales = ClienteNeg.BuscarDatosSubClientePorApellidoNombre(apellidoNombre, cuit);
                if (DatosPersonales.Count > 0)
                {
                    //HabilitarLabels();
                    var datos = DatosPersonales.First();
                    if (String.IsNullOrEmpty(datos.Dni))
                    {
                        lblDniEdit.Text = "No informa";
                    }
                    else
                    {
                        lblDniEdit.Text = datos.Dni;
                    }

                    if (String.IsNullOrEmpty(datos.Direccion))
                    {
                        lblDireccionEdit.Text = "No informa";
                    }
                    else
                    {
                        lblDireccionEdit.Text = datos.Direccion;
                    }

                    if (String.IsNullOrEmpty(datos.Observacion))
                    {
                        lblObservacionesEdit.Text = "No informa";
                    }
                    else
                    {
                        lblObservacionesEdit.Text = datos.Observacion;
                    }
                }
            }
            catch (Exception ex)
            { }
        }
Пример #21
0
        private void BuscarSubcliente()
        {
            List <Entidades.SubCliente> SubCliente = new List <Entidades.SubCliente>();
            var ApellidoNombre = txtApellidoNombreBuscar.Text;
            var DNI            = txtDniBuscar.Text;

            if (ApellidoNombre != "")
            {
                SubCliente = ClienteNeg.BuscarSubClientePorApellidoNombre(ApellidoNombre, idEmpresa);
            }
            if (DNI != "")
            {
                SubCliente = ClienteNeg.BuscarSubClientePorDni(DNI, idEmpresa);
            }
            if (SubCliente.Count > 0)
            {
                groupBox1.Enabled = true;
                txtDni.Enabled    = false;
                var subcliente = SubCliente.First();
                txtDni.Text            = subcliente.Dni;
                txtApellidoNombre.Text = subcliente.ApellidoNombre;
                string dir    = subcliente.Direccion;
                var    split3 = dir.Split(' ')[0];
                split3 = split3.Trim();
                string dir2        = subcliente.Direccion;
                int    cantidad2   = dir2.Split().Count();
                string valor2      = "";
                string valorFinal2 = "";
                for (int i = 1; i < cantidad2; i++)
                {
                    var    split4 = dir2.Split(' ')[i];
                    string split  = split4.Trim();
                    valorFinal2 = valor2 + " " + split4;
                    valor2      = split;
                }
                txtCalle.Text       = split3;
                txtAltura.Text      = valorFinal2;
                txtObservacion.Text = subcliente.Observacion;
                if (subcliente.TipoDNI != "")
                {
                    CargarCombo();
                    cmbTipoDoc.Text = subcliente.TipoDNI;
                }
                else
                {
                    CargarCombo();
                }
            }
            else
            {
                txtApellidoNombreBuscar.Clear();
                MessageBox.Show("No se encontraron datos para el cliente ingresado.");
            }
        }
Пример #22
0
 private void dgvTodosLosClientes_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvTodosLosClientes.CurrentCell.ColumnIndex == 5)
     {
         int    idEmpresa   = Convert.ToInt32(this.dgvTodosLosClientes.CurrentRow.Cells[0].Value.ToString());
         string RazonSocial = this.dgvTodosLosClientes.CurrentRow.Cells[1].Value.ToString();
         Sesion.UsuarioLogueado.idEmpresaSeleccionado = idEmpresa;
         Sesion.UsuarioLogueado.EmpresaSeleccionada   = RazonSocial;
         MasterNuevaWF frm2 = Application.OpenForms.OfType <MasterNuevaWF>().SingleOrDefault();
         if (frm2 != null)
         {
             frm2.lblidEmpresa.Text = Convert.ToString(idEmpresa);
             frm2.lblEmpresa.Text   = RazonSocial;
             frm2.grbEmpresaSeleccionada.Visible = true;
             Hide();
         }
     }
     if (dgvTodosLosClientes.CurrentCell.ColumnIndex == 6)
     {
         Funcion = 2;
         PanelRegistroPlan.Enabled = true;
         List <Cliente> _cliente = new List <Cliente>();
         var            cuit     = dgvTodosLosClientes.CurrentRow.Cells[2].Value.ToString();
         _cliente = ClienteNeg.BuscarClientePorCuit(cuit);
         if (_cliente.Count > 0)
         {
             var cliente = _cliente.First();
             txtNombreRazonSocial.Text = cliente.NombreRazonSocial;
             txtCuit.Text      = cliente.Cuit;
             txtActividad.Text = cliente.Actividad;
             var    tel    = cliente.Telefono;
             string varTel = tel;
             if (varTel != "")
             {
                 var split1 = varTel.Split('-')[0];
                 var split2 = varTel.Split('-')[1];
                 split1           = split1.Trim();
                 split2           = split2.Trim();
                 txtCodArea.Text  = split1;
                 txtTelefono.Text = split2;
             }
             txtEmail.Text             = cliente.Email;
             txtCalle.Text             = cliente.Calle;
             txtAltura.Text            = cliente.Altura;
             txtCodigoPostal.Text      = cliente.CodigoPostal;
             cmbCondicionAntiAfip.Text = cliente.CondicionAntiAfip;
             cmbProvincia.Text         = cliente.Provincia;
             cmbLocalidad.Text         = cliente.Localidad;
             txtCuit.Enabled           = false;
         }
     }
 }
Пример #23
0
        public Cliente obtenerCliente(string id)
        {
            try
            {
                return(ClienteNeg.obtenerCliente(id));
            }
            catch (Exception ex)
            {
                return(new Cliente());

                throw;
            }
        }
Пример #24
0
        public bool insertarCliente(Cliente cliente)
        {
            try
            {
                return(ClienteNeg.insertarCliente(cliente));
            }
            catch (Exception ex)
            {
                return(false);

                throw;
            }
        }
Пример #25
0
        public bool modificarCliente(Cliente cliente)
        {
            try
            {
                return(ClienteNeg.modificarCliente(cliente));
            }
            catch (Exception ex)
            {
                return(false);

                throw;
            }
        }
Пример #26
0
        public IHttpActionResult obtenerClientes()
        {
            try
            {
                return(Ok(ClienteNeg.obtenerClientes()));
            }
            catch (Exception ex)
            {
                return(NotFound());

                throw;
            }
        }
Пример #27
0
        public bool eliminarCliente(string id)
        {
            try
            {
                return(ClienteNeg.eliminarCliente(id));
            }
            catch (Exception ex)
            {
                return(false);

                throw;
            }
        }
Пример #28
0
        private void CargarComboProvincia()
        {
            List <string> Provincia = new List <string>();

            Provincia = ClienteNeg.CargarComboProvincia();
            cmbProvincia.Items.Clear();
            cmbProvincia.Text = "Seleccione";
            cmbProvincia.Items.Add("Seleccione");
            foreach (string item in Provincia)
            {
                cmbProvincia.Text = "Seleccione";
                cmbProvincia.Items.Add(item);
            }
        }
Пример #29
0
        private void CargarComboLocalidad()
        {
            List <string> Localidades = new List <string>();

            Localidades = ClienteNeg.CargarComboLocalidades();
            cmbLocalidad.Items.Clear();
            cmbLocalidad.Text = "Seleccione";
            cmbLocalidad.Items.Add("Seleccione");
            foreach (string item in Localidades)
            {
                cmbLocalidad.Text = "Seleccione";
                cmbLocalidad.Items.Add(item);
            }
        }
Пример #30
0
        private void CargarComboPersonas()
        {
            List <string> Personas = new List <string>();

            Personas = ClienteNeg.CargarComboPersonas(idEmpresa);
            cmbPersonas.Items.Clear();
            cmbPersonas.Text = "Seleccione";
            cmbPersonas.Items.Add("Seleccione");
            foreach (string item in Personas)
            {
                cmbPersonas.Text = "Seleccione";
                cmbPersonas.Items.Add(item);
            }
        }