コード例 #1
0
ファイル: FrmPrincipal.cs プロジェクト: guislim/SACG
 private void contasAPagarAtrazadasToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     if (!lista_telas.Contains(10))
     {
         FrmContasPagarAtrazadas form = new FrmContasPagarAtrazadas();
         form.MdiParent = this;
         lista_telas.Add(10);
         form.Show();
     }
 }
コード例 #2
0
ファイル: FrmPrincipal.cs プロジェクト: guislim/SACG
 private void toolStripButton7_Click(object sender, EventArgs e)
 {
     if (!lista_telas.Contains(10))
     {
         FrmContasPagarAtrazadas form = new FrmContasPagarAtrazadas();
         form.MdiParent = this;
         lista_telas.Add(10);
         form.Show();
     }
 }
コード例 #3
0
ファイル: Verificacoes.cs プロジェクト: guislim/SACG
        public static bool verifica_Contas_pagar_atrazadas(FrmPrincipal principal)
        {
            string data_atual = GeraDataMysql.Gerar(DateTime.Now);
               string query = "select * from parcela_pagar as p inner join conta_pagar as c on p.id_conta_pagar = c.id_conta_pagar inner join fornecedor as f on f.id_fornecedor = c.id_fornecedor ";
               query += "inner join pessoa_juridica as j on f.id_pessoa_juridica = j.id_pessoa_juridica ";
               query += "where p.data_vencimento <='"+data_atual+"' and c.status=1 and p.situacao='ABERTA'";
               MySqlConnection con = new MySqlConnection(Config.Conexao);
               MySqlCommand cmd = new MySqlCommand(query, con);
               con.Open();
               MySqlDataReader reader = cmd.ExecuteReader();
               if (!reader.HasRows)
               {
               con.Close();
               return false;
               }
               else
               {
               List<ParcelaPagar> lista = new List<ParcelaPagar>();

               while (reader.Read())
               {
                  ContaPagar c = new ContaPagar();
                  ParcelaPagar p = new ParcelaPagar();
                  Fornecedor f = new Fornecedor();
                  f.razao_social = reader["razao_social"].ToString();
                  c.credor = reader["credor"].ToString();
                  c.data_vencimento = DateTime.Parse(reader["data_vencimento"].ToString());
                  c.valor_total = Convert.ToDecimal(reader["valor_total"].ToString());
                  c.valor_pago = Convert.ToDecimal(reader["valor_pago"].ToString());
                  c.situacao="ABERTA";
                   c.id_conta_pagar = Convert.ToInt32(reader["id_conta_pagar"].ToString());
                  c.data_emissao= DateTime.Parse(reader["data_emissao"].ToString());
                  c.documento= reader["documento"].ToString();
                  c.entrada= Convert.ToDecimal(reader["entrada"].ToString());
                  p.valor = Convert.ToDecimal(reader["valor"].ToString());
                  p.data_vencimento = DateTime.Parse(reader["data_vencimento"].ToString());
                  p.conta_pagar=c;
                  c.fornecedor = f;
                  lista.Add(p);
               }
               con.Close();
               FrmContasPagarAtrazadas frm = new FrmContasPagarAtrazadas(lista);
               frm.MdiParent= principal;
               frm.Activate();
               frm.Show();
               return true;
               }
        }