Exemple #1
0
        private void Frm_Gerar_Cheques_FormClosing(object sender, FormClosingEventArgs e)
        {
            foreach (Form form_aberto in Application.OpenForms)
            {
                if (form_aberto.Text.Contains("Cadastro do Contas a Pagar"))
                {
                    Frm_Contas_Pagar form = (Frm_Contas_Pagar)form_aberto;

                    form.Enabled            = true;
                    form.cheque_pagar_todos = new Cheques_PagarCollection();
                    foreach (Cheques_Pagar cheque_pagar in cheque_pagar_todos)
                    {
                        form.cheque_pagar_todos.Add(cheque_pagar);

                        if (cheque_pagar.CHP_ITEM == CHP_ITEM)
                        {
                            //Para encontrar o item correto na lista de cheque é preciso usar um loop e ir comparando
                            //Já nas parcelas a lista segue a ordem precisamente, então dá pra buscá-la diretamente
                            form.parcela_todos[CHP_ITEM - 1].PCA_NUM_DOC = cheque_pagar.CHP_NUM_DOC;
                            form.parcela_todos[CHP_ITEM - 1].PCA_VALOR   = cheque_pagar.CHP_VALOR;
                            form.parcela_todos[CHP_ITEM - 1].PCA_VENC    = cheque_pagar.CHP_VENC;
                            form.parcela_todos[CHP_ITEM - 1].PCA_OBS     = cheque_pagar.CHP_OBS;
                        }
                    }
                    form.btn_cheque.Enabled = false;
                    form.Carregar_Grid(form.parcela_todos);
                }
            }
        }
Exemple #2
0
        private void btn_mov_contas_pagar_Click(object sender, EventArgs e)
        {
            Frm_Contas_Pagar form = new Frm_Contas_Pagar(0);

            form.Show();

            Fechar_Form();
        }
Exemple #3
0
        private void btn_cadastro_Click(object sender, EventArgs e)
        {
            Frm_Contas_Pagar form = new Frm_Contas_Pagar(0);

            form.Show();

            this.Hide();
        }
Exemple #4
0
        private void Frm_Gerar_Parcelas_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (ORIGEM == 0)
            {
                foreach (Form form_aberto in Application.OpenForms)
                {
                    if (form_aberto.Text.Contains("Cadastro do Contas a Pagar"))
                    {
                        Frm_Contas_Pagar form = (Frm_Contas_Pagar)form_aberto;

                        form.Enabled = true;
                        if (parcela_todos.Count > 0)
                        {
                            form.btn_cheque.Enabled = false;
                            if (PCA_CARNE == 0)
                            {
                                form.cheque_pagar_todos = new Cheques_PagarCollection();
                            }
                            form.Carregar_Grid(parcela_todos);
                        }
                    }
                }
            }
            else
            {
                foreach (Form form_aberto in Application.OpenForms)
                {
                    if (form_aberto.Text.Contains("Cadastro de Compra"))
                    {
                        Frm_Compra form = (Frm_Compra)form_aberto;

                        form.Enabled = true;
                        if (ORIGEM == 2)
                        {
                            form.Gravar(false);
                            Frm_Contas_Pagar form_abrir = new Frm_Contas_Pagar(0);
                            form_abrir.Enabled = true;
                            if (parcela_todos.Count > 0)
                            {
                                form_abrir.btn_cheque.Enabled = false;
                                if (PCA_CARNE == 0)
                                {
                                    form_abrir.cheque_pagar_todos = new Cheques_PagarCollection();
                                }
                                form_abrir.Carregar_Grid(parcela_todos);
                                form_abrir.Construir(int.Parse(form.tb_codigo.Text));
                            }
                            //A Joincar solicitou que ao gravar a compra mantesse na tela da compra
                            //form.Hide();
                            //form_abrir.Show();
                            form_abrir.Close();
                        }
                        break;
                    }
                }
            }
        }
Exemple #5
0
        private void dvg_contas_pagar_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                int CAP_CODIGO = int.Parse(dvg_contas_pagar.Rows[e.RowIndex].Cells[0].Value.ToString());

                Frm_Contas_Pagar form = new Frm_Contas_Pagar(CAP_CODIGO);
                form.Show();

                this.Hide();
            }
        }
Exemple #6
0
        private void btn_mov_contas_pagar_Click(object sender, EventArgs e)
        {
            Frm_Contas_Pagar form = new Frm_Contas_Pagar(0);

            form.Show();

            if (this.Text.Contains("Inicio"))
            {
                this.Hide();
            }
            else
            {
                this.Hide();
                this.Close();
            }
        }