Ejemplo n.º 1
0
        private void AgregarEmpleadoo_Click(object sender, EventArgs e)
        {
            Empleado PEmpleado = new Empleado();

            if (CajaDocu.Text == "" | CajaNom.Text == "" | CajaApe.Text == ""
                | CajaCel.Text == "" | CajaDirecc.Text == "" | CajaCorreo.Text == "" |
                ComboEstado.Text == "-Seleccione Estado-" | ComboCargo.Text == "-Seleccione Cargo-"
                | ComprobarFormatoEmail(CajaCorreo.Text) == false)
            {
                Registro_Incompleto Incompleto = new Registro_Incompleto();
                Incompleto.ShowDialog();
            }

            else
            {
                PEmpleado.No_Documento_em = Convert.ToInt64(CajaDocu.Text);
                string op = em.Existencia_Empleado(CajaDocu.Text);
                if (op == "No existe")
                {
                    PEmpleado.Correo_em    = CajaCorreo.Text;
                    PEmpleado.Nombre_em    = CajaNom.Text;
                    PEmpleado.Apellido_em  = CajaApe.Text;
                    PEmpleado.Celular_em   = Convert.ToInt64(CajaCel.Text);
                    PEmpleado.Direccion_em = CajaDirecc.Text;

                    PEmpleado.Estado_em    = ComboEstado.Text;
                    PEmpleado.Nombre_cargo = (TipoCargo)Enum.Parse(typeof(TipoCargo), ComboCargo.Text);

                    if (CajaTel.Text != "")
                    {
                        PEmpleado.Telefono_em = Convert.ToInt64(CajaTel.Text);
                    }
                    else
                    {
                        PEmpleado.Telefono_em = 0;
                    }
                    int ResultadoReg = Empleado.RegistrarEmpleado(PEmpleado);

                    if (ResultadoReg > 0)
                    {
                        Datagriedemple.DataSource = Empleado.ConsultarEmpleado(Convert.ToString(PEmpleado.No_Documento_em));
                        Nombres();
                        RegistroCompletado Completo = new RegistroCompletado();
                        Completo.ShowDialog();
                        Limpiar();
                        PanelRegistroEmpleados.Visible = false;
                        En_PDF();
                    }
                    else
                    {
                        Registro_Incompleto Incompleto = new Registro_Incompleto();
                        Incompleto.ShowDialog();
                    }
                }
                else
                {
                    MessageBox.Show("Este Numero de documento ya esta registrado");
                }
            }
        }
Ejemplo n.º 2
0
        private void Registrar_Click(object sender, EventArgs e)
        {
            Inventario PInventario = new Inventario();

            if (CajaTp.Text == "" | CajaCE.Text == ""
                | CajaTam.Text == "" | CajaVpro.Text == "" | CajaEm.Text == "-Seleccione Empresa-" |
                CajaDes.Text == "")
            {
                Registro_Incompleto Incompleto = new Registro_Incompleto();
                Incompleto.ShowDialog();
            }
            else
            {
                string i = CajaEm.Text;
                InvId = Inventario.ObtenerIDEmp(i);

                if (InvId != null)
                {
                    InvIdAc             = InvId;
                    PInventario.Id_Prov = InvIdAc.Id_Prov;
                }

                PInventario.Id_Prov            = PInventario.Id_Prov;
                PInventario.Tipo_de_pieza      = CajaTp.Text;
                PInventario.Cantidad_Existente = Convert.ToInt64(CajaCE.Text);
                PInventario.Tamaño             = CajaTam.Text;
                PInventario.Valor_Proveedor    = Convert.ToDecimal(CajaVpro.Text);
                PInventario.Empresa            = CajaEm.Text;

                PInventario.Descripcion = CajaDes.Text;

                PanelRegistroMateriaprima.Visible = false;
                int ResultadoReg = Inventario.RegistrarMateriaPrima(PInventario);
                if (ResultadoReg > 0)
                {
                    RegistroCompletado Completo = new RegistroCompletado();
                    Completo.ShowDialog();
                    DatagriedInv.DataSource = Inventario.ConsultarMateriaPrima(Convert.ToString(""));
                    Nombres();
                    En_PDF();
                    Limpiar();
                }
                else
                {
                    Registro_Incompleto Incompleto = new Registro_Incompleto();
                    Incompleto.ShowDialog();
                }
            }
        }
Ejemplo n.º 3
0
        private void Registrar_Click(object sender, EventArgs e)
        {
            Produccioon PProduccion = new Produccioon();

            if (CajaNomProduc.Text == "" | CajaValorProduc.Text == ""
                | CajaTam.Text == "" | RichDescrip.Text == "")
            {
                SeguridadCompleteCam formx = new SeguridadCompleteCam();
                formx.ShowDialog();
            }
            else
            {
                if (dataProducInv.Rows.Count > 0)
                {
                    PProduccion.Id_Ma           = Convert.ToInt64(label2.Text);
                    PProduccion.Tipo_Ma         = Convert.ToString(LaMaqui.Text);
                    PProduccion.Nombre_Producto = Convert.ToString(CajaNomProduc.Text);
                    PProduccion.Tamaño          = Convert.ToString(CajaTam.Text);
                    PProduccion.Valor_Producto  = Convert.ToInt64(CajaValorProduc.Text);
                    PProduccion.Descripcion     = Convert.ToString(RichDescrip.Text);
                    PProduccion.Empresa         = Convert.ToString(CajaEmpresa.Text);
                    PProduccion.Id_Produccion   = Convert.ToInt64(LaIdProducc.Text);


                    int ResultadoReeeg = Produccioon.ActualizarProduccion(PProduccion);
                    if (ResultadoReeeg > 0)
                    {
                        RegistroCompletado Completo = new RegistroCompletado();
                        Completo.ShowDialog();

                        Limpiar();
                        PanelProduccion.Visible = false;
                    }
                    else
                    {
                        Registro_Incompleto Incompleto = new Registro_Incompleto();
                        Incompleto.ShowDialog();
                    }
                }
                else
                {
                    MessageBox.Show("Agregue UNA materia prima");
                }
            }
        }
