Example #1
0
        public int existEmpresa(string razonSocial, string cuit, string mail)
        {
            DataTable dt, dr, da = new DataTable();
            int       cant = 0;
            DaoSP     dao  = new DaoSP();

            dt = dao.ConsultarConQuery("Select COUNT(empresa_Cuit) as 'cantidad' from dropeadores.Empresa where empresa_razon_social LIKE " + "'" + razonSocial + "'");
            dr = dao.ConsultarConQuery("Select COUNT(empresa_Cuit) as 'cantidad' from dropeadores.Empresa where empresa_Cuit LIKE " + "'" + cuit + "'");
            da = dao.ConsultarConQuery("Select COUNT(empresa_Cuit) as 'cantidad' from dropeadores.Empresa where empresa_mail LIKE " + "'" + mail + "'");

            foreach (DataRow row in dt.Rows)
            {
                cant = Convert.ToInt32(row["cantidad"]);
            }
            foreach (DataRow row in dr.Rows)
            {
                cant = cant + Convert.ToInt32(row["cantidad"]);
            }
            foreach (DataRow row in da.Rows)
            {
                cant = cant + Convert.ToInt32(row["cantidad"]);
            }

            return(cant);
        }
Example #2
0
        public static bool actualizar(Cliente cliente_seleccionado)
        {
            DaoSP     dao = new DaoSP();
            DataTable dt, dr = new DataTable();
            int       IDcliente = 000000;
            //string cadena_nula = "";
            string   nombre           = cliente_seleccionado.nombre;
            string   apellido         = cliente_seleccionado.apellido;
            string   tipoDocumento    = cliente_seleccionado.tipoDocumento;
            int      numeroDocumento  = cliente_seleccionado.numeroDocumento;
            string   cuil             = cliente_seleccionado.cuil;
            string   email            = cliente_seleccionado.mail;
            int      telefono         = cliente_seleccionado.telefono;
            DateTime fecha_nacimiento = cliente_seleccionado.fechaNacimiento;
            //string fecha_nacimiento = (cliente_seleccionado.Fecha_nacimiento_struct != null) ? cliente_seleccionado.Fecha_nacimiento : cadena_nula;
            string calle     = cliente_seleccionado.Cli_Dir.calle;
            int    numero    = cliente_seleccionado.Cli_Dir.numero;
            int    piso      = cliente_seleccionado.Cli_Dir.piso;
            string depto     = cliente_seleccionado.Cli_Dir.dpto;
            string localidad = cliente_seleccionado.Cli_Dir.localidad;

            string   ciudad            = cliente_seleccionado.Cli_Dir.ciudad;
            int      cp                = cliente_seleccionado.Cli_Dir.cp;
            string   propietarioTar    = cliente_seleccionado.Cli_Tar.propietario;
            string   numeroTar         = cliente_seleccionado.Cli_Tar.numero;
            DateTime fecha_vencimiento = cliente_seleccionado.Cli_Tar.fechaVencimiento;

            //  string fecha_vencimiento = (cliente_seleccionado.Cli_Tar.Fecha_vencimiento_struct != null) ? cliente_seleccionado.Cli_Tar.Fecha_vencimiento : cadena_nula;
            int campoBaja = (cliente_seleccionado.estado) ? 1 : 1;

            //SEGUIR MODIFICANDO
            dt = dao.ConsultarConQuery("SELECT cliente_domicilio FROM dropeadores.Cliente WHERE tipoDocumento like " + "'" + tipoDocumento + "'");
            dr = dao.ConsultarConQuery("SELECT cliente_domicilio FROM dropeadores.Cliente WHERE numeroDocumento like " + "'" + numeroDocumento + "'");

            foreach (DataRow row in dt.Rows)
            {
                foreach (DataRow row1 in dr.Rows)
                {
                    IDcliente = Convert.ToInt32(row["cliente_domicilio"].ToString());
                }
            }
            //TESTEARR!
            if (dao.EjecutarSP("dropeadores.updateDomicilioCliente", IDcliente, calle, numero, piso, depto, localidad, " ", cp) > 0)
            {
                if (dao.EjecutarSP("dropeadores.updateTarjetaCliente", numeroDocumento, propietarioTar, numeroTar, fecha_vencimiento) > 0)
                {
                    if (dao.EjecutarSP("dropeadores.updateCliente", numeroDocumento, nombre, apellido, tipoDocumento, cuil, email, fecha_nacimiento, IDcliente, telefono, campoBaja) > 0)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Example #3
0
        private void CanjePuntos_Load(object sender, EventArgs e)
        {
            ConfigGlobal global         = new ConfigGlobal();
            int          puntosVigentes = 0;

            fechaDelSistema = global.getFechaSistema();
            DaoSP dao = new DaoSP();

            lblPuntosACanjear.Visible = false;
            //Busco los puntos de ese cliente
            puntosVigentes         = puntos.consultarPuntosVigentes(fechaDelSistema, userLogueado.cliente.numeroDocumento);
            lblPuntosVigentes.Text = puntosVigentes.ToString();

            //Busco los premios que pueda a llegar a canjear un cliente,
            //tener en cuenta que los premios tienen su puntaje,
            //por ende el cliente segun sus puntos es el premio que le corresponde.
            DataTable dtPremios = new DataTable();
            string    query     = "select distinct p.Id as IdPremio,p.descripcion as Descripcion,PuntosVigentes,p.puntos as Puntos,FechaVencimiento from dropeadores.Puntos pu, " +
                                  " dropeadores.Premio p where Id_Cliente =" + userLogueado.cliente.numeroDocumento +
                                  " and pu.PuntosVigentes > p.puntos and FechaVencimiento > '" + fechaDelSistema + "' ";

            dtPremios = dao.ConsultarConQuery(query);
            DataTable dtPremios2 = new DataTable();
            string    query2     = "select distinct p.puntos as Puntos,p.descripcion  from dropeadores.Puntos pu, " +
                                   " dropeadores.Premio p where Id_Cliente =" + userLogueado.cliente.numeroDocumento +
                                   " and pu.PuntosVigentes > p.puntos and FechaVencimiento > '" + fechaDelSistema + "' ";

            dtPremios2 = dao.ConsultarConQuery(query2);
            if (dtPremios.Rows.Count <= 0)
            {
                MessageBox.Show("No existen puntos asociados al cliente, o no existen premios para la cantidad de puntos asociados.", "Error al cargar los puntos",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                DataRow rowPremios = dtPremios.Rows[0];
                premio.Id          = int.Parse(rowPremios["IdPremio"].ToString());
                premio.puntos      = int.Parse(rowPremios["Puntos"].ToString());
                premio.descripcion = rowPremios["Descripcion"].ToString();
                CargarData.cargarComboBox(cbxPremios, dtPremios2, "Puntos", "descripcion");
            }


            DataTable dtcli = new DataTable();

            dtcli = dao.ConsultarConQuery("select nombre,apellido,NumeroDocumento from dropeadores.Cliente where NumeroDocumento= " + userLogueado.cliente.numeroDocumento);
            DataRow rowcli = dtcli.Rows[0];

            cliente.nombre          = rowcli["nombre"].ToString();
            cliente.apellido        = rowcli["apellido"].ToString();
            cliente.numeroDocumento = int.Parse(rowcli["NumeroDocumento"].ToString());
            lblCliente.Text         = cliente.nombre + " " + cliente.apellido;
            lblDniCli.Text          = cliente.numeroDocumento.ToString();
        }
Example #4
0
        public int actualizarPuntaje(int idCliente, int puntosParaCanjear, int idPremio, int puntosVigenteslbl)
        {
            DaoSP     dao            = new DaoSP();
            DataTable dtPuntosCanjeo = new DataTable();

            //pasarle cliente y puntos a restar,
            //Los ordeno por los q ya se esten por vencer para restar esos puntos
            dtPuntosCanjeo = dao.ConsultarConQuery("select * from dropeadores.Puntos where Id_Cliente=" + idCliente + "order by FechaVencimiento asc");
            //List<Puntos> puntos = new List<Puntos>();
            Puntos p = new Puntos();
            int    sumatoriaPuntosCanjeados = 0;
            int    sumatoriaPuntosActuales  = puntosVigenteslbl;

            //tengo q dividir la cantidad de puntos a canjear sobre los puntos x compra
            foreach (DataRow itemRow in dtPuntosCanjeo.Rows)
            {
                //p.Id_Premio=int.Parse(itemRow["Id_Premio"].ToString());
                //puntos vigentes es la sumatoria de todos los puntos de todas las compras de ese cliente
                p.PuntosVigentes   = int.Parse(itemRow["PuntosVigentes"].ToString());
                p.FechaVencimiento = DateTime.Parse(itemRow["FechaVencimiento"].ToString());
                p.Id_Compra        = int.Parse(itemRow["Id_Compra"].ToString());
                //Puntos es punto por compra
                p.puntos     = int.Parse(itemRow["puntos"].ToString());
                p.Id_Cliente = int.Parse(itemRow["Id_Cliente"].ToString());
                //La cantidad de puntos que tiene puede canjear cualquier cosa del comboBox.
                //fijarse q el IF anda mal xq sigue descontando, deberia parar cuando los puntos q va canjeando sea
                //los q tiene ese premio.
                if (sumatoriaPuntosActuales - p.puntos > 0 && sumatoriaPuntosCanjeados <= puntosParaCanjear)
                {
                    if (dao.EjecutarSP("dropeadores.DescontarPuntosPorCompra", p.Id_Cliente, p.Id_Compra) <= 0)
                    {
                        break;
                    }
                    sumatoriaPuntosActuales   = sumatoriaPuntosActuales - p.puntos;
                    sumatoriaPuntosCanjeados += p.puntos;
                }
            }
            if (dao.EjecutarSP("dropeadores.ActualizarPuntaje", idCliente, idPremio, puntosParaCanjear) <= 0)
            {
                MessageBox.Show("Ha ocurrido un error..", "Error al canjear los puntos",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(-1);
            }
            else
            {
                DataTable dtPuntosActualizados = new DataTable();
                dtPuntosActualizados = dao.ConsultarConQuery("select PuntosVigentes from dropeadores.Puntos where Id_Cliente=" + idCliente + "order by FechaVencimiento asc");
                DataRow drow = dtPuntosActualizados.Rows[0];
                sumatoriaPuntosActuales = int.Parse(drow["PuntosVigentes"].ToString());
            }

            return(0);
        }
Example #5
0
        public static bool actualizar(Empresa empresa_Seleccionada)
        {
            DaoSP     dao       = new DaoSP();
            DataTable dt        = new DataTable();
            int       IDempresa = 000000;

            string cuit        = empresa_Seleccionada.Empresa_Cuit;
            string razonSocial = empresa_Seleccionada.Empresa_razon_social;
            string email       = empresa_Seleccionada.Empresa_mail;
            int    telefono    = empresa_Seleccionada.Empresa_telefono;
            string calle       = empresa_Seleccionada.Empresa_Dom.calle;
            int    numero      = empresa_Seleccionada.Empresa_Dom.numero;
            int    piso        = empresa_Seleccionada.Empresa_Dom.piso;
            string depto       = empresa_Seleccionada.Empresa_Dom.dpto;
            string localidad   = empresa_Seleccionada.Empresa_Dom.localidad;
            string ciudad      = empresa_Seleccionada.Empresa_Dom.ciudad;
            int    cp          = empresa_Seleccionada.Empresa_Dom.cp;
            int    campoBaja   = (empresa_Seleccionada.Empresa_estado) ? 1 : 1;

            dt = dao.ConsultarConQuery("SELECT empresa_domicilio FROM dropeadores.Empresa WHERE empresa_Cuit like " + "'" + cuit + "'");
            foreach (DataRow row in dt.Rows)
            {
                IDempresa = Convert.ToInt32(row["empresa_domicilio"].ToString());
            }

            if (dao.EjecutarSP("dropeadores.updateDomicilioEmpresa", IDempresa, calle, numero, piso, depto, localidad, ciudad, cp) > 0)
            {
                if (dao.EjecutarSP("dropeadores.updateEmpresa", cuit, razonSocial, email, telefono, campoBaja) > 0)
                {
                    return(true);
                }
            }

            return(false);
        }
Example #6
0
 //si el estado es 0=Borrador
 //si el estado es 1=Activa o publicada
 //si el estado es 2=Finalizada
 public Publicacion getPublicacionByCodigo(int codigo)
 {
     try
     {
         Publicacion publicacion = new Publicacion();
         DaoSP       dao         = new DaoSP();
         DataTable   dt          = new DataTable();
         dt = dao.ConsultarConQuery("SELECT * FROM DROPEADORES.PUBLICACION where id= " + codigo);
         DataRow row = dt.Rows[0];
         publicacion.codigo           = int.Parse(row["id"].ToString());
         publicacion.descripcion      = (row["descripcion"].ToString());
         publicacion.direccion        = row["direccion"].ToString();
         publicacion.empresaId        = row["empresaId"].ToString();
         publicacion.estado           = int.Parse(row["estado"].ToString());
         publicacion.fechaEspectaculo = DateTime.Parse(row["fechaEspectaculo"].ToString());
         publicacion.fechaPublicacion = DateTime.Parse(row["fechaPublicacion"].ToString());
         publicacion.rubroId          = int.Parse(row["rubroId"].ToString());
         publicacion.gradoId          = int.Parse(row["gradoId"].ToString());
         publicacion.stock            = int.Parse(row["stock"].ToString());
         return(publicacion);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #7
0
        private void SeleccionCategorias_Load(object sender, EventArgs e)
        {
            DaoSP     X   = new DaoSP();
            DataTable cat = X.ConsultarConQuery("select rubro_Descripcion as 'CATEGORÍAS' from dropeadores.Rubro order by rubro_Descripcion asc");

            configuracionGrilla(cat);
        }
Example #8
0
        private void cargarTabla()
        {
            DaoSP prueba = new DaoSP();

            CargarData.cargarGridView(dataGridViewEmpresa, prueba.ConsultarConQuery("select empresa_Cuit as 'CUIT',empresa_mail as 'MAIL',empresa_razon_social as 'RAZON SOCIAL'from dropeadores.Empresa WHERE empresa_estado=1"));

            CargarData.AddButtonEliminar(dataGridViewEmpresa);
        }
Example #9
0
        private void cargarTabla()
        {
            DaoSP prueba = new DaoSP();

            CargarData.cargarGridView(dataGridViewEmpresa, prueba.ConsultarConQuery("select * from dropeadores.Empresa"));

            CargarData.AddButtonEliminar(dataGridViewEmpresa);
        }
Example #10
0
        //public string Usr
        //{
        //    get { return usr; }
        //    set { usr = value; }
        //}
        #endregion

        public bool existeRol(string nombre)
        {
            DaoSP     dao = new DaoSP();
            DataTable dt  = new DataTable();

            dt = dao.ConsultarConQuery("SELECT nombre FROM dropeadores.Rol WHERE nombre LIKE '" + nombre + "'");
            return(dt.Rows.Count > 0 ? true:false);
        }
Example #11
0
        private void cargarTabla()
        {
            DaoSP prueba = new DaoSP();

            CargarData.cargarGridView(dataGridCliente, prueba.ConsultarConQuery("SELECT nombre as 'NOMBRE',apellido as 'APELLIDO' ,tipoDocumento as 'tipoDocumento' ,numeroDocumento as 'numeroDocumento' ,mail as 'MAIL', estado as 'ESTADO' from dropeadores.Cliente WHERE estado = 1"));

            CargarData.AddButtonEliminar(dataGridCliente);
        }
Example #12
0
        private void Form1_Load(object sender, EventArgs e)
        {
            DaoSP     dao   = new DaoSP();
            DataTable roles = dao.ConsultarConQuery("SELECT Id_Funcionalidad,descripcion FROM dropeadores.Funcionalidad");

            CargarData.cargarGridView(dgvFuncionalidades, roles);
            CargarData.AddCheckColumn(dgvFuncionalidades, "Seleccionar");
        }
 private void RolPorFuncionalidadesModificar_Load(object sender, EventArgs e)
 {
     try
     {
         DaoSP     dao = new DaoSP();
         DataTable dt  = new DataTable();
         dt = dao.ConsultarConQuery("SELECT * FROM dropeadores.Rol where estado=1");
         CargarData.cargarComboBox(comboBox1, dt, "Id_Rol", "nombre");
         DataTable roles = dao.ConsultarConQuery("SELECT * FROM dropeadores.Funcionalidad");
         CargarData.cargarGridView(dgvFuncionalidades, roles);
         CargarData.AddCheckColumn(dgvFuncionalidades, "Seleccionar");
         txtNombreRol.Text = "";
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #14
0
        public bool existeUsername(string username)
        {
            DaoSP     daoSP = new DaoSP();
            DataTable dt;
            string    query = "SELECT username FROM DROPEADORES.USUARIO where username like '" + username + "'";

            dt = daoSP.ConsultarConQuery(query);

            return(dt.Rows.Count > 0);
        }
Example #15
0
        internal int existEmpresa(string cuil, int numDni)
        {
            DataTable dt, dr, da = new DataTable();
            int       cant = 0;
            DaoSP     dao  = new DaoSP();

            dt = dao.ConsultarConQuery("select count(c.numeroDocumento) as 'cantidad' from dropeadores.Cliente c where c.estado=1 and c.cuil LIKE" + "'" + cuil + "'");
            dr = dao.ConsultarConQuery("select count(c.numeroDocumento) as 'cantidad' from dropeadores.Cliente c where c.estado=1 and c.numeroDocumento=" + numDni);
            foreach (DataRow row in dt.Rows)
            {
                cant = Convert.ToInt32(row["cantidad"]);
            }
            foreach (DataRow row in dr.Rows)
            {
                cant = cant + Convert.ToInt32(row["cantidad"]);
            }

            return(cant);
        }
Example #16
0
        private int tieneTarjeta(Usuario user)
        {
            DataTable dt, dr, da = new DataTable();
            int       cant = 0;
            DaoSP     dao  = new DaoSP();

            dt = dao.ConsultarConQuery("select count(clieteId) as 'cantidad' from dropeadores.TarjetaCredito t join dropeadores.Cliente c on(c.numeroDocumento=t.clieteId) join dropeadores.Usuario u on (u.clienteId=c.numeroDocumento) where u.clienteId='" + user.cliente.numeroDocumento + "'");
            foreach (DataRow row in dt.Rows)
            {
                cant = Convert.ToInt32(row["cantidad"]);
            }

            return(cant);
        }
Example #17
0
        public Rol obtenerRol(int indexRolSeleccionado)
        {
            DataTable dt  = new DataTable();
            DaoSP     dao = new DaoSP();

            dt = dao.ConsultarConQuery("select * from dropeadores.Rol WHERE Id_Rol=" + indexRolSeleccionado);
            DataRow row = dt.Rows[0];

            return(new Rol
            {
                nombre = row["nombre"].ToString(),
                estado = bool.Parse(row["estado"].ToString())
            });
        }
Example #18
0
        public int existGradoEnBd(string tipo)
        {
            DataTable dt   = new DataTable();
            int       cant = 0;
            DaoSP     dao  = new DaoSP();

            dt = dao.ConsultarConQuery("select count(g.id) as 'cantidad' from dropeadores.Grado g WHERE g.tipo LIKE" + "'" + tipo + "'");

            foreach (DataRow row in dt.Rows)
            {
                cant = Convert.ToInt32(row["cantidad"]);
            }
            return(cant);
        }
Example #19
0
        private void CategoriaUbicacion_Load(object sender, EventArgs e)
        {
            //Necesito en empresa un metodo que dado el id me devuelva la razon social.
            DataTable dtGrado         = new DataTable();
            DataTable dtRubro         = new DataTable();
            DataTable dtTipoUbicacion = new DataTable();
            DaoSP     dao             = new DaoSP();

            dtGrado         = dao.ConsultarConQuery("SELECT id, tipo FROM dropeadores.Grado");
            dtRubro         = dao.ConsultarConQuery("SELECT id,rubro_Descripcion FROM dropeadores.Rubro");
            dtTipoUbicacion = dao.ConsultarConQuery("select distinct Ubicacion_Tipo_Descripcion,Ubicacion_Tipo_Codigo as Codigo from gd_esquema.Maestra");
            CargarData.cargarComboBox(comboRubro, dtRubro, "id", "rubro_Descripcion");
            CargarData.cargarComboBox(comboGradoPublicacion, dtGrado, "id", "tipo");
            //CargarData.cargarComboBox(comboBox1, dtTipoUbicacion, "Ubicacion_Tipo_Descripcion", "Ubicacion_Tipo_Descripcion");
            lblEstado.Visible       = true;
            lblUserLogueado.Visible = true;
            btnSubirTxt.Visible     = false;
            //BUSCAR LA EMPRESAAAA!!
            lblUserLogueado.Text                   = userLogueado.empresa.Empresa_Cuit;
            lblEstado.Text                         = "Borrador";
            dateTimePickerEspectaculo.Format       = DateTimePickerFormat.Custom;
            dateTimePickerEspectaculo.CustomFormat = "MM/dd/yyyy hh:mm:ss";
        }
Example #20
0
 public RolEliminar()
 {
     InitializeComponent();
     try
     {
         DaoSP     dao = new DaoSP();
         DataTable dt  = new DataTable();
         dt = dao.ConsultarConQuery("SELECT * FROM dropeadores.Rol where estado=1");
         CargarData.cargarComboBox(comboBox1, dt, "Id_Rol", "nombre");
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #21
0
        private void EditarPublicacion_Load(object sender, EventArgs e)
        {
            DataTable dt  = new DataTable();
            DaoSP     dao = new DaoSP();
            //ESTADO EN CERO INDICA QUE ES BORRADOR!.
            string query = "SELECT p.id as 'Codigo',r.rubro_Descripcion as 'Rubro',g.tipo as 'Grado',p.descripcion as 'Descr. Espectaculo',stock,fechaPublicacion as 'Fecha Publicacion',fechaEspectaculo as 'Fecha Espectaculo',direccion as 'Direccion Espec.'FROM dropeadores.Publicacion p " +
                           " join dropeadores.Rubro r on(r.id=p.rubroId)" +
                           " join dropeadores.Grado g on(g.id=p.gradoId)" +
                           " where empresaId= '" + userLogueado.empresa.Empresa_Cuit + "' and p.estado=0";

            dt = dao.ConsultarConQuery(query);
            CargarData.cargarGridView(dataGridView1, dt);
            lblEmpleado.Text = userLogueado.empresa.Empresa_Cuit;
            CargarData.AddButtonEditColumn(dataGridView1);
        }
Example #22
0
        public DataTable getCompras(int numeroDoc)
        {
            Compra    comprasCliente = new Compra();
            DataTable dtPremios      = new DataTable();
            DaoSP     dao            = new DaoSP();
            string    query          = "SELECT factura, compra_fecha as 'Fecha' ,compra_cantidad as 'Cantidad',"
                                       + " compra_precio as 'Precio' ,compra_ubicacionFila as 'Fila' ,compra_ubicacionAsiento as 'Asiento' , p.descripcion"
                                       + "  from dropeadores.Compra c"
                                       + " join dropeadores.Publicacion p on( c.compra_ubicacionPublic=p.id)"
                                       + " WHERE compra_numero_documento="
                                       + numeroDoc;

            dtPremios = dao.ConsultarConQuery(query);
            return(dtPremios);
        }
Example #23
0
        public ComprarPPAL(Usuario user)
        {
            InitializeComponent();
            usuario = user;
            DaoSP     tj          = new DaoSP();
            DataTable dt          = new DataTable();
            string    medioDePago = "";

            dt = tj.ConsultarConQuery("select t.tipo as 'tipoTarjeta' from dropeadores.Cliente c join dropeadores.TarjetaCredito t on (t.clieteId=c.numeroDocumento) where c.numeroDocumento=" + usuario.cliente.numeroDocumento);
            foreach (DataRow row in dt.Rows)
            {
                medioDePago = Convert.ToString(row["tipoTarjeta"]);
            }
            labelMedioPago.Text = medioDePago.ToString();
        }
Example #24
0
        private void EditarUnaPublicacion_Load(object sender, EventArgs e)
        {
            DataTable dtGrado = new DataTable();
            DataTable dtRubro = new DataTable();
            DaoSP     dao     = new DaoSP();

            dtGrado = dao.ConsultarConQuery("SELECT id, tipo FROM dropeadores.Grado");
            dtRubro = dao.ConsultarConQuery("SELECT id,rubro_descripcion FROM dropeadores.Rubro");
            CargarData.cargarComboBox(comboRubro, dtRubro, "id", "rubro_descripcion");
            CargarData.cargarComboBox(comboGradoPublicacion, dtGrado, "id", "tipo");
            dateTimePicker1.Format       = DateTimePickerFormat.Custom;
            dateTimePicker1.CustomFormat = "MM/dd/yyyy hh:mm:ss";

            publicacion                         = publicacion.getPublicacionByCodigo(publicacion.codigo);
            textDescripcion.Text                = publicacion.descripcion;
            textDireccion.Text                  = publicacion.direccion;
            textStock.Text                      = publicacion.stock.ToString();
            estadoPublicacion.Text              = "Borrador";
            dateTimePickerPublicacion.Value     = publicacion.fechaPublicacion;
            comboGradoPublicacion.SelectedIndex = publicacion.gradoId;
            comboRubro.SelectedIndex            = publicacion.rubroId;
            lblCodigo.Text                      = publicacion.codigo.ToString();
            lblEmpresa.Text                     = publicacion.empresaId;
        }
Example #25
0
 public bool sacarRolATodosLosUsuarios(int indexAEliminar)
 {
     try
     {
         DaoSP     dao  = new DaoSP();
         Usuario   user = new Usuario();
         DataTable dt   = new DataTable();
         dt = dao.ConsultarConQuery("select usuarioId from dropeadores.RolXUsuario where rolId=" + indexAEliminar);
         this.eliminadoFisicoRolesXUser(dt, indexAEliminar);
         return(true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     //se le debe quitar el rol inhabilitado a todos aquellos usuarios que lo posean.
 }
Example #26
0
 public bool hayAlgunEspectaculoEnEstaFecha(DateTime fechaImportada)
 {
     try
     {
         DaoSP     dao   = new DaoSP();
         DataTable dt    = new DataTable();
         string    query = "SELECT * FROM DROPEADORES.Publicacion where YEAR(fechaEspectaculo) = YEAR('" + fechaImportada + "')"
                           + " AND MONTH(fechaEspectaculo) = MONTH('" + fechaImportada + "') AND DAY(fechaEspectaculo)= DAY('" + fechaImportada + "')"
                           + " AND DATEPART(HOUR,fechaEspectaculo) = DATEPART(HOUR,'" + fechaImportada + "')";
         dt = dao.ConsultarConQuery(query);
         return(dt.Rows.Count > 0);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #27
0
 public bool existeFechayHoraSinLote()
 {
     try
     {
         DaoSP     dao   = new DaoSP();
         DataTable dt    = new DataTable();
         string    query = "SELECT fechaEspectaculo from dropeadores.Publicacion WHERE datepart(YEAR,fechaEspectaculo)= " + (this.fechaEspectaculo).Year
                           + " AND datepart(month,fechaEspectaculo) =" + this.fechaEspectaculo.Month
                           + " AND datepart(DAY,fechaEspectaculo) =" + this.fechaEspectaculo.Day
                           + " AND datepart(HOUR,fechaEspectaculo) =" + this.fechaEspectaculo.Hour;
         dt = dao.ConsultarConQuery(query);
         return(dt.Rows.Count > 0);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #28
0
        public int consultarPuntosVigentes(DateTime fechaDelSistema, int IdCliente)
        {
            DaoSP     dao      = new DaoSP();
            DataTable dtPuntos = new DataTable();
            string    query    = "select top 1 PuntosVigentes from dropeadores.Puntos where PuntosVigentes>0 and Id_Cliente =" + IdCliente
                                 + " and FechaVencimiento > '" + fechaDelSistema + "'";

            dtPuntos = dao.ConsultarConQuery(query);
            if (dtPuntos.Rows.Count <= 0)
            {
                this.PuntosVigentes = 0;
            }
            else
            {
                DataRow rowPuntos = dtPuntos.Rows[0];
                this.PuntosVigentes = int.Parse(rowPuntos["PuntosVigentes"].ToString());
            }

            return(this.PuntosVigentes);
        }
Example #29
0
        public ConfirmarCompra(List <Ubicacion> ubicacSeleccionadas, Usuario user)
        {
            DaoSP tj = new DaoSP();

            ubicacionesSeleccionadas = ubicacSeleccionadas;
            usuario = user;
            cliente.numeroDocumento = usuario.cliente.numeroDocumento;
            DataTable dt          = new DataTable();
            string    medioDePago = "";

            InitializeComponent();
            dt = tj.ConsultarConQuery("select t.descripcion as 'tipoTarjeta',Id as 'Id' from dropeadores.Cliente c join dropeadores.TarjetaCredito t on (t.clieteId=c.numeroDocumento) where c.numeroDocumento=" + usuario.cliente.numeroDocumento);

            foreach (DataRow row in dt.Rows)
            {
                medioDePago = Convert.ToString(row["tipoTarjeta"]);
                IDtarjeta   = Convert.ToInt32(row["Id"]);
            }
            labelMedioPago.Text = medioDePago.ToString();
        }
Example #30
0
        private void btnEditUbicacion_Click(object sender, EventArgs e)
        {
            a.Visible  = false;
            b.Visible  = false;
            c.Visible  = false;
            d.Visible  = false;
            ee.Visible = false;
            f.Visible  = false;
            g.Visible  = false;
            h.Visible  = false;
            i.Visible  = false;
            j.Visible  = false;
            //groupBox1.Visible = false;
            lblEmpresa.Visible = false;
            lblCodigo.Visible  = false;
            //lblTextLote.Visible = false;
            comboGradoPublicacion.Visible     = false;
            comboRubro.Visible                = false;
            textStock.Visible                 = false;
            dateTimePicker1.Visible           = false;
            dateTimePickerPublicacion.Visible = false;
            btnEditUbicacion.Visible          = false;
            textDescripcion.Visible           = false;
            textDireccion.Visible             = false;
            estadoPublicacion.Visible         = false;
            button2.Visible = false;
            MessageBox.Show("Si ud quiere modificar las ubicaciones deberá generar una nueva publicacion. sólo podrá modificar el precio por categoria.");
            DaoSP     dao         = new DaoSP();
            DataTable dtCategoria = new DataTable();

            comboCategoria.Visible = true;
            dtCategoria            = dao.ConsultarConQuery("SELECT codigo,descripcion FROM dropeadores.TipoUbicacion");
            CargarData.cargarComboBox(comboCategoria, dtCategoria, "codigo", "descripcion");
            lblTextoCategoria.Visible     = true;
            lblCategoria.Visible          = true;
            lblPrecio.Visible             = true;
            textPrecio.Visible            = true;
            btnPrecioPorCategoria.Visible = true;
        }