예제 #1
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     if (txtBusqueda.Text != string.Empty && checkBox1.Checked == false)
     {
         if (checkBox2.Checked == false)
         {
             Bitacora.BuscarBitacoradeEventoss(txtBusqueda.Text, dtDatos);
         }
         else if (checkBox2.Checked == true)
         {
             Bitacora.BuscarBitacoradeEventossF(txtBusqueda.Text, dateTimePicker1.Value, dtDatos);
         }
     }
     else if (txtBusqueda.Text == string.Empty && checkBox1.Checked == true)
     {
         Bitacora.BitacoradeEventos(dtDatos);
     }
     else
     {
         {
             DialogsResults respuesta = Dialogs.Show("Desea consultar los usuarios con eventos existentes?", DialogsType.Question);
             if (respuesta == DialogsResults.Yes)
             {
                 Bitacora.BuscarBitacoradeEventossfiltro(dtDatos);
             }
         }
     }
 }
예제 #2
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            DialogsResults respuesta = Dialogs.Show("Esta seguro que desea eliminar el item? ", DialogsType.Question);

            if (respuesta == DialogsResults.Yes)
            {
                if (dtDatos.Rows.Count > 0)
                {
                    int  id        = int.Parse(dtDatos.CurrentRow.Cells[0].Value.ToString());
                    bool resultado = Segundas.DeleteSegundas(id);
                    if (resultado == true)
                    {
                        Dialogs.Show(Properties.Resources.Eliminar + " el Segundas", DialogsType.Info);
                        txtCliente.Text = string.Empty;
                        txtTela.Text    = string.Empty;
                        txtConf.Text    = string.Empty;
                        txtLav.Text     = string.Empty;
                        txtProc.Text    = string.Empty;
                        txtAvios.Text   = string.Empty;
                        txtFalt.Text    = string.Empty;
                        Segundas.Segundas(dtDatos);
                        string idcatalogo2;
                        idcatalogo2 = "Eliminación de un item de un documento de 2das y faltantes";
                        Bitacora.AddBitacoradeEventos(GLOBALS.USUARIO, GLOBALS.DEPARTAMENTO, DateTime.Now, idcatalogo2);
                    }
                }
            }
        }
예제 #3
0
파일: BOM.cs 프로젝트: ErickNavarrete/PLM
        private void pbEstadoThread_Click(object sender, EventArgs e)
        {
            DialogsResults result = Dialogs.Show("¿Desea cambiar el estado de los hilos?", DialogsType.Question);

            if (result == DialogsResults.Yes)
            {
                if (Bom.BuscarCurr(txtEstilo.Text) == false && flagEstado == 0)
                {
                    Bom.ActualizarEstadoHilos(txtNroBom.Text, txtEstilo.Text, "E", 1);
                    //pbEstadoThread.Image = Properties.Resources.estado2;
                    flagEstado = 1;
                    string codigohilos;
                    codigohilos = "E" + txtNroBom.Text + txtEstilo.Text;
                    Bom.TaskThread(codigohilos, txtNroBom.Text);
                }

                if (Bom.BuscarCurr(txtEstilo.Text) == true && flagEstado == 0)
                {
                    Bom.ActualizarEstadoHilos(txtNroBom.Text, txtEstilo.Text, "N", 1);
                    //pbEstadoThread.Image = Properties.Resources.estado2;
                    flagEstado = 1;
                    string codigohilos;
                    codigohilos = "N" + txtNroBom.Text + txtEstilo.Text;
                    Bom.TaskThread(codigohilos, txtNroBom.Text);
                }
            }
        }
예제 #4
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            DialogsResults respuesta = Dialogs.Show("Esta seguro que desea eliminar el item? ", DialogsType.Question);

            if (respuesta == DialogsResults.Yes)
            {
                if (dtDatos.Rows.Count > 0)
                {
                    if (Departamento.EliminarDepartamento(dtDatos.CurrentRow.Cells[1].Value.ToString()) == false)
                    {
                        int  id        = int.Parse(dtDatos.CurrentRow.Cells[0].Value.ToString());
                        bool resultado = Departamento.DeleteDepartamento(id);
                        if (resultado == true)
                        {
                            Dialogs.Show(Properties.Resources.Eliminar + " el Departamento", DialogsType.Info);
                            txtDescripcion.Text    = string.Empty;
                            txtIdDepartamento.Text = string.Empty;
                            txtTresp.Text          = string.Empty;
                            Departamento.Departamento(dtDatos);
                            string idcatalogo2;
                            idcatalogo2 = "Eliminación de un Departamento";
                            Bitacora.AddBitacoradeEventos(GLOBALS.USUARIO, GLOBALS.DEPARTAMENTO, DateTime.Now, idcatalogo2);
                        }
                    }
                    else
                    {
                        Dialogs.Show("Existen trims asignados a este departamento", DialogsType.Error);
                    }
                }
            }
        }
예제 #5
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            DialogsResults respuesta = Dialogs.Show("Esta seguro que desea eliminar el item? ", DialogsType.Question);

            if (respuesta == DialogsResults.Yes)
            {
                if (dtDatos.Rows.Count > 0)
                {
                    int  id        = int.Parse(dtDatos.CurrentRow.Cells[0].Value.ToString());
                    bool resultado = Presupuestos.DeletePresupuestos(id);
                    if (resultado == true)
                    {
                        Dialogs.Show(Properties.Resources.Eliminar + " el Presupuestos", DialogsType.Info);
                        txtDiario.Text = string.Empty;
                        txtMO.Text     = string.Empty;
                        txtPrest.Text  = string.Empty;
                        txtProd.Text   = string.Empty;
                        txtVentas.Text = string.Empty;
                        txtVarios.Text = string.Empty;
                        txtAdmon.Text  = string.Empty;
                        Presupuestos.Presupuestos(dtDatos);
                        string idcatalogo2;
                        idcatalogo2 = "Eliminación de un Presupuesto";
                        Bitacora.AddBitacoradeEventos(GLOBALS.USUARIO, GLOBALS.DEPARTAMENTO, DateTime.Now, idcatalogo2);
                    }
                }
            }
        }
