Example #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            var index = new IndexForm();

            this.Hide();
            index.Show();
        }
Example #2
0
        private void buttonClose_Click(object sender, EventArgs e)
        {
            //Environment.Exit(0);
            Close();

            IndexForm indexForm = new IndexForm();

            indexForm.Show();
        }
Example #3
0
        public void CarregarTemplate()
        {
            IndexForm inicio = new IndexForm();

            inicio.TopLevel = false;
            if (panel2.Controls.Count != 0)
            {
                panel2.Controls.RemoveAt(0);
            }
            panel2.Controls.Add(inicio);
            inicio.Show();
        }
Example #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            DateTime fechaRendicion = ConfiguracionFecha.FechaSistema;
            //Valido si ya hubo una rendicion en este periodo para esta empresa
            string  empresaCuit = ((ComboBoxItemStringValue)comboEmpresas.SelectedItem).Value;
            decimal porcentajeComision;

            if (this.facturas.Count > 0)
            {
                if (decimal.TryParse(txtPorcentaje.Text, out porcentajeComision) && porcentajeComision >= 0 && porcentajeComision <= 100)
                {
                    bool yaHuboRendicion = RendicionesRepository.ExisteRendicionParaEmpresaYPeriodo(empresaCuit, fechaRendicion);
                    if (!yaHuboRendicion)
                    {
                        Rendicion rend = new Rendicion(empresaCuit, facturas, fechaRendicion, porcentajeComision);
                        try
                        {
                            RendicionesRepository.AgregarRendicion(rend);
                            MessageBox.Show("Se ha realizado la rendición correctamente");
                            this.Hide();
                            var indexFacturasForm = new IndexForm();
                            indexFacturasForm.Show();
                        }
                        catch (Exception exce)
                        {
                            MessageBox.Show("Hubo un error al realizar la rendicion. Intente nuevamente");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Ya se realizó una rendición para esta empresa en este periodo");
                    }
                }
                else
                {
                    MessageBox.Show("Ingrese un valor valido para el porcentaje");
                }
            }
            else
            {
                MessageBox.Show("No se puede realizar una rendicion sin facturas asociadas");
            }
        }
Example #5
0
        private void MstPatientForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            IndexForm indexForm = new IndexForm();

            indexForm.Show();
        }