Exemplo n.º 1
0
        public void TestMethod1()
        {
            SQLLayer sqlLayer = new SQLLayer("Data Source=(localdb)\\MSSQLLocalDB;Database=test;Integrated Security=SSPI");
            SQLServerTableConfigure configure = new SQLServerTableConfigure(sqlLayer, new SQLServerTableRepository(null));

            configure.AddTable(new Interfaces.TableConfigure.TableMetaData()
            {
                TableLabel = "testing", TableName = "test"
            });
        }
Exemplo n.º 2
0
        private bool BusquedaQueja()
        {
            int    Cliente     = 0;
            string NumeroQueja = string.Empty;
            string Nombre      = string.Empty;
            string Telefono    = string.Empty;

            switch (this.tipoBusqueda)
            {
            case 1:
                dtQueja = SQLLayer.BusquedaQueja(txtBuscar.Text.Trim(), Cliente, Nombre, Telefono, string.Empty, string.Empty);
                break;

            case 2:
                Cliente = Convert.ToInt32(txtBuscar.Text);
                dtQueja = SQLLayer.BusquedaQueja(NumeroQueja, Cliente, Nombre, Telefono, string.Empty, string.Empty);
                break;

            case 3:
                Nombre  = txtBuscar.Text.Trim();
                Nombre  = "%" + Nombre.Replace(" ", "%") + "%";
                dtQueja = SQLLayer.BusquedaQueja(NumeroQueja, Cliente, Nombre, Telefono, string.Empty, string.Empty);
                break;

            case 4:
                Telefono = txtBuscar.Text.Trim();
                Telefono = "%" + Telefono.Replace(" ", "%") + "%";
                dtQueja  = SQLLayer.BusquedaQueja(NumeroQueja, Cliente, Nombre, Telefono, string.Empty, string.Empty);
                break;
            }

            if (dtQueja != null)
            {
                if (dtQueja.Rows.Count > 0)
                {
                    return(true);
                }
                else
                {
                    dtQueja = null;
                    MessageBox.Show("No existen ninguna queja con el dato de búsqueda.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    ActiveControl = txtBuscar;
                    return(false);
                }
            }
            else
            {
                dtQueja = null;
                MessageBox.Show("No existen ninguna queja con el dato de búsqueda.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                ActiveControl = txtBuscar;
                return(false);
            }
        }
        private void cbxArea_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            cbxClasificacion.Tag = 1;
            if (cbxArea.SelectedIndex > -1 && Convert.ToInt32(cbxArea.Tag) == 0)
            {
                cbxClasificacion.DataSource    = SQLLayer.ConsultaClasificacionQuejaArea(Convert.ToInt16(cbxArea.SelectedValue));
                cbxClasificacion.ValueMember   = "ClasificacionQueja";
                cbxClasificacion.DisplayMember = "ClasificacionQuejaDescripcion";

                if (cbxClasificacion.Items.Count > 0)
                {
                    cbxClasificacion.Enabled       = true;
                    lblClasificacion.Enabled       = true;
                    cbxClasificacion.SelectedIndex = -1;
                    cbxClasificacion.SelectedIndex = -1;
                }
                else
                {
                    cbxClasificacion.DataSource = null;
                    cbxClasificacion.Enabled    = false;
                    lblClasificacion.Enabled    = false;

                    if (cbxMotivo.DataSource != null)
                    {
                        cbxMotivo.DataSource    = null;
                        cbxMotivo.Enabled       = false;
                        lblMotivo.Enabled       = false;
                        cbxMotivo.SelectedIndex = -1;
                        cbxMotivo.SelectedIndex = -1;
                    }
                }
            }
            else
            {
                if (cbxClasificacion.DataSource != null)
                {
                    cbxClasificacion.DataSource = null;
                    cbxClasificacion.Enabled    = false;
                    lblClasificacion.Enabled    = false;
                }
                if (cbxMotivo.DataSource != null)
                {
                    cbxMotivo.DataSource = null;
                    cbxMotivo.Items.Clear();
                    cbxMotivo.Enabled       = false;
                    lblMotivo.Enabled       = false;
                    cbxMotivo.SelectedIndex = -1;
                    cbxMotivo.SelectedIndex = -1;
                }
            }
            cbxClasificacion.Tag = 0;
        }
Exemplo n.º 4
0
 private void ConsultaQueja()
 {
     this.dtQuejaPortal = SQLLayer.ConsultaQuejaPortal();
     if (dtQuejaPortal != null && dtQuejaPortal.Rows.Count > 0)
     {
         grdQuejaPortal.DataSource = this.dtQuejaPortal;
     }
     else
     {
         this.dtQuejaPortal        = null;
         grdQuejaPortal.DataSource = this.dtQuejaPortal;
     }
 }
Exemplo n.º 5
0
        public frmAltaImprocedente(int Queja)
        {
            InitializeComponent();
            this.Queja = Queja;

            cmbClases.DataSource    = SQLLayer.ObtieneClasesQueja();
            cmbClases.DisplayMember = "Descripcion";
            cmbClases.ValueMember   = "ClaseQueja";

            if (cmbClases.Items.Count > 0)
            {
                cmbClases.SelectedIndex = 0;
            }
        }
        private void frmAsignarQuejaClienteNoExiste_Load(object sender, System.EventArgs e)
        {
            lblClasificacion.Enabled     = false;
            lblMotivo.Enabled            = false;
            lblDescripcionMotivo.Enabled = false;
            cbxClasificacion.Enabled     = false;
            cbxMotivo.Enabled            = false;
            txtMotivo.Enabled            = false;


            cbxStatus.SelectedIndex = this.status;
            cbxStatus.Enabled       = false;

            cbxArea.Tag           = 1;
            cbxArea.DataSource    = SQLLayer.CargaCombo("Area");
            cbxArea.ValueMember   = "Area";
            cbxArea.DisplayMember = "Descripcion";

            cbxGravedad.DataSource    = SQLLayer.CargaCombo("GravedadQueja");
            cbxGravedad.ValueMember   = "GravedadQueja";
            cbxGravedad.DisplayMember = "Descripcion";

            cbxArea.SelectedIndex = -1;
            cbxArea.SelectedIndex = -1;

            if (this.gravedadqueja > 0)
            {
                cbxGravedad.SelectedValue = this.gravedadqueja;
                cbxGravedad.Enabled       = false;
            }
            else
            {
                cbxGravedad.SelectedIndex = -1;
                cbxGravedad.SelectedIndex = -1;
            }

            cbxArea.Tag = 0;
        }