예제 #6
0
        private void btnAlta_Click(object sender, EventArgs e)
        {
            DialogsResults respuesta = Dialogs.Show("Desea crear un nuevo estilo? ", DialogsType.Question);

            if (respuesta == DialogsResults.Yes)
            {
                EstilosdeProduccionVista frm = new EstilosdeProduccionVista(string.Empty, 0);
                frm.ShowDialog();
                Estilos.EstilosdeProduccion(dtDatosPLM);
                Estilos.EstilosDynamicsBom(dtDatosDyn);
            }
        }
예제 #7
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            DialogsResults respuesta = Dialogs.Show("Esta seguro que desea eliminar el item? ", DialogsType.Question);

            if (respuesta == DialogsResults.Yes)
            {
                if (dtDatos.Rows.Count > 0)
                {
                    int  id        = int.Parse(dtDatos.CurrentRow.Cells[0].Value.ToString());
                    bool resultado = controlador.DeleteUsuario(id);
                    if (resultado == true)
                    {
                        Dialogs.Show(Properties.Resources.Eliminar + " el usuario", DialogsType.Info);
                        controlador.Usuarios(dtDatos);
                        string idcatalogo2;
                        idcatalogo2 = "Eliminación de un Usuario";
                        Bitacora.AddBitacoradeEventos(GLOBALS.USUARIO, GLOBALS.DEPARTAMENTO, DateTime.Now, idcatalogo2);
                    }
                }
            }
        }
예제 #8
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            DialogsResults respuesta = Dialogs.Show("Esta seguro que desea eliminar el item? ", DialogsType.Question);

            if (respuesta == DialogsResults.Yes)
            {
                if (dtDatos.Rows.Count > 0)
                {
                    if (Trim.EliminarTrim(dtDatos.CurrentRow.Cells[1].Value.ToString()) == false)
                    {
                        int  id        = int.Parse(dtDatos.CurrentRow.Cells[0].Value.ToString());
                        bool resultado = Trim.DeleteTrim(id);
                        if (resultado == true)
                        {
                            Dialogs.Show(Properties.Resources.Eliminar + " el Trim", DialogsType.Info);
                            txtDescripcion.Text = string.Empty;
                            txtIdTrim.Text      = string.Empty;
                            if (cmbDepartamentos.Items.Count > 0)
                            {
                                cmbDepartamentos.SelectedIndex = 0;
                            }
                            if (cmbSegmentos.Items.Count > 0)
                            {
                                cmbSegmentos.SelectedIndex = 0;
                            }
                            txtSecuencia.Text = string.Empty;
                            Trim.Trim(dtDatos);
                            string idcatalogo2;
                            idcatalogo2 = "Eliminación de un Trim";
                            Bitacora.AddBitacoradeEventos(GLOBALS.USUARIO, GLOBALS.DEPARTAMENTO, DateTime.Now, idcatalogo2);
                        }
                    }
                    else
                    {
                        Dialogs.Show("Existen boms abiertos con este trim involucrado", DialogsType.Error);
                    }
                }
            }
        }
예제 #9
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            DialogsResults respuesta = Dialogs.Show("Esta seguro que desea eliminar el item? ", DialogsType.Question);

            if (respuesta == DialogsResults.Yes)
            {
                if (dtDatos.Rows.Count > 0)
                {
                    int id;
                    id = int.Parse(dtDatos.CurrentRow.Cells[0].Value.ToString());
                    bool resultado = ManodeObra.DeleteManodeObra(id);
                    if (resultado == true)
                    {
                        Dialogs.Show(Properties.Resources.Agregar + "la Mano de Obra", DialogsType.Info);
                        txtDescripcion.Text  = string.Empty;
                        txtIdManoDeObra.Text = string.Empty;
                        ManodeObra.ManodeObra(dtDatos);
                        string idcatalogo2;
                        idcatalogo2 = "Eliminación de una Mano de Obra";
                        Bitacora.AddBitacoradeEventos(GLOBALS.USUARIO, GLOBALS.DEPARTAMENTO, DateTime.Now, idcatalogo2);
                    }
                }
            }
        }
