Пример #1
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (TXTCODIGOEXTRA.Text != "")
     {
         try
         {
             DateTime fecha        = DateTime.Now;
             string   STRING_FECHA = fecha.ToString("MM/dd/yyyy HH:mm:ss");
             int      CONTADOR     = Convert.ToInt32(TXTCONTADOR_ENTRADA.Text);
             UTILITY  UTL          = new UTILITY();
             UTL.update_de_servicio(COMBOCONDICION.Text, TXTNOMBREEQUIPOENTRADA.Text, TXTMODELOENTRADA.Text, TXTSERIEEQUIPO.Text, CONTADOR, "", TXTTECNICO.Text, COMBOCLIENTE.Text, TXTGERENTESERVICIO.Text, TXTSERVICIOCLIENTE.Text, TXTCOMENTARIO.Text, label23.Text, STRING_FECHA, TXTCODIGOEXTRA.Text);
             table.Clear();
             TRAERDATOS     datos = new TRAERDATOS();
             SqlDataAdapter data  = datos.llenargrid();
             data.Fill(table);
             this.DataGrid.DataSource = table;
         }
         catch (Exception ex)
         {
             MessageBox.Show("Error" + ex, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         finally {
             MessageBox.Show("Se completo la actualizacion", "INFORMACION", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     else
     {
         MessageBox.Show("Debe seleccionar una extraccion", "INFORMACION", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Пример #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            DataTable  datacombo = new DataTable();
            TRAERDATOS datos     = new TRAERDATOS();
            // TODO: This line of code loads data into the 'ALMACENDataSet.EXTRACION_EQUIPO' table. You can move, or remove it, as needed.
            ///llenar combo begin

            SqlDataAdapter llenar_combo = datos.llenarcombobodega();

            llenar_combo.Fill(datacombo);
            COMBOBODEGA_1.DataSource    = datacombo;
            COMBOBODEGA_1.DisplayMember = "BODEGA";
            //llenar como finished
            TXTNUMKIT_1.Text   = "0";
            TXTCONTADOR_1.Text = "0";
            TXTCANTIDAD_1.Text = "0";

            SqlDataAdapter data = datos.llenargrid();

            data.Fill(table);
            this.DataGrid_1.DataSource = table;
            DataGridViewImageColumn img = new DataGridViewImageColumn();
            Image image = Extraciones.Properties.Resources.delete;

            img.Image = image;
            DataGrid_1.Columns.Add(img);
            img.HeaderText = "";
            img.Name       = "img";

            DataGrid_1.Columns[3].Width = 18;
        }
Пример #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                SqlDataAdapter DATA      = new SqlDataAdapter();
                DataTable      datatable = new DataTable();
                TRAERDATOS     datos     = new TRAERDATOS();
                if (CRITERIOCOMBO_1.Text == "FECHA")
                {
                    datatable.Clear();
                    DATA = datos.busquedafecha(desde_1.Value, hasta_1.Value);
                }
                else
                {
                    datatable.Clear();
                    DATA = datos.busqueda(TXTBUSQUEDA_1.Text, CRITERIOCOMBO_1.Text);
                }

                DATA.Fill(datatable);
                this.DBGRID_1.DataSource = datatable;
            }
            catch (Exception)
            {
                MessageBox.Show("VERIFIQUE QUE LA FECHA DE INICIO ES MENOR A LA DE FINAL", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
        private void button4_Click(object sender, EventArgs e)
        {
            table.Clear();
            TRAERDATOS     datos = new TRAERDATOS();
            SqlDataAdapter data  = datos.llenargrid();

            data.Fill(table);
            this.DataGrid.DataSource = table;
        }
        private void button5_Click(object sender, EventArgs e)
        {
            string value = Interaction.InputBox("Inserte el codigo de la extracion que desea buscar ", "SEARCH", string.Empty, -1, -1);

            table.Clear();
            TRAERDATOS     datos = new TRAERDATOS();
            SqlDataAdapter data  = datos.busqueda(value, "CODIGO_EXTRACION");

            data.Fill(table);
            this.DataGrid.DataSource = table;
        }
        private void FORMULARIO_ALMACEN_Load(object sender, EventArgs e)
        {
            try
            {
                ConnectionInfo myConnectionInfo = new ConnectionInfo();
                myConnectionInfo.ServerName         = "SVR-SQL";
                myConnectionInfo.DatabaseName       = "ALMACEN";
                myConnectionInfo.UserID             = "SA";
                myConnectionInfo.Password           = "******";
                myConnectionInfo.Type               = ConnectionInfoType.Query;
                myConnectionInfo.IntegratedSecurity = false;
                TableLogOnInfos mytableloginfos = new TableLogOnInfos();
                mytableloginfos = crystalReportViewer1.LogOnInfo;
                foreach (TableLogOnInfo myTableLogOnInfo in mytableloginfos)
                {
                    myTableLogOnInfo.ConnectionInfo = myConnectionInfo;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("ERROR:" + ex, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            DataTable  datacombo = new DataTable();
            TRAERDATOS datos     = new TRAERDATOS();
            // TODO: This line of code loads data into the 'ALMACENDataSet.EXTRACION_EQUIPO' table. You can move, or remove it, as needed.
            ///llenar combo begin

            SqlDataAdapter llenar_combo = datos.llenarcombobodega();

            llenar_combo.Fill(datacombo);
            COMBOBODEGA.DataSource    = datacombo;
            COMBOBODEGA.DisplayMember = "BODEGA";
            //llenar como finished
            //  TXTNUMKIT.Text = "0";
            TXTCONTADOR.Text = "0";
            TXTCANTIDAD.Text = "0";

            SqlDataAdapter data = datos.llenargrid();

            data.Fill(table);
            this.DataGrid.DataSource = table;
            //DataGridViewImageColumn img = new DataGridViewImageColumn();
            //Image image = Extraciones.Properties.Resources.delete;
            //img.Image = image;
            //DataGrid.Columns.Add(img);
            //img.HeaderText = "";
            //img.Name = "img";

            //DataGrid.Columns[3].Width = 18;
        }
Пример #7
0
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                SqlDataAdapter DATA          = new SqlDataAdapter();
                DataTable      datatable     = new DataTable();
                TRAERDATOS     datos         = new TRAERDATOS();
                string         textobusqueda = TXTBUSQUEDA.Text;
                DateTime       DESDE         = desde.Value;
                DateTime       HASTA         = hasta.Value;
                string         STRINGDESDE   = DESDE.ToString("MM/dd/yyyy 00:00:23");
                string         STRINGHASTA   = HASTA.ToString("MM/dd/yyyy 23:00:23");
                int            LONGITUD      = textobusqueda.Length - 4;
                //1/19/2015 15:34:42
                if (CRITERIOCOMBO.Text == "FECHA")
                {
                    datatable.Clear();
                    DATA = datos.busquedafecha(STRINGDESDE, STRINGHASTA);
                }

                else if (CRITERIOCOMBO.Text == "CODIGO_EXTRACION")
                {
                    string busqueda = textobusqueda.Substring(4, LONGITUD);
                    datatable.Clear();
                    DATA = datos.busqueda(busqueda, CRITERIOCOMBO.Text);
                }
                else
                {
                    datatable.Clear();
                    DATA = datos.busqueda(TXTBUSQUEDA.Text, CRITERIOCOMBO.Text);
                }

                DATA.Fill(datatable);
                this.DBGRID.DataSource = datatable;
            }
            catch (Exception)
            {
                MessageBox.Show("VERIFIQUE QUE LA FECHA DE INICIO ES MENOR A LA DE FINAL", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
        private void button1_Click_1(object sender, EventArgs e)
        {
            if (TXTCODIGO.Text != "")
            {
                DialogResult resultado = MessageBox.Show("DESEA INGRESAR ESTE EQUIPO DE ENTRADA", "ACTUALIZACION", MessageBoxButtons.YesNo, MessageBoxIcon.Information);

                if (resultado == System.Windows.Forms.DialogResult.Yes)
                {
                    if (TXTCODIGO.Text == "")
                    {
                        MessageBox.Show("Debe seleccionar una extracion", "INFORMACION", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        try
                        {
                            int     cantidadvar = Convert.ToInt32(TXTCANTIDAD.Text);
                            UTILITY UPDATE      = new UTILITY();
                            int     contador    = Convert.ToInt32(TXTCONTADOR.Text);
                            int     codgo       = Convert.ToInt32(TXTCODIGO.Text);
                            UPDATE.update(TXTNUMEQUIPO.Text, TXTMODELOEQUIPO.Text, TXTSERIEEQUIPO.Text, contador, "", TXTCODIGO.Text);
                            table.Clear();
                            TRAERDATOS     datos = new TRAERDATOS();
                            SqlDataAdapter data  = datos.llenargrid();
                            data.Fill(table);
                            this.DataGrid.DataSource = table;
                        }
                        catch (Exception EX)
                        {
                            MessageBox.Show("ERROR" + EX, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                }
                else
                {
                    MessageBox.Show("Debe seleccionar una extracion de la tabla");
                }
            }
        }
Пример #9
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (TXTNUMEQUIPO_1.Text == "" || TXTMODELOEQUIPO_1.Text == "" || TXTTECNICO_1.Text == "" || TXT_CODIGO_PIEZA_1.Text == "" || TXTNOMBREEQUIPOENTRADA_1.Text == "" || TXTMODELOENTRADA_1.Text == "")
            {
                MessageBox.Show("DEBE INGRESAR LOS CAMPOS OBLIGATORIOS", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                DialogResult resultado = MessageBox.Show("Desea guardar esta informacion", "SAVE", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                if (resultado == System.Windows.Forms.DialogResult.Yes)
                {
                    UTILITY  utilidad    = new UTILITY();
                    DateTime fecha       = (DateTime)DATATIMEPICO_1.Value;
                    int      txtnumerkit = Convert.ToInt32(TXTNUMKIT_1.Text);
                    int      contador    = Convert.ToInt32(TXTCONTADOR_1.Text);
                    int      cantidad    = Convert.ToInt32(TXTCANTIDAD_1.Text);

                    utilidad.insertar(TXTNUMEQUIPO_1.Text, TXTMODELOEQUIPO_1.Text, TXTSERIEEQUIPO_1.Text, contador, txtnumerkit, COMBOCONDICION_1.Text, TXTNOMBREEQUIPOENTRADA_1.Text, TXTMODELOENTRADA_1.Text, TXTSERIE3_1.Text, TXTTECNICO_1.Text, fecha, TXT_CODIGO_PIEZA_1.Text, TXTDESCRIPCION_1.Text, cantidad);
                }

                table.Clear();
                TRAERDATOS     datos = new TRAERDATOS();
                SqlDataAdapter data  = datos.llenargrid();
                data.Fill(table);
                this.DataGrid_1.DataSource = table;

                //DataGrid.ColumnCount = 3;
                //DataGrid.Columns[0].Name = "Articulo";
                //DataGrid.Columns[1].Name = "Descripcion";
                //DataGrid.Columns[2].Name = "Cantidad";


                //string[] row = new string[] { ArticuloText.Text, DescripcionText.Text, CantidadText.Text };
                //DataGrid.Rows.Add(row);
            }
        }
Пример #10
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (TXTCOMENTARIO.Enabled == false)
            {
                DialogResult YESNOOT = MessageBox.Show("Desea seguir agregando extracciones", "INFORMATION", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (YESNOOT == System.Windows.Forms.DialogResult.Yes)
                {
                    TXTMODELOENTRADA.Enabled       = true;
                    TXTNOMBREEQUIPOENTRADA.Enabled = true;
                    TXTSERIENTRADA.Enabled         = true;
                    TXTCONTADOR_ENTRADA.Enabled    = true;
                    //TXTNOKITENTRADA.Enabled = true;
                    // TXTMODELOEQUIPO.Enabled = true;
                    TXTCOMENTARIO.Enabled      = true;
                    COMBOCONDICION.Enabled     = true;
                    TXTTECNICO.Enabled         = true;
                    COMBOCLIENTE.Enabled       = true;
                    DATATIMEPICO.Enabled       = true;
                    TXTGERENTESERVICIO.Enabled = true;
                    TXTSERVICIO.Enabled        = true;
                    TXT_CODIGO_PIEZA.Enabled   = false;
                    TXTCANTIDAD.Enabled        = false;
                    TXTDESCRIPCION.Enabled     = false;
                    COMBOBODEGA.Enabled        = false;
                    TXTMODELOEQUIPO.Enabled    = false;

                    /*   TXTNUMEROKITE.Enabled = false;
                     * TXTNUMEROKITE.Enabled = true;
                     * TXTNUMEROKITS.Enabled = true;*/
                }
                MessageBox.Show("PUEDE SEGUIR AGREGANDO ESTRACCONES", "INFORMATION", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                if (TXTTECNICO.Text == "" || TXTNOMBREEQUIPOENTRADA.Text == "" || TXTMODELOENTRADA.Text == "" || TXTNOMBREEQUIPOENTRADA.Text == "" || TXTMODELOENTRADA.Text == "")
                {
                    MessageBox.Show("DEBE INGRESAR LOS CAMPOS OBLIGATORIOS", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    DialogResult resultado = MessageBox.Show("Desea guardar esta informacion", "SAVE", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                    if (resultado == System.Windows.Forms.DialogResult.Yes)
                    {
                        UTILITY  utilidad     = new UTILITY();
                        DateTime fecha        = (DateTime)DATATIMEPICO.Value;
                        string   STRING_FECHA = fecha.ToString("MM/dd/yyyy HH:mm:ss");
                        //  int txtnumerkit = Convert.ToInt32(TXTNUMKIT.Text);
                        int    contador         = Convert.ToInt32(TXTCONTADOR_ENTRADA.Text);
                        int    cantidad         = Convert.ToInt32(TXTCANTIDAD.Text);
                        int    contador_entrada = Convert.ToInt32(TXTCONTADOR_ENTRADA.Text);
                        string USUARIOLABEL     = label23.Text;
                        //CONDICION_EXTRACION, NO_EQUIPO_S, MODELO_EQUIPO_S, SERIE_EQUIPO_S, CONTADOR_S,NUM_KIT_EQUIPO_S, NO_EQUIPO_E, MODELO_EQUIPO_E, SERIE_EQUIPO_E, CONTADOR_E, NUM_KIT_EQUIPO_E, TECNICO, CLIENTE, GERENTE_DE_SERVICIO, SERVICIO_AL_CLIENTE, COMENTARIO, USUARIO_CREA, FECHA_CREA, USUARIO_ACTUALIZA, FECHA_ACTUALIZA);
                        utilidad.insertar("", "", "", 0, "", COMBOCONDICION.Text, TXTNOMBREEQUIPOENTRADA.Text, TXTMODELOENTRADA.Text, TXTSERIENTRADA.Text, contador, "", TXTTECNICO.Text, COMBOCLIENTE.Text, TXTGERENTESERVICIO.Text, TXTSERVICIO.Text, TXTCOMENTARIO.Text, USUARIOLABEL, STRING_FECHA, USUARIOLABEL, STRING_FECHA);
                    }

                    table.Clear();
                    TRAERDATOS     datos = new TRAERDATOS();
                    SqlDataAdapter data  = datos.llenargrid();
                    data.Fill(table);
                    this.DataGrid.DataSource = table;

                    //DataGrid.ColumnCount = 3;
                    //DataGrid.Columns[0].Name = "Articulo";
                    //DataGrid.Columns[1].Name = "Descripcion";
                    //DataGrid.Columns[2].Name = "Cantidad";


                    //string[] row = new string[] { ArticuloText.Text, DescripcionText.Text, CantidadText.Text };
                    //DataGrid.Rows.Add(row);
                }
            }
        }