コード例 #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 BTNAGREGARPIEZA_Click(object sender, EventArgs e)
        {
            if (TXTCOMENTARIO.Enabled == true)
            {
                DialogResult yesno = MessageBox.Show("Desea agregar una pieza?", "INFORMACION", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (yesno == System.Windows.Forms.DialogResult.Yes)
                {
                    TXTMODELOENTRADA.Enabled = false;
                    TXTNUMEQUIPO.Enabled     = false;
                    TXTMODELOEQUIPO.Enabled  = false;
                    TXTCONTADOR.Enabled      = false;
                    //  TXTNUMKIT.Enabled = false;
                    COMBOCONDICION.Enabled         = false;
                    TXTNOMBREEQUIPOENTRADA.Enabled = false;
                    TXTSERIENTRADA.Enabled         = false;
                    TXTCONTADOR_ENTRADA.Enabled    = false;
                    //  TXTNOKITENTRADA.Enabled = false;
                    TXTMODELOEQUIPO.Enabled = false;
                    TXTCOMENTARIO.Enabled   = false;

                    TXTTECNICO.Enabled         = false;
                    COMBOCLIENTE.Enabled       = false;
                    DATATIMEPICO.Enabled       = false;
                    TXTGERENTESERVICIO.Enabled = false;
                    TXTSERVICIO.Enabled        = false;
                    TXT_CODIGO_PIEZA.Enabled   = true;
                    TXTCANTIDAD.Enabled        = true;
                    TXTDESCRIPCION.Enabled     = true;
                    COMBOBODEGA.Enabled        = true;
                    // TXTNUMEROKITE.Enabled = true;
                    //TXTNUMEROKITS.Enabled = true;
                }
            }
            else
            {
                if (TXTCODIGOEXTRA.Text == "")
                {
                    MessageBox.Show("Debe seleccionar una extracion para proseguir agregando piezas", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    int cantidad = Convert.ToInt32(TXTCANTIDAD.Text);

                    UTILITY UTILIDAD = new UTILITY();
                    UTILIDAD.insertar_detalle(TXTCODIGOEXTRA.Text, TXT_CODIGO_PIEZA.Text, TXTDESCRIPCION.Text, cantidad, COMBOBODEGA.Text, "", "");
                    TXT_CODIGO_PIEZA.Text = "";
                    TXTCANTIDAD.Text      = "0";
                    TXTDESCRIPCION.Text   = "";
                    COMBOBODEGA.Text      = "";
                }
            }
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: pablo17sanchez/Extracciones2
        private void DataGrid_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.ColumnIndex == 14)// created column index (delete button)
                {
                    int valor = (int)DataGrid_1.CurrentRow.Cells["CODIGO EXTRACION"].Value;

                    UTILITY util = new UTILITY();
                    util.borrar(valor);
                    DataGrid_1.Rows.Remove(DataGrid_1.Rows[e.RowIndex]);
                }
            }
            catch (Exception)
            {
                MessageBox.Show("NO DEBE DARLE CLICK AL TITULO DE LA TABLA", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #4
0
 private void ADDKIT_Click(object sender, EventArgs e)
 {
     if (TXTCODIGO.Text != "")
     {
         if (TXTNUMEROKITS.Text == "")
         {
             MessageBox.Show("Debe colocar los numeros de kit", "INFORMACION", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             UTILITY UTIL   = new UTILITY();
             int     codigo = Convert.ToInt32(TXTCODIGO.Text);
             UTIL.ADDNUMER("", TXTNUMEROKITS.Text, codigo);
         }
     }
     else
     {
         MessageBox.Show("Selecciona una extracion ", "INFORMACION", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #5
0
        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");
                }
            }
        }
コード例 #6
0
ファイル: Form1.cs プロジェクト: pablo17sanchez/Extracciones2
        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);
            }
        }
コード例 #7
0
        private void DataGrid_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                string CODIGO;

                if (e.ColumnIndex == 21)// created column index (delete button)
                {
                    string sub_valor = (string)DataGrid.CurrentRow.Cells["CODIGO EXTRACION"].Value;
                    int    longitud  = sub_valor.Length - 4;

                    string valor = sub_valor.Substring(4, longitud);
                    if (EXTRALABEL.Text == "ADMIN")
                    {
                        UTILITY util = new UTILITY();
                        util.borrar(valor);
                    }

                    DataGrid.Rows.Remove(DataGrid.Rows[e.RowIndex]);
                }
                COMBOCONDICION.Text = (string)DataGrid.CurrentRow.Cells["CONDICION_EXTRACION"].Value;
                //    COMBOCONDICION.Text = (string)DataGrid.CurrentRow.Cells["CONDICION_EXTRACION"].Value;
                TXTNUMEQUIPO.Text    = (string)DataGrid.CurrentRow.Cells["NO.EQUIPO_S"].Value;
                TXTMODELOEQUIPO.Text = (string)DataGrid.CurrentRow.Cells["MODELO_EQUIPO_S"].Value;
                TXTSERIEEQUIPO.Text  = (string)DataGrid.CurrentRow.Cells["SERIE_EQUIPO_S"].Value;
                TXTCONTADOR.Text     = Convert.ToString(DataGrid.CurrentRow.Cells["CONTADOR_S"].Value);

                // int quantity = (int)DataGrid.CurrentRow.Cells["CANTIDAD"].Value;
                //   TXTCODIGO.Text = (string)DataGrid.CurrentRow.Cells["CODIGO EXTRACION"].Value;
                TXTMODELOEQUIPO.Text = (string)DataGrid.CurrentRow.Cells["MODELO_EQUIPO_S"].Value;
                TXTSERIEEQUIPO.Text  = (string)DataGrid.CurrentRow.Cells["SERIE_EQUIPO_S"].Value;
                //TXTCONTADOR.Text = Convert.ToString(DataGrid.CurrentRow.Cells["CONTADOR_S"].Value);
                TXTNUMEQUIPO.Text = (string)DataGrid.CurrentRow.Cells["NO.EQUIPO_S"].Value;

                TXTNOMBREEQUIPOENTRADA.Text = (string)DataGrid.CurrentRow.Cells["NO.EQUIPO_E"].Value;
                TXTCOMENTARIO.Text          = (string)DataGrid.CurrentRow.Cells["COMENTARIO"].Value;

                TXTMODELOENTRADA.Text    = (string)DataGrid.CurrentRow.Cells["MODELO_EQUIPO_E"].Value;
                TXTSERIENTRADA.Text      = (string)DataGrid.CurrentRow.Cells["SERIE_EQUIPO_E"].Value;
                TXTCONTADOR_ENTRADA.Text = Convert.ToString(DataGrid.CurrentRow.Cells["CONTADOR_E"].Value);
                // TXTNOKITENTRADA.Text = (string)DataGrid.CurrentRow.Cells["NUM. KIT_EQUIPO_E"].Value;
                TXTTECNICO.Text    = (string)DataGrid.CurrentRow.Cells["TECNICO"].Value;
                DATATIMEPICO.Value = (DateTime)DataGrid.CurrentRow.Cells["FECHA_CREA"].Value;
                //       TXT_CODIGO_PIEZA.Text = (string)DataGrid.CurrentRow.Cells["CODIGO_DEPIEZA"].Value;
                //  TXTCANTIDAD.Text = Convert.ToString(DataGrid.CurrentRow.Cells["CANTIDAD"].Value);
                // TXTDESCRIPCION.Text = (string)DataGrid.CurrentRow.Cells["DESCRIPCION_PIEZA"].Value;
                //  COMBOBODEGA.Text = Convert.ToString(DataGrid.CurrentRow.Cells["BODEGA"].Value);
                TXTCOMENTARIO.Text      = (string)DataGrid.CurrentRow.Cells["COMENTARIO"].Value;
                TXTGERENTESERVICIO.Text = (string)DataGrid.CurrentRow.Cells["GERENTE_DE_SERVICIO"].Value;
                TXTSERVICIO.Text        = (string)DataGrid.CurrentRow.Cells["SERVICIO_AL_CLIENTE"].Value;
                CODIGO          = (string)DataGrid.CurrentRow.Cells["CODIGO EXTRACION"].Value;
                EXTRALABEL.Text = CODIGO;
                if (CODIGO != "")
                {
                    int    LONG      = CODIGO.Length - 4;
                    string sub_codig = CODIGO.Substring(4, LONG);
                    TXTCODIGOEXTRA.Text = sub_codig;
                }
                else
                {
                    MessageBox.Show("Error al seleccionar el codigo (Por favor contacte con el administrador del sistema)", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception)
            {
                MessageBox.Show("NO DEBE DARLE CLICK AL TITULO DE LA TABLA", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #8
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);
                }
            }
        }