예제 #10
0
 private void btnGuardar_Click(object sender, EventArgs e)
 {
     if (flag == 1)
     {
         DialogsResults respuesta = Dialogs.Show("Esta seguro que desea guardar el item? ", DialogsType.Question);
         if (respuesta == DialogsResults.Yes)
         {
             string idBody, descrip;
             if (txtIdBody.Text != string.Empty && txtDescripcion.Text != string.Empty && Body.Existe(txtIdBody.Text) == false)
             {
                 idBody  = txtIdBody.Text;
                 descrip = txtDescripcion.Text;
                 bool resultado = Body.AddBody(idBody, descrip);
                 if (resultado == true)
                 {
                     Dialogs.Show(Properties.Resources.Agregar + " el body", DialogsType.Info);
                     txtDescripcion.Text = string.Empty;
                     txtIdBody.Text      = string.Empty;
                     Body.Body(dtDatos);
                     string idcatalogo;
                     idcatalogo = "Alta de un Body";
                     Bitacora.AddBitacoradeEventos(GLOBALS.USUARIO, GLOBALS.DEPARTAMENTO, DateTime.Now, idcatalogo);
                     dtDatos.Enabled     = true;
                     btnAlta.Enabled     = true;
                     btnEliminar.Enabled = true;
                     flag = 0;
                 }
             }
         }
     }
     else if (flag == 0)
     {
         DialogsResults respuesta = Dialogs.Show("Esta seguro que desea guardar el item? ", DialogsType.Question);
         if (respuesta == DialogsResults.Yes)
         {
             string idBody, descrip;
             int    id;
             if (txtIdBody.Text != string.Empty && txtDescripcion.Text != string.Empty)
             {
                 id      = int.Parse(dtDatos.CurrentRow.Cells[0].Value.ToString());
                 idBody  = txtIdBody.Text;
                 descrip = txtDescripcion.Text;
                 bool resultado = Body.UpdateBody(idBody, descrip, id);
                 if (resultado == true)
                 {
                     Dialogs.Show(Properties.Resources.Editar + " el body", DialogsType.Info);
                     txtDescripcion.Text = string.Empty;
                     txtIdBody.Text      = string.Empty;
                     Body.Body(dtDatos);
                     string idcatalogo1;
                     idcatalogo1 = "Actualización de un Body";
                     Bitacora.AddBitacoradeEventos(GLOBALS.USUARIO, GLOBALS.DEPARTAMENTO, DateTime.Now, idcatalogo1);
                     dtDatos.Enabled     = true;
                     btnAlta.Enabled     = true;
                     btnEliminar.Enabled = true;
                 }
             }
             else
             {
                 Dialogs.Show("Ëxiste campo sin datos o datos erroneos, intente de nuevo", DialogsType.Error);
             }
         }
     }
 }
예제 #11
0
 private void btnGuardar_Click(object sender, EventArgs e)
 {
     if (flag == 1)
     {
         DialogsResults respuesta = Dialogs.Show("Esta seguro que desea guardar el item? ", DialogsType.Question);
         if (respuesta == DialogsResults.Yes)
         {
             string idTrim, descrip, Departamento, Segmento, Secuencia;
             if (txtIdTrim.Text != string.Empty && txtDescripcion.Text != string.Empty && txtSecuencia.Text != string.Empty && Trim.Existe(txtIdTrim.Text) == false && Trim.ExisteSecuencia(cmbSegmentos.SelectedValue.ToString(), int.Parse(txtSecuencia.Text)) == false)
             {
                 if (cmbSegmentos.Items.Count > 0)
                 {
                     if (cmbDepartamentos.Items.Count > 0)
                     {
                         idTrim       = txtIdTrim.Text;
                         descrip      = txtDescripcion.Text;
                         Departamento = cmbDepartamentos.SelectedValue.ToString();
                         Segmento     = cmbSegmentos.SelectedValue.ToString();
                         Secuencia    = txtSecuencia.Text;
                         bool resultado = Trim.AddTrim(idTrim, descrip, Departamento, Segmento, Secuencia);
                         if (resultado == true)
                         {
                             Dialogs.Show(Properties.Resources.Agregar + " el Trim", DialogsType.Info);
                             txtDescripcion.Text = string.Empty;
                             txtIdTrim.Text      = string.Empty;
                             if (cmbDepartamentos.Items.Count > 0)
                             {
                                 cmbDepartamentos.SelectedIndex = 0;
                             }
                             if (cmbSegmentos.Items.Count > 0)
                             {
                                 cmbSegmentos.SelectedIndex = 0;
                             }
                             txtSecuencia.Text = string.Empty;
                             Trim.Trim(dtDatos);
                             string idcatalogo;
                             idcatalogo = "Alta de un Trim";
                             Bitacora.AddBitacoradeEventos(GLOBALS.USUARIO, GLOBALS.DEPARTAMENTO, DateTime.Now, idcatalogo);
                             dtDatos.Enabled     = true;
                             btnAlta.Enabled     = true;
                             btnEliminar.Enabled = true;
                             flag = 0;
                         }
                     }
                     else
                     {
                         Dialogs.Show("Debe poseer almenos 1 departamento previamente creado", DialogsType.Info);
                     }
                 }
                 else
                 {
                     Dialogs.Show("Debe poseer almenos 1 segmento previamente creado", DialogsType.Info);
                 }
             }
             else
             {
                 Dialogs.Show("Ëxiste campo sin datos o datos erroneos, intente de nuevo", DialogsType.Error);
             }
         }
     }
     else if (flag == 0)
     {
         DialogsResults respuesta = Dialogs.Show("Esta seguro que desea guardar el item? ", DialogsType.Question);
         if (respuesta == DialogsResults.Yes)
         {
             string idTrim, descrip, Departamento, Segmento, Secuencia;
             int    id;
             if (txtIdTrim.Text != string.Empty && txtDescripcion.Text != string.Empty && txtSecuencia.Text != string.Empty)
             {
                 if (cmbSegmentos.Items.Count > 0)
                 {
                     if (cmbDepartamentos.Items.Count > 0)
                     {
                         id           = int.Parse(dtDatos.CurrentRow.Cells[0].Value.ToString());
                         idTrim       = txtIdTrim.Text;
                         descrip      = txtDescripcion.Text;
                         Departamento = cmbDepartamentos.SelectedValue.ToString();
                         Segmento     = cmbSegmentos.SelectedValue.ToString();
                         Secuencia    = txtSecuencia.Text;
                         bool resultado = Trim.UpdateTrim(idTrim, descrip, Departamento, Segmento, Secuencia, id);
                         if (resultado == true)
                         {
                             Dialogs.Show(Properties.Resources.Editar + " el Trim", DialogsType.Info);
                             txtDescripcion.Text = string.Empty;
                             txtIdTrim.Text      = string.Empty;
                             if (cmbDepartamentos.Items.Count > 0)
                             {
                                 cmbDepartamentos.SelectedIndex = 0;
                             }
                             if (cmbSegmentos.Items.Count > 0)
                             {
                                 cmbSegmentos.SelectedIndex = 0;
                             }
                             txtSecuencia.Text = string.Empty;
                             Trim.Trim(dtDatos);
                             string idcatalogo1;
                             idcatalogo1 = "Actualización de un Trim";
                             Bitacora.AddBitacoradeEventos(GLOBALS.USUARIO, GLOBALS.DEPARTAMENTO, DateTime.Now, idcatalogo1);
                             dtDatos.Enabled     = true;
                             btnAlta.Enabled     = true;
                             btnEliminar.Enabled = true;
                         }
                     }
                     else
                     {
                         Dialogs.Show("Debe poseer almenos 1 departamento previamente creado", DialogsType.Info);
                     }
                 }
                 else
                 {
                     Dialogs.Show("Debe poseer almenos 1 segmento previamente creado", DialogsType.Info);
                 }
             }
             else
             {
                 Dialogs.Show("Ëxiste campo sin datos o datos erroneos, intente de nuevo", DialogsType.Error);
             }
         }
     }
 }
