示例#1
0
        private void empresasToolStripMenuItem_Click(object sender, EventArgs e)
        {
            mantenimientoEmpresas temp = new mantenimientoEmpresas();

            //temp.WindowState = FormWindowState.Maximized;
            temp.MdiParent = this;
            temp.Show();
        }
示例#2
0
文件: Empresas.cs 项目: sadcc24/SCM
        private void btnEditar_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtEmpresa.Text))
            {
                MessageBox.Show("Debe agregar la descripción de la Empresa.");
                return;
            }
            else
            {
                if (string.IsNullOrEmpty(txtRazon.Text))
                {
                    MessageBox.Show("Debe agregar la razón social  de la Empresa.");
                    return;
                }
                else
                {
                    if (string.IsNullOrEmpty(txtActivo.Text))
                    {
                        MessageBox.Show("Debe agregar el estado de la Empresa.");
                        return;
                    }
                    else
                    {
                        try
                        {
                            Empresas_Entity Money    = new Empresas_Entity();
                            Empresas_BO     Empresas = new Empresas_BO();
                            Money.idempresa         = txtCod.Text;
                            Money.idsede            = cmbSede.SelectedText;
                            Money.idmoneda          = cmbMoneda.SelectedText;
                            Money.strempresa        = txtEmpresa.Text;
                            Money.strrazon          = txtRazon.Text;
                            Money.strdireccion      = txtDireccion.Text;
                            Money.strtelefono       = txtTelefono.Text;
                            Money.stridentificacion = txtIdentificacion.Text;
                            Money.iactivo           = txtActivo.Text;
                            Empresas.vModificarEmpresa(Money);
                            MessageBox.Show("Empresa ha sido Modificada.");
                            mantenimientoEmpresas prdu = new mantenimientoEmpresas();
                            prdu.MdiParent = this.MdiParent;
                            this.Close();
                            prdu.Show();
                        }

                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }
                    }
                } //termina if
            }
        }
示例#3
0
文件: Empresas.cs 项目: sadcc24/SCM
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtCod.Text))
            {
                MessageBox.Show("Debe escribir el id de la Empresas a eliminar.");
                return;
            }
            else
            {
                Empresas_Entity Money    = new Empresas_Entity();
                Empresas_BO     Empresas = new Empresas_BO();
                Money.idempresa = txtCod.Text;

                Empresas.vEliminarEmpresa(Money);
                MessageBox.Show("Empresa ha sido Eliminada.");
                mantenimientoEmpresas prdu = new mantenimientoEmpresas();
                prdu.MdiParent = this.MdiParent;
                this.Hide();
                prdu.Show();
            }
        }
示例#4
0
文件: Empresas.cs 项目: sadcc24/SCM
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtEmpresa.Text))
            {
                MessageBox.Show("Debe agregar la descripción de la Empresa.");
                return;
            }
            else
            {
                if (string.IsNullOrEmpty(txtRazon.Text))
                {
                    MessageBox.Show("Debe agregar la razón social de la Empresa.");
                    return;
                }
                else
                {
                    if (string.IsNullOrEmpty(txtActivo.Text))
                    {
                        MessageBox.Show("Debe agregar el estado de la Empresa.");
                        return;
                    }
                    else
                    {
                        try
                        {
                            Empresas_Entity Money = new Empresas_Entity();
                            Empresas_BO     Empresas = new Empresas_BO();
                            int             ssede, smoneda;

                            Money.strempresa = txtEmpresa.Text;
                            Money.strrazon   = txtRazon.Text;

                            ssede        = cmbSede.SelectedIndex;
                            Money.idsede = gvSedes[0, ssede].Value.ToString();

                            smoneda        = cmbMoneda.SelectedIndex;
                            Money.idmoneda = gvMonedas[0, smoneda].Value.ToString();

                            Money.strdireccion      = txtDireccion.Text;
                            Money.strtelefono       = txtTelefono.Text;
                            Money.stridentificacion = txtIdentificacion.Text;
                            Money.iactivo           = txtActivo.Text;
                            Empresas.vInsertarEmpresa(Money);
                            MessageBox.Show("Empresa ha sido creada.");
                            string[] emp = Globales.Empresa.CapturarEmpresa();
                            if (emp[0] != "No Autenticado")
                            {
                                mantenimientoEmpresas prdu = new mantenimientoEmpresas();
                                prdu.MdiParent = this.MdiParent;
                                this.Hide();
                                prdu.Show();
                            }
                            else
                            {
                                this.Hide();
                            }
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message, "Error!.");
                        }
                    }
                }
            } //termina if
        }