public override string ToString()
        {
            string minhaString = "PROCESSO: " + IdCliente.ToString() + "|" + IdParteContraria.ToString() +
                                 "|" + AndamentoProcesso.ToString() + "|" + Foro.ToString() + "|" + Area.ToString() + "|" + TipoAcao.ToString();

            return(minhaString);
        }
Exemple #2
0
        public bool Modificar(int IdReferencia)
        {
            OdbcConnection oConnection = this.OpenConnection();

            String strSQL = "UPDATE Referencias SET ";

            strSQL = strSQL + "idCliente = " + IdCliente.ToString() + ",";
            strSQL = strSQL + "Estado = " + Estado.ToString() + ",";
            strSQL = strSQL + "Descripcion  = '" + Descripcion.Replace("'", "''").ToUpper() + "',";
            strSQL = strSQL + "UsuarioCliente  = '" + UsuarioCliente + "',";
            strSQL = strSQL + "Observaciones = '" + Observaciones.Replace("'", "''").ToUpper() + "'";
            strSQL = strSQL + " WHERE IdReferencia=" + IdReferencia.ToString();

            try
            {
                OdbcCommand myCommand = new OdbcCommand(strSQL, oConnection);
                myCommand.ExecuteNonQuery();

                String strAuditoria = "INSERT INTO HistoricoAcciones (idCliente, idUsuario, Instante, Evento, Observaciones, idTipoObjeto, idEstado, idReferencia) VALUES (";
                strAuditoria = strAuditoria + intIdCliente + "," + intIdUsuario + ", getdate(), 'Modificación de Referencia', 'Modificación de la Referencia Nro. " + IdReferencia.ToString() + "', 3, 1," + IdReferencia.ToString() + ")";

                myCommand = new OdbcCommand(strAuditoria, oConnection);
                myCommand.ExecuteNonQuery();
                oConnection.Close();
            }
            catch (Exception e)
            {
                string p = e.Message;
                return(false);
            }
            return(true);
        }