예제 #12
0
 private void bunifuTileButton3_Click(object sender, EventArgs e)
 {
     if (flag == 1)
     {
         DialogsResults respuesta = Dialogs.Show("Esta seguro que desea guardar el item? ", DialogsType.Question);
         if (respuesta == DialogsResults.Yes)
         {
             string usuario, clave, correo, departamento;
             int    autorizar, liberar, reabrir, agregar, modificar, eliminar;
             if (txtUser.Text != string.Empty && txtPass.Text != string.Empty && txtCorreo.Text != string.Empty)
             {
                 if (cmbDepartamento.Items.Count > 0)
                 {
                     usuario      = txtUser.Text;
                     clave        = txtPass.Text;
                     correo       = txtCorreo.Text;
                     departamento = cmbDepartamento.SelectedValue.ToString();
                     if (chbAutorizado.Checked == true)
                     {
                         autorizar = 1;
                     }
                     else
                     {
                         autorizar = 0;
                     }
                     if (chbLiberar.Checked == true)
                     {
                         liberar = 1;
                     }
                     else
                     {
                         liberar = 0;
                     }
                     if (chbReabrir.Checked == true)
                     {
                         reabrir = 1;
                     }
                     else
                     {
                         reabrir = 0;
                     }
                     if (chbAgregar.Checked == true)
                     {
                         agregar = 1;
                     }
                     else
                     {
                         agregar = 0;
                     }
                     if (chbModificar.Checked == true)
                     {
                         modificar = 1;
                     }
                     else
                     {
                         modificar = 0;
                     }
                     if (chbEliminar.Checked == true)
                     {
                         eliminar = 1;
                     }
                     else
                     {
                         eliminar = 0;
                     }
                     bool resultado = controlador.AddUsuario(usuario, clave, departamento, correo, autorizar, liberar, reabrir, agregar, modificar, eliminar);
                     if (resultado == true)
                     {
                         Dialogs.Show(Properties.Resources.Agregar + " el usuario", DialogsType.Info);
                         controlador.Usuarios(dtDatos);
                         string idcatalogo;
                         idcatalogo = "Alta de un Usuario";
                         Bitacora.AddBitacoradeEventos(GLOBALS.USUARIO, GLOBALS.DEPARTAMENTO, DateTime.Now, idcatalogo);
                         dtDatos.Enabled     = true;
                         btnAlta.Enabled     = true;
                         btnEliminar.Enabled = true;
                         flag = 0;
                     }
                 }
                 else
                 {
                     Dialogs.Show("Debe poseer como minimo 1 departamento previamnete registrado", DialogsType.Info);
                 }
             }
             else
             {
                 Dialogs.Show("Ëxiste campo sin datos o datos erroneos, intente de nuevo", DialogsType.Error);
             }
         }
     }
     else if (flag == 0)
     {
         DialogsResults respuesta = Dialogs.Show("Esta seguro que desea guardar el item? ", DialogsType.Question);
         if (respuesta == DialogsResults.Yes)
         {
             string usuario, clave, correo, departamento;
             int    autorizar, liberar, reabrir, agregar, modificar, eliminar, id;
             if (txtUser.Text != string.Empty && txtPass.Text != string.Empty && txtCorreo.Text != string.Empty)
             {
                 if (cmbDepartamento.Items.Count > 0)
                 {
                     id           = int.Parse(dtDatos.CurrentRow.Cells[0].Value.ToString());
                     usuario      = txtUser.Text;
                     clave        = txtPass.Text;
                     correo       = txtCorreo.Text;
                     departamento = cmbDepartamento.SelectedValue.ToString();
                     if (chbAutorizado.Checked == true)
                     {
                         autorizar = 1;
                     }
                     else
                     {
                         autorizar = 0;
                     }
                     if (chbLiberar.Checked == true)
                     {
                         liberar = 1;
                     }
                     else
                     {
                         liberar = 0;
                     }
                     if (chbReabrir.Checked == true)
                     {
                         reabrir = 1;
                     }
                     else
                     {
                         reabrir = 0;
                     }
                     if (chbAgregar.Checked == true)
                     {
                         agregar = 1;
                     }
                     else
                     {
                         agregar = 0;
                     }
                     if (chbModificar.Checked == true)
                     {
                         modificar = 1;
                     }
                     else
                     {
                         modificar = 0;
                     }
                     if (chbEliminar.Checked == true)
                     {
                         eliminar = 1;
                     }
                     else
                     {
                         eliminar = 0;
                     }
                     bool resultado = controlador.UpdateUsuario(clave, departamento, correo, autorizar, liberar, reabrir, agregar, modificar, eliminar, id);
                     if (resultado == true)
                     {
                         Dialogs.Show(Properties.Resources.Editar + " el usuario", DialogsType.Info);
                         controlador.Usuarios(dtDatos);
                         string idcatalogo1;
                         idcatalogo1 = "Actualización de un Usuario";
                         Bitacora.AddBitacoradeEventos(GLOBALS.USUARIO, GLOBALS.DEPARTAMENTO, DateTime.Now, idcatalogo1);
                         dtDatos.Enabled     = true;
                         btnAlta.Enabled     = true;
                         btnEliminar.Enabled = true;
                     }
                 }
                 else
                 {
                     Dialogs.Show("Debe poseer como minimo 1 departamento previamente registrado", DialogsType.Info);
                 }
             }
             else
             {
                 Dialogs.Show("Ëxiste campo sin datos o datos erroneos, intente de nuevo", DialogsType.Error);
             }
         }
     }
 }
