예제 #1
0
        private void BtnHabSuc_Click(object sender, EventArgs e)
        {
            if (DtGrdVwHabSuc.SelectedRows.Count > 0)
            {
                if (MessageBox.Show("¿Esta seguro de habilitar esta Sucursal?", "Advertencia!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    //Llevar a cabo la desactivacion

                    DatosClient enviar = new DatosClient();
                    enviar.Estado            = true;
                    enviar.SucursalOperarios = Convert.ToString(DtGrdVwHabSuc.CurrentRow.Cells["NOMSUCURSAL"].Value);
                    int res = UsuarioDAL_C.EstadosSucursales(enviar);
                }
                else
                {
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("Seleccione una Sucursal a Habilitar");
            }

            this.Close();
        }
예제 #2
0
        private void BtnEnviar_Click(object sender, EventArgs e)
        {
            if (TxtBxContrasenaClient.Text == TxtBxConfirContraClient.Text)
            {
                DatosClient enviar = new DatosClient();
                enviar.NomUsu     = TxtBxNombreClient.Text;
                enviar.NumIdUsu   = TxtBxIdClient.Text;
                enviar.FechNacUsu = MskTxtbxFechaNacClient.Text;
                enviar.TelUsu     = TxtBxTelefonoClient.Text;
                enviar.CorreoUsu  = TxtBxEmailClient.Text;
                enviar.DirDomUsu  = TxtBxDirDomClient.Text;
                enviar.Contrasena = TxtBxContrasenaClient.Text;
                enviar.IdTipoId   = Convert.ToString(CmbBoxIdTipoId.SelectedValue);

                int resultado = UsuarioDAL_C.RegistrarData(enviar, "5");

                if (resultado > 0)
                {
                    MessageBox.Show("Datos guardados correctamente", "Datos guardados", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("No se guardaron los datos correctamente", "Error al guardar los datos", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                this.Close();
                Index index = new Index();
                index.Show();
            }
        }
예제 #3
0
        private void btnElimCiudad_Click(object sender, EventArgs e)
        {
            if (DtGrdVTabCiudades.SelectedRows.Count > 0)
            {
                if (MessageBox.Show("¿Esta seguro de Desactivar esta Ciudad?", "Advertencia!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    //Llevar a cabo la desactivacion

                    DatosClient enviar = new DatosClient();
                    enviar.Estado    = false;
                    enviar.CiudadUsu = Convert.ToString(DtGrdVTabCiudades.CurrentRow.Cells["NOMCIUDAD"].Value);
                    int res = UsuarioDAL_C.EstadosCiudades(enviar);

                    MostrarCiudades();
                }
                else
                {
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("Seleccione una ciudad a eliminar");
            }
        }
예제 #4
0
        public void ListarCiudades()
        {
            UsuarioDAL_C Ciudad = new UsuarioDAL_C();

            cmbCiudad.DisplayMember = "NomCiudad";
            cmbCiudad.ValueMember   = "IdCiudad";
            cmbCiudad.DataSource    = Ciudad.ListarCiudades();
        }
예제 #5
0
        public void ListarCiudades()
        {
            UsuarioDAL_C Ciudad = new UsuarioDAL_C();

            CmbBxSelecCiudRegSuc.DataSource    = Ciudad.ListarCiudades();
            CmbBxSelecCiudRegSuc.DisplayMember = "NomCiudad";
            CmbBxSelecCiudRegSuc.ValueMember   = "IdCiudad";
        }
예제 #6
0
        public void ListarTipoId()
        {
            UsuarioDAL_C TipoId = new UsuarioDAL_C();

            CmbBoxIdTipoId.DataSource    = TipoId.ListarIdTipoId();
            CmbBoxIdTipoId.DisplayMember = "NomTipoId";
            CmbBoxIdTipoId.ValueMember   = "IdTipoId";
        }
예제 #7
0
        public void ListarTipoPer()
        {
            UsuarioDAL_C TipoPer = new UsuarioDAL_C();

            cmbTipoUsu.DataSource    = TipoPer.ListarTipoPer();
            cmbTipoUsu.DisplayMember = "DescTipoPer";
            cmbTipoUsu.ValueMember   = "IdTipoPer";
        }
예제 #8
0
        private void cmbCiudad_SelectedValueChanged(object sender, EventArgs e)
        {
            UsuarioDAL_C SucXCiu = new UsuarioDAL_C();

            cmbSucOper.DisplayMember = "NomSucursal";
            cmbSucOper.ValueMember   = "IdSucursal";
            cmbSucOper.DataSource    = SucXCiu.ListarSucursalesbyCiudad(Convert.ToInt32(cmbCiudad.SelectedValue));

            if (Convert.ToString(cmbCiudad.DataSource) == "")
            {
                cmbSucOper.Text = "*Seleccione";
            }
        }
예제 #9
0
        private void btnEnviar_Click(object sender, EventArgs e)
        {
            if (TxtBxNombreClient.Text != "" && TxtBxIdClient.Text != "" && MskTxtbxFechaNacClient.Text != "" && TxtBxTelefonoClient.Text != "" && TxtBxEmailClient.Text != "" && TxtBxDirDomClient.Text != "" && TxtBxContrasenaClient.Text != "" && TxtBxConfirContraClient.Text != "")
            {
                if (TxtBxContrasenaClient.Text == TxtBxConfirContraClient.Text)
                {
                    DatosClient enviar = new DatosClient();
                    enviar.NomUsu    = TxtBxNombreClient.Text;
                    enviar.IdTipoId  = Convert.ToString(CmbBoxIdTipoId.SelectedValue);
                    enviar.IdTipoPer = Convert.ToString(cmbTipoUsu.SelectedValue);
                    enviar.CiudadUsu = Convert.ToString(cmbCiudad.SelectedValue);
                    if (Convert.ToString(cmbTipoUsu.Text) == "Cliente")
                    {
                        enviar.SucursalOperarios = Convert.ToString(null);
                    }
                    else
                    {
                        enviar.SucursalOperarios = Convert.ToString(cmbSucOper.SelectedValue);
                    }
                    enviar.NumIdUsu   = TxtBxIdClient.Text;
                    enviar.FechNacUsu = MskTxtbxFechaNacClient.Text;
                    enviar.TelUsu     = TxtBxTelefonoClient.Text;
                    enviar.CorreoUsu  = TxtBxEmailClient.Text;
                    enviar.DirDomUsu  = TxtBxDirDomClient.Text;
                    enviar.Contrasena = TxtBxContrasenaClient.Text;

                    int resultado = UsuarioDAL_C.RegistrarUsu(enviar);

                    if (resultado > 0)
                    {
                        MensajeError("Datos guardados correctamente.");
                        TxtBxNombreClient.Clear();
                        TxtBxIdClient.Clear();
                        MskTxtbxFechaNacClient.Clear();
                        TxtBxTelefonoClient.Clear();
                        TxtBxEmailClient.Clear();
                        TxtBxDirDomClient.Clear();
                        TxtBxContrasenaClient.Clear();
                        TxtBxConfirContraClient.Clear();
                    }
                    else
                    {
                        MensajeError("No se guardaron los datos.");
                    }
                }
            }
            else
            {
                MensajeError("Asegurese de llenar todos los campos.");
            }
        }
예제 #10
0
        public void ListarSucursales()
        {
            UsuarioDAL_C SucuOrigen = new UsuarioDAL_C();

            cmbIdSucOri.DataSource    = SucuOrigen.ListarSucursales();
            cmbIdSucOri.DisplayMember = "NomSucursal";
            cmbIdSucOri.ValueMember   = "IdSucursal";

            UsuarioDAL_C SucuDestino = new UsuarioDAL_C();

            cmbIdSucDes.DataSource    = SucuDestino.ListarSucursales();
            cmbIdSucDes.DisplayMember = "NomSucursal";
            cmbIdSucDes.ValueMember   = "IdSucursal";
        }
예제 #11
0
        private void btnConfirmar_Click(object sender, EventArgs e)
        {
            if (txtNumId.Text != "" && lblShowFechaEnvio.Text != "" && txtNumIdDes.Text != "" && txtNomDes.Text != "" && txtTelDes.Text != "" && txtDirDes.Text != "" && txtDetEnvio.Text != "")
            {
                DatosClient enviar = new DatosClient();
                enviar.NumIdUsu        = txtNumId.Text;
                enviar.ValTotalEnvio   = CacheRegEnvio.ValTotalEnvio;
                enviar.IdEstadoEnvio   = "1";
                enviar.FechEnvio       = lblShowFechaEnvio.Text;
                enviar.IdTipoPer       = "5";
                enviar.SucursalOrigen  = Convert.ToString(cmbIdSucOri.SelectedValue);
                enviar.SucursalDestino = Convert.ToString(cmbIdSucDes.SelectedValue);
                enviar.IdDestinatario  = txtNumIdDes.Text;
                enviar.NomDestinatario = txtNomDes.Text;
                enviar.TelDestinatario = txtTelDes.Text;
                enviar.DirDestinatario = txtDirDes.Text;
                enviar.DetEnvio        = txtDetEnvio.Text;

                int res = UsuarioDAL_C.RegistrarEnvio(enviar);

                if (res > 0)
                {
                    MensajeError("Datos guardados correctamente.");
                    txtNumId.Enabled     = false;
                    cmbIdSucOri.Enabled  = false;
                    cmbIdSucDes.Enabled  = false;
                    txtNumIdDes.Enabled  = false;
                    txtNomDes.Enabled    = false;
                    txtTelDes.Enabled    = false;
                    txtDirDes.Enabled    = false;
                    txtDetEnvio.Enabled  = false;
                    btnConfirmar.Enabled = false;
                    btnNuevoReg.Enabled  = true;

                    UsuarioDAL_C.CrearNumeroGuia();
                    txtNumGuia.Text = Convert.ToString(CacheRegEnvio.IdEnvioGuia);
                }
            }
            else
            {
                MensajeError("Por favor llene los campos .");
            }
        }
 private void btnAnularEnvio_Click(object sender, EventArgs e)
 {
     if (dgvSolicAnulacion.SelectedRows.Count > 0)
     {
         if (MessageBox.Show("¿Esta seguro de anular el envio?", "Advertencia!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             //Llevar a cabo la anulación del envío
             DatosClient enviar = new DatosClient();
             enviar.IdEstadoEnvio = "6";
             enviar.IdEnvioGuia   = Convert.ToString(dgvSolicAnulacion.CurrentRow.Cells["N° GUIA"].Value);
             int res = UsuarioDAL_C.AnulacionEnvio(enviar);
             MensajeError("El envío ha sido anulado exitosamente.");
             dgvSolAnul();
         }
     }
     else
     {
         MensajeError("Seleccione el envío a anular.");
     }
 }
예제 #13
0
        private void BtnRegSuc_Click(object sender, EventArgs e)
        {
            if (txtRegSuc.Text != "NOMBRE DE LA SUCURSAL")
            {
                if (UsuarioDAL_C.RegistrarSuc(Convert.ToInt32(CmbBxSelecCiudRegSuc.SelectedValue), txtRegSuc.Text) > 0)
                {
                    MensajeError("Ciudad registrada correctamente.");
                }
                else
                {
                    MensajeError("La ciudad no pudo ser registrada.");
                }
            }
            else
            {
                MensajeError("Ingrese un nombre para la ciudad.");
            }

            MostrarSucursales();
        }
예제 #14
0
        /*Buscar usuario en el formulario de registro de envios*/
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            if (txtNumId.Text != "")
            {
                DatosClient enviar = new DatosClient();
                enviar.NumIdUsu  = txtNumId.Text;
                enviar.IdTipoPer = "5";

                int res = UsuarioDAL_C.CosultarUsuarios(enviar);

                if (res > 0)
                {
                    InfoUsuariosRegEnvios();
                    lblNomUsu.Visible    = true;
                    lblCorreoUsu.Visible = true;
                    lblTelUsu.Visible    = true;
                    lblDirUsu.Visible    = true;

                    CalcValor calcval = new CalcValor();
                    calcval.ShowDialog();

                    cmbIdSucOri.Enabled  = true;
                    cmbIdSucDes.Enabled  = true;
                    txtNumIdDes.Enabled  = true;
                    txtNomDes.Enabled    = true;
                    txtTelDes.Enabled    = true;
                    txtDirDes.Enabled    = true;
                    txtDetEnvio.Enabled  = true;
                    btnConfirmar.Enabled = true;
                    lblValEnvio.Text     = "COP $ " + CacheRegEnvio.ValTotalEnvio;
                }
                else
                {
                    MensajeError("Usuario no existe.");
                }
            }
            else
            {
                MensajeError("Digite un numero de identificación.");
            }
        }
예제 #15
0
        private void btnRegCiudad_Click(object sender, EventArgs e)
        {
            if (txtRegCiudad.Text != "NOMBRE DE LA CIUDAD")
            {
                if (UsuarioDAL_C.RegistrarCiudad(txtRegCiudad.Text) > 0)
                {
                    MensajeError("Ciudad registrada correctamente.");
                    txtRegCiudad.Clear();
                }
                else
                {
                    MensajeError("La ciudad no pudo ser registrada.");
                }
            }
            else
            {
                MensajeError("Ingrese un nombre para la ciudad.");
            }

            MostrarCiudades();
        }
예제 #16
0
        //public void ReportGen()
        //{
        //    UsuarioDAL_C Reportes = new UsuarioDAL_C();
        //    DtGrdVwGenRepPerAdm.DataSource = Reportes.ReportedatosGen();
        //}



        private void CmbBxTipRepGenRepPerAdm_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (CmbBxTipRepGenRepPerAdm.Text == "Consulta Asignacion de Usuarios - Sucursales")
            {
                UsuarioDAL_C Reportes = new UsuarioDAL_C();
                DtGrdVwGenRepPerAdm.DataSource = Reportes.ReporteCosultaUsuarioxSuc();
            }
            else if (CmbBxTipRepGenRepPerAdm.Text == "Consulta Usuarios del Sistema")
            {
                UsuarioDAL_C Reportes = new UsuarioDAL_C();
                DtGrdVwGenRepPerAdm.DataSource = Reportes.ReporteCosultarUsuarios();
            }
            else if (CmbBxTipRepGenRepPerAdm.Text == "Consulta de Envios por sucursales")
            {
                UsuarioDAL_C Reportes = new UsuarioDAL_C();
                DtGrdVwGenRepPerAdm.DataSource = Reportes.ReporteCosultaEnvxSuc();
            }
            else if (CmbBxTipRepGenRepPerAdm.Text == "Consulta de Envios Cancelados")
            {
                UsuarioDAL_C Reportes = new UsuarioDAL_C();
                DtGrdVwGenRepPerAdm.DataSource = Reportes.ReporteEnviosCancelados();
            }
        }
        private void dgvSolAnul()
        {
            UsuarioDAL_C envios = new UsuarioDAL_C();

            dgvSolicAnulacion.DataSource = envios.getTabEnviosEstadoSolAnulDGV();
        }
예제 #18
0
        public void ListarCiudadesDesac()
        {
            UsuarioDAL_C Suc = new UsuarioDAL_C();

            DtGrdVwHabCiu.DataSource = Suc.ListarCiudadesDesac();
        }
예제 #19
0
        public void MostrarSucursales()
        {
            UsuarioDAL_C Suc = new UsuarioDAL_C();

            DtGrdVwTabSuc.DataSource = Suc.ListarSucursalesDGV();
        }
예제 #20
0
        public void MostrarCiudades()
        {
            UsuarioDAL_C Ciudad = new UsuarioDAL_C();

            DtGrdVTabCiudades.DataSource = Ciudad.MostrarCiudadesDGV();
        }
예제 #21
0
        public void ReportConsultEnvxSuc()
        {
            UsuarioDAL_C Reportes = new UsuarioDAL_C();

            DtGrdVwGenRepPerAdm.DataSource = Reportes.ReporteCosultaEnvxSuc();
        }
예제 #22
0
        private void BtnIniciarSesClient_Click(object sender, EventArgs e)
        {
            if (TxtNumID.Text != "*N° IDENTIFICACIÓN")
            {
                if (TxtContrasena.Text != "*CONTRASEÑA")
                {
                    DatosClient enviar = new DatosClient();
                    enviar.NumIdUsu   = TxtNumID.Text;
                    enviar.Contrasena = TxtContrasena.Text;
                    enviar.IdTipoPer  = Convert.ToString(cmbTipoPer.SelectedValue);

                    Cache.IdTipoPer = Convert.ToString(cmbTipoPer.SelectedValue);

                    int res = UsuarioDAL_C.AccesoUsuarios(enviar);

                    if (res > 0)
                    {
                        if (enviar.IdTipoPer == "1")//Perfil Administrador
                        {
                            PerfilAdminSuc perfilAdminSuc = new PerfilAdminSuc();
                            perfilAdminSuc.Show();
                            this.Hide();
                        }
                        else if (enviar.IdTipoPer == "2")//Perfil Jefe de sucursal
                        {
                            PerfilJefSuc perfilJefSuc = new PerfilJefSuc();
                            perfilJefSuc.Show();
                            this.Hide();
                        }
                        else if (enviar.IdTipoPer == "3")//Perfil Gestor de sucursal
                        {
                            PerfilGesSuc perfilGesSuc = new PerfilGesSuc();
                            perfilGesSuc.Show();
                            this.Hide();
                        }
                        else if (enviar.IdTipoPer == "4")//Perfil Repartidor
                        {
                            PerfilRepSuc perfilRepartidor = new PerfilRepSuc();
                            perfilRepartidor.Show();
                            this.Hide();
                        }
                        else //Perfil Cliente
                        {
                            PerfilClientForm perfilCliente = new PerfilClientForm();
                            perfilCliente.Show();
                            this.Hide();
                        }
                    }
                    else
                    {
                        MensajeError("Usuario o Contraseña incorrectos.");
                    }
                }
                else
                {
                    MensajeError("Ingrese una contraseña.");
                }
            }
            else
            {
                MensajeError("Ingrese N° Identificación");
            }
        }