Exemple #3
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Localizador != null)
         {
             hashCode = hashCode * 59 + Localizador.GetHashCode();
         }
         if (Placa != null)
         {
             hashCode = hashCode * 59 + Placa.GetHashCode();
         }
         if (IdCliente != null)
         {
             hashCode = hashCode * 59 + IdCliente.GetHashCode();
         }
         if (Loja != null)
         {
             hashCode = hashCode * 59 + Loja.GetHashCode();
         }
         if (Status != null)
         {
             hashCode = hashCode * 59 + Status.GetHashCode();
         }
         if (IdPagamento != null)
         {
             hashCode = hashCode * 59 + IdPagamento.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemple #4
0
 public string CodContable()
 {
     if (IdCliente.ToString().Length == 5)
     {
         return("122" + IdCliente.ToString());
     }
     return(IdCliente.ToString());
 }
 public void Delete()
 {
     if (Find(this.IdCliente))
     {
         ListaClientes.Remove(this);
         GestionArchivo gs = new GestionArchivo(pathID);
         gs.Save(IdCliente.ToString());
     }
 }
Exemple #6
0
        private void cmdbfRegistar_Click(object sender, EventArgs e)
        {
            int IdVenta;

            if (dgvRegistrarVenta.RowCount > 0)
            {
                if (ValidarClientes())
                {
                    if (chkCliente.Checked == true)
                    {
                        string[] RCli = { "0", txtRazonSocial.Text, cmbTipoDoc.SelectedValue.ToString(), cmbNumeroDocumento.Text, txtDirección.Text };
                        cliente.insActCliente(RCli);
                        IdCliente = cliente.IdCliente();
                    }
                    else
                    {
                        IdCliente = Convert.ToInt32(cmbNumeroDocumento.SelectedValue);
                    }
                    string nSerieVenta = Convert.ToString(0001000);
                    try
                    {
                        string[] RVen = { IdCliente.ToString().ToString(), varpublic.idEmpleado.ToString(), DateTime.Now.ToString("dd-MM-yyyy"),
                                          "2",                             nSerieVenta,                     TotalVenta.ToString(),              TotalVenta.ToString(), Convert.ToString(gananc) };
                        IdVenta = Venta.InsertarVenta(RVen);

                        for (int c = 0; c <= dgvRegistrarVenta.RowCount - 1; c++)
                        {
                            string[] IDVen = { IdVenta.ToString(),                                  dgvRegistrarVenta.Rows[c].Cells[0].Value.ToString(),
                                               dgvRegistrarVenta.Rows[c].Cells[3].Value.ToString(), dgvRegistrarVenta.Rows[c].Cells[4].Value.ToString(),
                                               dgvRegistrarVenta.Rows[c].Cells[5].Value.ToString() };
                            dventa.InsertarDetalleVenta(IDVen);

                            producto.resStock(Convert.ToInt32(dgvRegistrarVenta.Rows[c].Cells[0].Value), Convert.ToInt32(dgvRegistrarVenta.Rows[c].Cells[6].Value));
                        }
                        frmBoletaVenta frmAbout = new frmBoletaVenta();
                        frmAbout.ShowDialog();
                        producto.ProductoId();
                        rellenacombo();
                        dgvRegistrarVenta.Rows.Clear();
                        btnNuevo_Click(sender, e);
                        lblTotalPagar.Text = "Total a pagar";
                        cmbCategoria.Focus();
                        lblMensaje.Text = "Info!";
                    }
                    catch (System.Exception ex) { MessageBox.Show(ex.ToString()); }
                }
            }
            else
            {
                MessageBox.Show("No se puede grabar ingreso," + Char.ConvertFromUtf32(13) + "No existen items o superó límite máximo de items por comprobante", "Aviso");
            }
        }
 private void frmCliente_01_Load(object sender, EventArgs e)
 {
     try
     {
         ac.LlenarCboTipDoc(this); rbMasculino.Checked = true;
         txtIdCliente.Text = IdCliente.ToString();
         BuscarCliente();
     }
     catch (ApplicationException ae)
     {
         MessageBox.Show(ae.Message, "Informacion", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #8
0
        public string Documento(int xSubcuenta)
        {
            foreach (SubCuenta IS in _SubCuentas)
            {
                if (IS.Codigo == xSubcuenta)
                {
                    if (IS.Rut.Length == 12)
                    {
                        return(IS.Rut);
                    }
                }
            }
            if (VerificaCedula(this.Cedula))
            {
                return(this.Cedula.ToString());
            }

            return(IdCliente.ToString());
        }
Exemple #9
0
        /// <summary>
        /// Returns true if Reserva instances are equal
        /// </summary>
        /// <param name="other">Instance of Reserva to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Reserva other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Localizador == other.Localizador ||
                     Localizador != null &&
                     Localizador.Equals(other.Localizador)
                     ) &&
                 (
                     Placa == other.Placa ||
                     Placa != null &&
                     Placa.Equals(other.Placa)
                 ) &&
                 (
                     IdCliente == other.IdCliente ||
                     IdCliente != null &&
                     IdCliente.Equals(other.IdCliente)
                 ) &&
                 (
                     Loja == other.Loja ||
                     Loja != null &&
                     Loja.Equals(other.Loja)
                 ) &&
                 (
                     Status == other.Status ||
                     Status != null &&
                     Status.Equals(other.Status)
                 ) &&
                 (
                     IdPagamento == other.IdPagamento ||
                     IdPagamento != null &&
                     IdPagamento.Equals(other.IdPagamento)
                 ));
        }
        public Cliente()
        {
            Count = ListaClientes.Count;

            GestionArchivo gs = new GestionArchivo(pathID);

            gs.CreateFile();
            string ID = gs.GetDateOne();

            if (ID != null)
            {
                IdCliente = Convert.ToInt32(ID);
                gs.Delete(IdCliente.ToString());
            }
            else
            {
                IdCliente = ListaClientes.Count + 1;
            }
        }
Exemple #11
0
        public string ObtemNomeParticipante()
        {
            if (IdLoja > 0)
            {
                var loja = LojaDAO.Instance.GetElement(IdLoja.GetValueOrDefault());

                if (loja != null)
                {
                    return(loja.NomeFantasia);
                }
            }
            else if (IdFornec > 0)
            {
                var fornec = FornecedorDAO.Instance.GetElement(IdFornec.GetValueOrDefault());

                if (fornec != null)
                {
                    return(fornec.Nomefantasia);
                }
            }
            else if (IdCliente > 0)
            {
                var cliente = ClienteDAO.Instance.GetElement(IdCliente.GetValueOrDefault());

                if (cliente != null)
                {
                    return(cliente.Nome);
                }
            }
            else if (IdTransportador > 0)
            {
                var transp = TransportadorDAO.Instance.GetElement(IdTransportador.GetValueOrDefault());

                if (transp != null)
                {
                    return(transp.NomeFantasia);
                }
            }

            return(string.Empty);
        }
Exemple #12
0
 public string Usuario(IdCliente c);
Exemple #13
0
        public string InsertarVenta(DCliente Cliente)
        {
            string        rpta   = "";
            SqlConnection sqlCon = new SqlConnection();

            try
            {
                sqlCon.ConnectionString = Conexion.cn;
                sqlCon.Open();
                //Comandos
                SqlCommand sqlCmd = new SqlCommand();
                sqlCmd.Connection  = sqlCon;
                sqlCmd.CommandText = "sp_insertarCliente";
                sqlCmd.CommandType = CommandType.StoredProcedure;

                SqlParameter ParIdCliente = new SqlParameter();
                ParIdCliente.ParameterName = "@idPersona";
                ParIdCliente.SqlDbType     = SqlDbType.Int;
                ParIdCliente.Direction     = ParameterDirection.Output;
                sqlCmd.Parameters.Add(ParIdCliente);

                SqlParameter ParNombre = new SqlParameter();
                ParNombre.ParameterName = "@nombre";
                ParNombre.SqlDbType     = SqlDbType.VarChar;
                ParNombre.Size          = 100;
                ParNombre.Value         = Cliente.Nombre;
                sqlCmd.Parameters.Add(ParNombre);

                SqlParameter ParFechaNac = new SqlParameter();
                ParFechaNac.ParameterName = "@fechaNac";
                ParFechaNac.SqlDbType     = SqlDbType.Date;
                ParFechaNac.Value         = Cliente.FechaNac;
                sqlCmd.Parameters.Add(ParFechaNac);

                SqlParameter ParTipoDoc = new SqlParameter();
                ParTipoDoc.ParameterName = "@tipoDoc";
                ParTipoDoc.SqlDbType     = SqlDbType.VarChar;
                ParTipoDoc.Size          = 10;
                ParTipoDoc.Value         = Cliente.TipoDoc;
                sqlCmd.Parameters.Add(ParTipoDoc);

                SqlParameter ParNumDoc = new SqlParameter();
                ParNumDoc.ParameterName = "@nroDoc";
                ParNumDoc.SqlDbType     = SqlDbType.VarChar;
                ParNumDoc.Size          = 11;
                ParNumDoc.Value         = Cliente.NroDoc;
                sqlCmd.Parameters.Add(ParNumDoc);

                SqlParameter ParDir = new SqlParameter();
                ParDir.ParameterName = "@direccion";
                ParDir.SqlDbType     = SqlDbType.VarChar;
                ParDir.Size          = 100;
                ParDir.Value         = Cliente.Direccion;
                sqlCmd.Parameters.Add(ParDir);

                SqlParameter ParEmail = new SqlParameter();
                ParEmail.ParameterName = "@email";
                ParEmail.SqlDbType     = SqlDbType.VarChar;
                ParEmail.Size          = 50;
                ParEmail.Value         = Cliente.Email;
                sqlCmd.Parameters.Add(ParEmail);

                SqlParameter ParTelefono = new SqlParameter();
                ParTelefono.ParameterName = "@telefono";
                ParTelefono.SqlDbType     = SqlDbType.VarChar;
                ParTelefono.Size          = 30;
                ParTelefono.Value         = Cliente.Telefono;
                sqlCmd.Parameters.Add(ParTelefono);

                SqlParameter ParIdTipoCliente = new SqlParameter();
                ParIdTipoCliente.ParameterName = "@idTipoCliente";
                ParIdTipoCliente.SqlDbType     = SqlDbType.Int;
                ParIdTipoCliente.Value         = Cliente.IdTipoCliente;
                sqlCmd.Parameters.Add(ParIdTipoCliente);

                rpta = sqlCmd.ExecuteNonQuery() == 1 ? "OK" : "No se ingresó el Registro";
                if (rpta == "OK")
                {
                    this.IdCliente = Convert.ToInt32(sqlCmd.Parameters["@idPersona"].Value);
                    rpta           = IdCliente.ToString();
                }
            }
            catch (Exception ex)
            {
                rpta = ex.Message;
            }
            finally
            {
                if (sqlCon.State == ConnectionState.Open)
                {
                    sqlCon.Close();
                }
            }
            return(rpta);
        }
Exemple #14
0
        public bool Modificar()
        {
            ConexionDb conexion = new ConexionDb();
            bool       accion   = false;

            accion = conexion.EjecutarDB("Update Clientes set Nombre = '" + Nombre + "', Apellido = '" + Apellido + "', Direccion = '" + Direccion +
                                         "', Email = '" + Email + "', Telefono = '" + Telefono + "', Celular = '" + Celular + "', FechaIngreso = '" + FechaIngreso.ToString("dd/MM//yyyy") + "' Where IdCliente = " + IdCliente.ToString());
            return(accion);
        }
        public override string  ToString()
        {
            string minhaString = "CLIENTE: " + IdCliente.ToString() + "|" + Nome.ToString() + "|" + Cpf.ToString() + "|" + Telefone.ToString();

            return(minhaString);
        }
 public override string ToString()
 {
     return(IdCliente.ToString() + "\t" + Cedula.ToString() + "\t" + Nombre + "\t" + FechaNacimiento.ToShortDateString() + "\t" +
            Sexo.ToString() + "\t" + Telefono.ToString() + "\t" + Correo + "\t" + Direccion + "\t" +
            EstadoCivil.ToString());
 }
 public void DarServicio(IdCliente u);
Exemple #18
0
 bool IEquatable <Cliente> .Equals(Cliente other)
 {
     return(IdCliente.Equals(other.IdCliente));
 }
Exemple #19
0
 public void DarMascota(IdCliente u, IdMascota m);
 public override int GetHashCode()
 {
     return((IdCliente.ToString() + "|" + IdOferta.ToString()).GetHashCode());
 }
Exemple #21
0
 public override string ToString()
 {
     return(IdVenta.ToString() + "\t" + IdCliente.ToString() + "\t" + IdVendedor.ToString() +
            "\t" + IdItem.ToString() + "\t" + FormaPago.ToString());
 }