예제 #13
0
        private void btnActualizar_Click_1(object sender, EventArgs e)
        {
            if (flag == 1)
            {
                DialogsResults respuesta = Dialogs.Show("Esta seguro que desea guardar el item? ", DialogsType.Question);
                if (respuesta == DialogsResults.Yes)
                {
                    string Cliente, Tela, Conf, Lav, Proc, Avios, Falt, total;
                    if (txtCliente.Text != string.Empty && txtTela.Text != string.Empty && txtConf.Text != string.Empty && txtLav.Text != string.Empty && txtProc.Text != string.Empty && txtAvios.Text != string.Empty && txtFalt.Text != string.Empty && Segundas.Existe(txtCliente.Text) == false)
                    {
                        Cliente = txtCliente.Text;
                        Tela    = txtTela.Text;
                        Conf    = txtConf.Text;
                        Lav     = txtLav.Text;
                        Proc    = txtProc.Text;
                        Avios   = txtAvios.Text;
                        Falt    = txtFalt.Text;
                        Tela    = Tela.Replace("%", string.Empty);
                        Conf    = Conf.Replace("%", string.Empty);
                        Lav     = Lav.Replace("%", string.Empty);
                        Proc    = Proc.Replace("%", string.Empty);
                        Avios   = Avios.Replace("%", string.Empty);
                        Falt    = Falt.Replace("%", string.Empty);
                        total   = (float.Parse(Tela) + float.Parse(Conf) + float.Parse(Lav) + float.Parse(Proc) + float.Parse(Avios) + float.Parse(Falt)).ToString();
                        bool resultado = Segundas.AddSegundas(Cliente, Tela, Conf, Lav, Proc, Avios, Falt, total);
                        if (resultado == true)
                        {
                            Dialogs.Show(Properties.Resources.Agregar + " el Segundas", DialogsType.Info);
                            txtCliente.Text = string.Empty;
                            txtTela.Text    = string.Empty;
                            txtConf.Text    = string.Empty;
                            txtLav.Text     = string.Empty;
                            txtProc.Text    = string.Empty;
                            txtAvios.Text   = string.Empty;
                            txtFalt.Text    = string.Empty;
                            dtDatos.Enabled = true;
                            Segundas.Segundas(dtDatos);
                            string idcatalogo;
                            idcatalogo = "Alta de 2das y faltantes";
                            Bitacora.AddBitacoradeEventos(GLOBALS.USUARIO, GLOBALS.DEPARTAMENTO, DateTime.Now, idcatalogo);
                            dtDatos.Enabled     = true;
                            btnAlta.Enabled     = true;
                            btnEliminar.Enabled = true;
                            flag = 0;
                        }
                    }
                    else
                    {
                        Dialogs.Show("Ëxiste campo sin datos o datos erroneos, intente de nuevo", DialogsType.Error);
                    }
                }
            }
            else if (flag == 0)
            {
                DialogsResults respuesta = Dialogs.Show("Esta seguro que desea guardar el item? ", DialogsType.Question);
                if (respuesta == DialogsResults.Yes)
                {
                    string Cliente, Tela, Conf, Lav, Proc, Avios, Falt, total;
                    int    id;
                    if (txtCliente.Text != string.Empty && txtTela.Text != string.Empty && txtConf.Text != string.Empty && txtLav.Text != string.Empty && txtProc.Text != string.Empty && txtAvios.Text != string.Empty && txtFalt.Text != string.Empty && Segundas.Existe(txtCliente.Text) == false)
                    {
                        id = int.Parse(dtDatos.CurrentRow.Cells[0].Value.ToString());

                        Cliente = txtCliente.Text;
                        Tela    = txtTela.Text;
                        Conf    = txtConf.Text;
                        Lav     = txtLav.Text;
                        Proc    = txtProc.Text;
                        Avios   = txtAvios.Text;
                        Falt    = txtFalt.Text;
                        Tela    = Tela.Replace("%", string.Empty);
                        Conf    = Conf.Replace("%", string.Empty);
                        Lav     = Lav.Replace("%", string.Empty);
                        Proc    = Proc.Replace("%", string.Empty);
                        Avios   = Avios.Replace("%", string.Empty);
                        Falt    = Falt.Replace("%", string.Empty);
                        total   = (float.Parse(Tela) + float.Parse(Conf) + float.Parse(Lav) + float.Parse(Proc) + float.Parse(Avios) + float.Parse(Falt)).ToString();
                        bool resultado = Segundas.UpdateSegundas(Cliente, Tela, Conf, Lav, Proc, Avios, Falt, total, id);
                        if (resultado == true)
                        {
                            Dialogs.Show(Properties.Resources.Editar + " el Segundas", DialogsType.Info);
                            txtCliente.Text = string.Empty;
                            txtTela.Text    = string.Empty;
                            txtConf.Text    = string.Empty;
                            txtLav.Text     = string.Empty;
                            txtProc.Text    = string.Empty;
                            txtAvios.Text   = string.Empty;
                            txtFalt.Text    = string.Empty;
                            dtDatos.Enabled = true;
                            Segundas.Segundas(dtDatos);
                            dtDatos.Enabled     = true;
                            btnAlta.Enabled     = true;
                            btnEliminar.Enabled = true;
                            string idcatalogo1;
                            idcatalogo1 = "Actualización de  2das y faltantes ";
                            Bitacora.AddBitacoradeEventos(GLOBALS.USUARIO, GLOBALS.DEPARTAMENTO, DateTime.Now, idcatalogo1);
                        }
                    }
                    else
                    {
                        Dialogs.Show("Ëxiste campo sin datos o datos erroneos, intente de nuevo", DialogsType.Error);
                    }
                }
            }
        }