Ejemplo n.º 4
0
        private void Agregar_Click(object sender, EventArgs e)
        {
            Produc_Invent PProducInvent = new Produc_Invent();

            if (CajaCantNece.Text == "" | CajaCodigo.Text == "-Seleccione ID-" | CajaCodigo.Text == "")
            {
                SeguridadCompleteCam formx = new SeguridadCompleteCam();
                formx.ShowDialog();
            }
            else
            {
                Int32 a = Convert.ToInt32(CantInvEx.Text);
                Int32 b = Convert.ToInt32(CajaCantNece.Text);

                if (b > a)
                {
                    MessageBox.Show("Solo tienes unidades :" + a + " de este producto");
                }
                else
                {
                    PProducInvent.Cantidad_Necesitada = Convert.ToInt64(CajaCantNece.Text);
                    PProducInvent.Id_Produccion       = Convert.ToInt64(LaIdProducc.Text);
                    PProducInvent.Id_pz         = Convert.ToInt64(CajaCodigo.Text);
                    PProducInvent.Tipo_de_pieza = LaNomProd.Text;

                    int ResultadoReeeg = Produc_Invent.RegistrarProduccTT(PProducInvent);
                    if (ResultadoReeeg > 0)
                    {
                        dataProducInv.DataSource = Produc_Invent.ConsultarProduccTT(LaIdProducc.Text);
                        OrdenFilasTT();
                        NombreColumnsTT();

                        dataProducInv.Columns[0].Visible = false;

                        CajaCantNece.Text = "";
                        CajaCodigo.Text   = "-Seleccione ID-";
                    }
                    else
                    {
                        Registro_Incompleto Incompleto = new Registro_Incompleto();
                        Incompleto.ShowDialog();
                    }
                }
            }
        }
Ejemplo n.º 5
0
        private void Registrar_Click(object sender, EventArgs e)
        {
            Proveedor PProveedor = new Proveedor();

            if (CajaNit.Text == "" | CajaEmp.Text == "" |
                CajaCor.Text == "" | CajaTel.Text == "" | ComprobarFormatoEmail(CajaCor.Text) == false)
            {
                Registro_Incompleto Incompleto = new Registro_Incompleto();
                Incompleto.ShowDialog();
            }
            else
            {
                PProveedor.Nit_Prov              = Convert.ToInt64(CajaNit.Text);
                PProveedor.Empresa               = CajaEmp.Text;
                PProveedor.Correo_Prov           = CajaCor.Text;
                PProveedor.Telefono_Prov         = Convert.ToInt64(CajaTel.Text);
                PProveedor.Estado_Prov           = comboEstProv.Text;
                PanelRegistroProveedores.Visible = false;
                Limpiar();

                int ResultadoReg = Proveedor.RegistrarProveedor(PProveedor);
                if (ResultadoReg > 0)
                {
                    RegistroCompletado Completo = new RegistroCompletado();
                    Completo.ShowDialog();
                    PanelRegistroProveedores.Visible = false;
                    DatagriedProv.DataSource         = Proveedor.ConsultarProveedor(Convert.ToString(PProveedor.Nit_Prov));
                    Nombres();
                    Limpiar();
                    En_PDF();
                }
                else
                {
                    Registro_Incompleto Incompleto = new Registro_Incompleto();
                    Incompleto.ShowDialog();
                    PanelRegistroProveedores.Visible = false;
                    Limpiar();
                }
            }
        }
Ejemplo n.º 6
0
        private void Registrar_Click(object sender, EventArgs e)
        {
            Maquinaria PMaquinaria = new Maquinaria();

            if (CajaTipo.Text == "" | ComboEstado.Text == "-Seleccione Estado-" |
                ComboGarantia.Text == "-Tiempo Garantia-" | CajaNReparacion.Text == "" |
                RichMantenimiento.Text == "")
            {
                Registro_Incompleto Incompleto = new Registro_Incompleto();
                Incompleto.ShowDialog();
            }
            else
            {
                PMaquinaria.Tipo_Ma             = CajaTipo.Text;
                PMaquinaria.Estado_Ma           = ComboEstado.Text;
                PMaquinaria.Garantia            = ComboGarantia.Text;
                PMaquinaria.NumeroReparacion    = Convert.ToInt64(CajaNReparacion.Text);
                PMaquinaria.Mantenimiento       = RichMantenimiento.Text;
                PanelRegistroMaquinaria.Visible = false;


                int ResultadoReg = Maquinaria.RegistrarMaquinaria(PMaquinaria);
                if (ResultadoReg > 0)
                {
                    RegistroCompletado Completo = new RegistroCompletado();
                    Completo.ShowDialog();
                    dataGridMa.DataSource = Maquinaria.ConsultarMaquinaria(Convert.ToString(Convert.ToString("")));
                    Nombres();
                    PanelRegistroMaquinaria.Visible = false;
                    Limpiar();
                    En_PDF();
                }
                else
                {
                    Registro_Incompleto Incompleto = new Registro_Incompleto();
                    Incompleto.ShowDialog();
                }
            }
        }