예제 #14
0
파일: BOM.cs 프로젝트: ErickNavarrete/PLM
        private void DtBOM_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            int Ncolumna = 0;

            Ncolumna = e.ColumnIndex;
            if (Ncolumna == 1)
            {
                TareaTemporal tempTask;
                var           imagen  = DtBOM.CurrentCell.Value;
                Image         _imagen = (Image)imagen;
                string        tempBom = txtNroBom.Text.Trim().Replace("N", "").Replace("E", "");
                string        tempNacionalidad;
                if (txtNroBom.Text.Contains("N"))
                {
                    tempNacionalidad = "N";
                }
                else
                {
                    tempNacionalidad = "E";
                }
                switch ((int)_imagen.Tag)
                {
                case 0:
                    DialogsResults result = Dialogs.Show("¿Desea cambiar el estado de la tarea?", DialogsType.Question);
                    if (result == DialogsResults.Yes)
                    {
                        _imagen                 = null;
                        _imagen                 = Properties.Resources.estado2;
                        _imagen.Tag             = 1;
                        DtBOM.CurrentCell.Value = _imagen;
                        int flagNota;
                        if (DtBOM.CurrentRow.Cells[11].Value.ToString() == string.Empty)
                        {
                            flagNota = 0;
                        }
                        else
                        {
                            flagNota = 1;
                        }
                        tempTask = new TareaTemporal
                        {
                            segmento     = DtBOM.CurrentRow.Cells[0].Value.ToString(),
                            trim         = DtBOM.CurrentRow.Cells[2].Value.ToString(),
                            bom          = tempBom,
                            nacionalidad = tempNacionalidad,
                            flagNota     = flagNota
                        };
                        listaTemporal.Add(tempTask);
                        //Bom.Tasks(DtBOM.CurrentRow.Cells[0].Value.ToString(), DtBOM.CurrentRow.Cells[2].Value.ToString(), tempBom, tempNacionalidad, flagNota);
                    }
                    break;
                }
                //if((int)_imagen.Tag == 2)
                //{
                //    DialogsResults result = Dialogs.Show("¿Desea cambiar el estado de la tarea?", DialogsType.Question);
                //    if (result == DialogsResults.Yes)
                //    {

                //    }
                //}
            }
            var   imagen1  = DtBOM.CurrentRow.Cells[1].Value;
            Image _imagen1 = (Image)imagen1;

            if (Ncolumna == 4 && (int)_imagen1.Tag < 1 && ((DtBOM.CurrentCell.Value.ToString() == string.Empty || DtBOM.CurrentCell.Value.ToString() == " ")))
            {
                int sum;
                sum = Ncolumna + 20;
                string            _temporal   = DtBOM.CurrentCell.Value.ToString();
                Busqueda.Busqueda frmBusqueda = new Busqueda.Busqueda(sum);
                frmBusqueda.ShowDialog();
                if (!string.IsNullOrEmpty(frmBusqueda.dato))
                {
                    DtBOM.CurrentCell.Value = frmBusqueda.dato;
                }
                else
                {
                    DtBOM.CurrentCell.Value = _temporal;
                }
            }
            if (Ncolumna == 5 && (int)_imagen1.Tag < 1 && ((DtBOM.CurrentCell.Value.ToString() == string.Empty || DtBOM.CurrentCell.Value.ToString() == " ")))
            {
                int sum;
                sum = Ncolumna - 5;
                Busqueda.Busqueda frmBusqueda = new Busqueda.Busqueda(sum);
                frmBusqueda.ShowDialog();
                DtBOM.CurrentCell.Value = frmBusqueda.dato;
            }
            if (Ncolumna == 3 && (int)_imagen1.Tag < 1)
            {
                int sum;
                sum = Ncolumna + 20;
                string            _temporal   = DtBOM.CurrentCell.Value.ToString();
                Busqueda.Busqueda frmBusqueda = new Busqueda.Busqueda(sum);
                frmBusqueda.ShowDialog();
                if (!string.IsNullOrEmpty(frmBusqueda.dato))
                {
                    DtBOM.CurrentCell.Value = frmBusqueda.dato;
                    Bom.Itemcode(frmBusqueda.dato, DtBOM);
                }
                else
                {
                    DtBOM.CurrentCell.Value = _temporal;
                }
            }
            if (Ncolumna == 7 && (int)_imagen1.Tag < 1 && ((DtBOM.CurrentCell.Value.ToString() == string.Empty || DtBOM.CurrentCell.Value.ToString() == " ")))
            {
                int sum;
                sum = Ncolumna + 20;
                string            _temporal   = DtBOM.CurrentCell.Value.ToString();
                Busqueda.Busqueda frmBusqueda = new Busqueda.Busqueda(sum);
                frmBusqueda.ShowDialog();
                if (!string.IsNullOrEmpty(frmBusqueda.dato))
                {
                    DtBOM.CurrentCell.Value = frmBusqueda.dato;
                }
                else
                {
                    DtBOM.CurrentCell.Value = _temporal;
                }
            }
            if (Ncolumna == 6 && (int)_imagen1.Tag < 1 && ((DtBOM.CurrentCell.Value.ToString() == string.Empty || DtBOM.CurrentCell.Value.ToString() == " ")))
            {
                int sum;
                sum = Ncolumna + 20;
                string            _temporal   = DtBOM.CurrentCell.Value.ToString();
                Busqueda.Busqueda frmBusqueda = new Busqueda.Busqueda(sum);
                frmBusqueda.ShowDialog();

                if (!string.IsNullOrEmpty(frmBusqueda.dato))
                {
                    DtBOM.CurrentCell.Value = frmBusqueda.dato;
                }
                else
                {
                    DtBOM.CurrentCell.Value = _temporal;
                }
            }
            if (Ncolumna == 10 && (int)_imagen1.Tag < 1 && ((DtBOM.CurrentCell.Value.ToString() == string.Empty || DtBOM.CurrentCell.Value.ToString() == " ")))
            {
                int sum;
                sum = Ncolumna + 20;
                string            _temporal   = DtBOM.CurrentCell.Value.ToString();
                Busqueda.Busqueda frmBusqueda = new Busqueda.Busqueda(sum);
                frmBusqueda.ShowDialog();
                if (!string.IsNullOrEmpty(frmBusqueda.dato))
                {
                    DtBOM.CurrentCell.Value = frmBusqueda.dato;
                }
                else
                {
                    DtBOM.CurrentCell.Value = _temporal;
                }
            }
            if (Ncolumna == 9 && (int)_imagen1.Tag < 1 && ((DtBOM.CurrentCell.Value.ToString() == string.Empty || DtBOM.CurrentCell.Value.ToString() == " ")))
            {
                int sum;
                sum = Ncolumna + 20;
                string            _temporal   = DtBOM.CurrentCell.Value.ToString();
                Busqueda.Busqueda frmBusqueda = new Busqueda.Busqueda(sum);
                frmBusqueda.ShowDialog();

                if (!string.IsNullOrEmpty(frmBusqueda.dato))
                {
                    DtBOM.CurrentCell.Value = frmBusqueda.dato;
                }
                else
                {
                    DtBOM.CurrentCell.Value = _temporal;
                }
            }
            if (Ncolumna == 8 && (int)_imagen1.Tag < 1)
            {
                string dato2;
                if (DtBOM.Rows.Count > 0)
                {
                    dato2 = DtBOM.CurrentRow.Cells[8].Value.ToString();
                    int sum;
                    sum = Ncolumna + 20;
                    Busqueda.Input frm = new Busqueda.Input(sum, dato2);
                    frm.ShowDialog();
                    DtBOM.CurrentCell.Value = frm.dato;
                }
                else
                {
                    int sum;
                    sum = Ncolumna + 20;
                    Busqueda.Input frm = new Busqueda.Input(sum, "0");
                    frm.ShowDialog();
                    DtBOM.CurrentCell.Value = frm.dato;
                }
            }
            if (Ncolumna == 11 && (int)_imagen1.Tag < 1)
            {
                string dato2;
                if (DtBOM.Rows.Count > 0)
                {
                    dato2 = DtBOM.CurrentRow.Cells[11].Value.ToString();
                    int sum;
                    sum = Ncolumna + 20;
                    Busqueda.Input frm = new Busqueda.Input(sum, dato2);
                    frm.ShowDialog();
                    DtBOM.CurrentCell.Value = frm.dato;
                }
                else
                {
                    int sum;
                    sum = Ncolumna + 20;
                    Busqueda.Input frm = new Busqueda.Input(sum, "");
                    frm.ShowDialog();
                    DtBOM.CurrentCell.Value = frm.dato;
                }
            }
        }
예제 #15
0
 private void btnGuardar_Click(object sender, EventArgs e)
 {
     if (flag == 1)
     {
         DialogsResults respuesta = Dialogs.Show("Esta seguro que desea guardar el item? ", DialogsType.Question);
         if (respuesta == DialogsResults.Yes)
         {
             string idPresupuestos, Diario, Mo, Prestaciones, Admon, Prod, Venta, Varios;
             if (txtIdPresupuestos.Text != string.Empty && txtDiario.Text != string.Empty && txtMO.Text != string.Empty && txtPrest.Text != string.Empty && txtAdmon.Text != string.Empty && txtProd.Text != string.Empty && txtVentas.Text != string.Empty && txtVarios.Text != string.Empty && txtIdPresupuestos.Text != string.Empty)
             {
                 idPresupuestos = txtIdPresupuestos.Text;
                 Diario         = txtDiario.Text;
                 Mo             = txtMO.Text;
                 Prestaciones   = txtPrest.Text;
                 Admon          = txtAdmon.Text;
                 Prod           = txtProd.Text;
                 Venta          = txtVentas.Text;
                 Varios         = txtVarios.Text;
                 Mo             = Mo.Replace("MX$", string.Empty);
                 Prestaciones   = Prestaciones.Replace("MX$", string.Empty);
                 Admon          = Admon.Replace("MX$", string.Empty);
                 Prod           = Prod.Replace("MX$", string.Empty);
                 Venta          = Venta.Replace("MX$", string.Empty);
                 Varios         = Varios.Replace("MX$", string.Empty);
                 bool resultado = Presupuestos.AddPresupuestos(Diario, Mo, Prestaciones, Admon, Prod, Venta, Varios, idPresupuestos);
                 if (resultado == true)
                 {
                     Dialogs.Show(Properties.Resources.Agregar + " el Presupuestos", DialogsType.Info);
                     txtDiario.Text  = string.Empty;
                     txtMO.Text      = string.Empty;
                     txtPrest.Text   = string.Empty;
                     txtProd.Text    = string.Empty;
                     txtVentas.Text  = string.Empty;
                     txtVarios.Text  = string.Empty;
                     txtAdmon.Text   = string.Empty;
                     dtDatos.Enabled = true;
                     Presupuestos.Presupuestos(dtDatos);
                     string idcatalogo;
                     idcatalogo = "Alta de un Item de Presupuesto";
                     Bitacora.AddBitacoradeEventos(GLOBALS.USUARIO, GLOBALS.DEPARTAMENTO, DateTime.Now, idcatalogo);
                     dtDatos.Enabled     = true;
                     btnAlta.Enabled     = true;
                     btnEliminar.Enabled = true;
                     flag = 0;
                 }
                 else
                 {
                     Dialogs.Show("Ëxiste campo sin datos o datos erroneos, intente de nuevo", DialogsType.Error);
                 }
             }
         }
     }
     else if (flag == 0)
     {
         DialogsResults respuesta = Dialogs.Show("Esta seguro que desea guardar el item? ", DialogsType.Question);
         if (respuesta == DialogsResults.Yes)
         {
             int    id;
             string idPresupuestos, Diario, Mo, Prestaciones, Admon, Prod, Venta, Varios;
             if (txtIdPresupuestos.Text != string.Empty && txtDiario.Text != string.Empty && txtMO.Text != string.Empty && txtPrest.Text != string.Empty && txtAdmon.Text != string.Empty && txtProd.Text != string.Empty && txtVentas.Text != string.Empty && txtVarios.Text != string.Empty && txtIdPresupuestos.Text != string.Empty)
             {
                 id             = int.Parse(dtDatos.CurrentRow.Cells[0].Value.ToString());
                 idPresupuestos = txtIdPresupuestos.Text;
                 Diario         = txtDiario.Text;
                 Mo             = txtMO.Text;
                 Prestaciones   = txtPrest.Text;
                 Admon          = txtAdmon.Text;
                 Prod           = txtProd.Text;
                 Venta          = txtVentas.Text;
                 Varios         = txtVarios.Text;
                 Mo             = Mo.Replace("MX$", string.Empty);
                 Prestaciones   = Prestaciones.Replace("MX$", string.Empty);
                 Admon          = Admon.Replace("MX$", string.Empty);
                 Venta          = Venta.Replace("MX$", string.Empty);
                 Prod           = Prod.Replace("MX$", string.Empty);
                 Varios         = Varios.Replace("MX$", string.Empty);
                 Mo             = Mo.Replace("$", string.Empty);
                 Prestaciones   = Prestaciones.Replace("$", string.Empty);
                 Admon          = Admon.Replace("$", string.Empty);
                 Venta          = Venta.Replace("$", string.Empty);
                 Prod           = Prod.Replace("$", string.Empty);
                 Varios         = Varios.Replace("$", string.Empty);
                 bool resultado = Presupuestos.UpdatePresupuestos(Diario, Mo, Prestaciones, Admon, Prod, Venta, Varios, idPresupuestos, id);
                 if (resultado == true)
                 {
                     Dialogs.Show(Properties.Resources.Editar + " el Presupuestos", DialogsType.Info);
                     txtDiario.Text  = string.Empty;
                     txtMO.Text      = string.Empty;
                     txtPrest.Text   = string.Empty;
                     txtProd.Text    = string.Empty;
                     txtVentas.Text  = string.Empty;
                     txtVarios.Text  = string.Empty;
                     dtDatos.Enabled = true;
                     Presupuestos.Presupuestos(dtDatos);
                     string idcatalogo1;
                     idcatalogo1 = "Actualización de un Presupuesto";
                     Bitacora.AddBitacoradeEventos(GLOBALS.USUARIO, GLOBALS.DEPARTAMENTO, DateTime.Now, idcatalogo1);
                     dtDatos.Enabled     = true;
                     btnAlta.Enabled     = true;
                     btnEliminar.Enabled = true;
                 }
             }
             else
             {
                 Dialogs.Show("Ëxiste campo sin datos o datos erroneos, intente de nuevo", DialogsType.Error);
             }
         }
     }
 }