Exemplo n.º 1
0
        //private void liberarObjetos(object obj)
        //{
        //    try
        //    {
        //        System.Runtime.InteropServices.Marshal.ReleaseComObject(obj);
        //        obj = null;
        //    }
        //    catch (Exception ex)
        //    {
        //        obj = null;
        //        MessageBox.Show("Ocorreu um erro durante a liberação do objeto " + ex.ToString());
        //    }
        //    finally
        //    {
        //        GC.Collect();
        //    }
        //}



        #endregion

        #region METODOS
        private void inicio(DateTime data)
        {
            #region CAMPOS
            DataGridViewTextBoxColumn campo0 = new DataGridViewTextBoxColumn();
            campo0.Name             = "Responsavel";
            campo0.HeaderText       = "RESPONSÁVEL";
            campo0.DataPropertyName = "RESPONSAVEL";
            campo0.Width            = 130;

            DataGridViewTextBoxColumn campo1 = new DataGridViewTextBoxColumn();
            campo1.Name                       = "MINUTOS";
            campo1.HeaderText                 = "MINUTOS";
            campo1.DataPropertyName           = "MINUTOS";
            campo1.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;

            DataGridViewTextBoxColumn campo2 = new DataGridViewTextBoxColumn();
            campo2.Name                       = "DISPONIVEL";
            campo2.HeaderText                 = "DISPONÍVEL";
            campo2.DataPropertyName           = "DISPONIVEL";
            campo2.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;

            DataGridViewTextBoxColumn campo3 = new DataGridViewTextBoxColumn();
            campo3.Name                       = "Comprometido";
            campo3.HeaderText                 = "COMPROMETIDO";
            campo3.DataPropertyName           = "COMPROMETIDO";
            campo3.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;

            DataGridViewTextBoxColumn campo4 = new DataGridViewTextBoxColumn();
            campo4.Name                       = "Reservado";
            campo4.HeaderText                 = "RESERVADO";
            campo4.DataPropertyName           = "RESERVA";
            campo4.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            #endregion

            cCapacity cc = new cCapacity();
            using (DataSet ds = cc.retorna_capacity_dia(data))
            {
                using (DataTable dt = ds.Tables["Capacity"])
                {
                    dgvCapacity.Columns.Clear();
                    dgvCapacity.AutoGenerateColumns = false;
                    dgvCapacity.Columns.AddRange(new DataGridViewColumn[] { campo0, campo1, campo2, campo3, campo4 });
                    dgvCapacity.DataSource = dt;

                    dgvCapacity.Columns["RESPONSAVEL"].Frozen = true;

                    cDGV modelo = new cDGV();
                    dgvCapacity = modelo.Grade(dgvCapacity);

                    #region GRAFICO
                    chtGrafico.DataSource = null;
                    chtGrafico.DataBind();

                    chtGrafico.DataSource = dt;
                    chtGrafico.Series["Minutos"].XValueMember       = Convert.ToString(dt.Columns[2].ToString());
                    chtGrafico.Series["Minutos"].YValueMembers      = Convert.ToString(dt.Columns[3].ToString());
                    chtGrafico.Series["Disponivel"].XValueMember    = Convert.ToString(dt.Columns[2].ToString());
                    chtGrafico.Series["Disponivel"].YValueMembers   = Convert.ToString(dt.Columns[4].ToString());
                    chtGrafico.Series["Comprometido"].XValueMember  = Convert.ToString(dt.Columns[2].ToString());
                    chtGrafico.Series["Comprometido"].YValueMembers = Convert.ToString(dt.Columns[5].ToString());
                    chtGrafico.Series["Reservado"].XValueMember     = Convert.ToString(dt.Columns[2].ToString());
                    chtGrafico.Series["Reservado"].YValueMembers    = Convert.ToString(dt.Columns[6].ToString());

                    chtGrafico.DataBind();
                    #endregion
                }
            }
        }
Exemplo n.º 2
0
        private void mostra_registros()
        {
            try
            {
                //retorna dados do evento
                cMaskara cm          = new cMaskara();
                int      retidevento = cm.retorna_id_tipo_evento(tvwDemanda.SelectedNode.Text);
                if (retidevento > 0)
                {
                    cEvento ce = new cEvento();
                    using (DataSet ds = ce.retorna_descricao_evento(NDemanda, int.Parse(retidevento.ToString())))
                    {
                        foreach (DataRow item in ds.Tables["RetDescEvento"].Rows)
                        {
                            txtinfProduto.Text  = item["PRODUTO"].ToString();
                            txtinfCliente.Text  = item["CLIENTE"].ToString();
                            txtinfFundo.Text    = item["RAZAO_SOCIAL"].ToString();
                            txtinfSiglaSAC.Text = item["SIGLA_SAC"].ToString();
                            txtinfSiglaFY.Text  = item["SIGLA_FY"].ToString();

                            if (item["CNPJ_CPF"].ToString().Length == 14)
                            {
                                txtinfCNPJCPF.Text = string.Concat(item["CNPJ_CPF"].ToString().Substring(0, 2), ".",
                                                                   item["CNPJ_CPF"].ToString().Substring(2, 3), ".",
                                                                   item["CNPJ_CPF"].ToString().Substring(5, 3), "/",
                                                                   item["CNPJ_CPF"].ToString().Substring(8, 4), "-",
                                                                   item["CNPJ_CPF"].ToString().Substring(12, 2)).Replace(",", ".");
                            }
                            else
                            {
                                txtinfCNPJCPF.Text = string.Concat(item["CNPJ_CPF"].ToString().Substring(0, 3), ".",
                                                                   item["CNPJ_CPF"].ToString().Substring(3, 3), ".",
                                                                   item["CNPJ_CPF"].ToString().Substring(6, 3), "-",
                                                                   item["CNPJ_CPF"].ToString().Substring(9, 2)).Replace(",", ".");
                            }

                            txtDtDemanda.Text = item["DTDEMANDA"].ToString().Substring(0, 10);
                            txtDtCota.Text    = item["DTCOTA"].ToString().Substring(0, 10);
                            txtStatus.Text    = item["STATUS"].ToString();
                            //txtApCad.Text = item["USER_CAD"].ToString();
                            //txtApCadData.Text = item["DT_USER_CAD"].ToString();
                            //txtApGov.Text = item["GOV_CAD"].ToString();
                            //txtApGovData.Text = item["DT_GOV_CAD"].ToString();
                            //txtApCap.Text = item["CAPACITY_CAD"].ToString();
                            //txtApCapData.Text = item["DT_CAPACITY_CAD"].ToString();
                            //txtApRTO.Text = item["RTO_CAD"].ToString();
                            //txtApRTOData.Text = item["DT_RTO_CAD"].ToString();
                        }

                        if (ds.Tables["RetDescEvento"].Rows.Count > 0)
                        {
                            previa_Cronograma pc = new previa_Cronograma();
                            using (DataTable dt = pc.retorna_cronograma(NDemanda, int.Parse(retidevento.ToString())))
                            {
                                #region CAMPOS
                                DataGridViewTextBoxColumn campo0 = new DataGridViewTextBoxColumn();
                                campo0.Name             = "Atividade";
                                campo0.HeaderText       = "Atividade";
                                campo0.DataPropertyName = "ATIVIDADE";
                                campo0.Width            = 200;

                                DataGridViewTextBoxColumn campo1 = new DataGridViewTextBoxColumn();
                                campo1.Name             = "Esforço";
                                campo1.HeaderText       = "Esforço";
                                campo1.DataPropertyName = "ESFORCO_PLAN";
                                campo1.Width            = 100;

                                DataGridViewTextBoxColumn campo2 = new DataGridViewTextBoxColumn();
                                campo2.Name             = "Data Execução";
                                campo2.HeaderText       = "Data Execução";
                                campo2.DataPropertyName = "DT_EXEC_PLAN";
                                campo2.Width            = 100;

                                DataGridViewTextBoxColumn campo3 = new DataGridViewTextBoxColumn();
                                campo3.Name             = "Responsavel";
                                campo3.HeaderText       = "Responsável";
                                campo3.DataPropertyName = "RESPONSAVEL";
                                campo3.Width            = 100;

                                dgvCronograma.Columns.Clear();
                                dgvCronograma.AutoGenerateColumns = false;
                                dgvCronograma.Columns.AddRange(new DataGridViewColumn[] { campo0, campo1, campo2, campo3 });
                                dgvCronograma.DataSource = dt;
                                dt.Dispose();

                                cDGV modelo = new cDGV();
                                dgvCronograma = modelo.Grade(dgvCronograma);

                                #region RETORNA TOTAL DE MINUTOS CONFORME O RESPONSAVEL
                                decimal min_passivo       = 0;
                                decimal min_processamento = 0;
                                decimal min_suporte       = 0;

                                foreach (DataGridViewRow item in dgvCronograma.Rows)
                                {
                                    if ((string)item.Cells[3].Value == "Passivo")
                                    {
                                        min_passivo = min_passivo + Convert.ToDecimal(item.Cells[1].Value);
                                    }
                                    if ((string)item.Cells[3].Value == "Processamento")
                                    {
                                        min_processamento = min_processamento + Convert.ToDecimal(item.Cells[1].Value);
                                    }
                                    if ((string)item.Cells[3].Value == "Suporte")
                                    {
                                        min_suporte = min_suporte + Convert.ToDecimal(item.Cells[1].Value);
                                    }
                                }

                                txtPassivo.Text       = Convert.ToString(min_passivo);
                                txtProcessamento.Text = Convert.ToString(min_processamento);
                                txtSuporte.Text       = Convert.ToString(min_suporte);
                                #endregion


                                #endregion
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 3
0
        private void inicio()
        {
            try
            {
                cRelatorio report = new cRelatorio();
                using (DataTable dt = report.report_periodo())
                {
                    #region COLUNAS
                    //DataGridViewTextBoxColumn campo0 = new DataGridViewTextBoxColumn();
                    //campo0.Name = "ID";
                    //campo0.HeaderText = "ID";
                    //campo0.Width = 100;
                    //campo0.DataPropertyName = "ID";

                    DataGridViewTextBoxColumn campo1 = new DataGridViewTextBoxColumn();
                    campo1.Name             = "DATA_DEMANDA";
                    campo1.HeaderText       = "Data da Demanda";
                    campo1.Width            = 100;
                    campo1.DataPropertyName = "DATA_DEMANDA";

                    DataGridViewTextBoxColumn campo2 = new DataGridViewTextBoxColumn();
                    campo2.Name             = "REGISTRADO_POR";
                    campo2.HeaderText       = "Registrado Por";
                    campo2.Width            = 100;
                    campo2.DataPropertyName = "REGISTRADO_POR";

                    DataGridViewTextBoxColumn campo3 = new DataGridViewTextBoxColumn();
                    campo3.Name             = "SETOR";
                    campo3.HeaderText       = "Setor";
                    campo2.Width            = 100;
                    campo3.DataPropertyName = "SETOR";

                    DataGridViewTextBoxColumn campo4 = new DataGridViewTextBoxColumn();
                    campo4.Name             = "CLIENTE";
                    campo4.HeaderText       = "Cliente";
                    campo4.Width            = 100;
                    campo4.DataPropertyName = "CLIENTE";

                    DataGridViewTextBoxColumn campo5 = new DataGridViewTextBoxColumn();
                    campo5.Name             = "TIPO_EVENTO";
                    campo5.HeaderText       = "Tipo de Evento";
                    campo5.Width            = 100;
                    campo5.DataPropertyName = "TIPO_EVENTO";

                    DataGridViewTextBoxColumn campo6 = new DataGridViewTextBoxColumn();
                    campo6.Name             = "STATUS";
                    campo6.HeaderText       = "Status";
                    campo6.Width            = 100;
                    campo6.DataPropertyName = "STATUS";

                    DataGridViewTextBoxColumn campo7 = new DataGridViewTextBoxColumn();
                    campo7.Name             = "SIGLA_SAC";
                    campo7.HeaderText       = "Sigla SAC";
                    campo7.Width            = 100;
                    campo7.DataPropertyName = "SIGLA_SAC";

                    DataGridViewTextBoxColumn campo8 = new DataGridViewTextBoxColumn();
                    campo8.Name             = "SIGLA_FY";
                    campo8.HeaderText       = "Sigla FY";
                    campo8.Width            = 100;
                    campo8.DataPropertyName = "SIGLA_FY";

                    DataGridViewTextBoxColumn campo9 = new DataGridViewTextBoxColumn();
                    campo9.Name             = "CNPJ_CPF";
                    campo9.HeaderText       = "CNPJ/CPF";
                    campo9.Width            = 100;
                    campo9.DataPropertyName = "CNPJ_CPF";

                    DataGridViewTextBoxColumn campo10 = new DataGridViewTextBoxColumn();
                    campo10.Name             = "RAZAO_SOCIAL";
                    campo10.HeaderText       = "Razão Social";
                    campo10.Width            = 100;
                    campo10.DataPropertyName = "RAZAO_SOCIAL";

                    DataGridViewTextBoxColumn campo11 = new DataGridViewTextBoxColumn();
                    campo11.Name             = "DATA_COTA";
                    campo11.HeaderText       = "Data da Cota";
                    campo11.Width            = 100;
                    campo11.DataPropertyName = "DATA_COTA";

                    DataGridViewTextBoxColumn campo12 = new DataGridViewTextBoxColumn();
                    campo12.Name             = "COMISSAO";
                    campo12.HeaderText       = "Comissão";
                    campo12.Width            = 100;
                    campo12.DataPropertyName = "COMISSAO";

                    DataGridViewTextBoxColumn campo13 = new DataGridViewTextBoxColumn();
                    campo13.Name             = "TIPO";
                    campo13.HeaderText       = "Tipo";
                    campo13.Width            = 100;
                    campo13.DataPropertyName = "TIPO";

                    DataGridViewTextBoxColumn campo14 = new DataGridViewTextBoxColumn();
                    campo14.Name             = "PRODUTO";
                    campo14.HeaderText       = "Produto";
                    campo14.Width            = 100;
                    campo14.DataPropertyName = "PRODUTO";

                    //DataGridViewTextBoxColumn campo15 = new DataGridViewTextBoxColumn();
                    DataGridViewCheckBoxColumn campo15 = new DataGridViewCheckBoxColumn();
                    campo15.Name             = "PARECER_RTO";
                    campo15.HeaderText       = "Parecer RTO";
                    campo15.Width            = 100;
                    campo15.DataPropertyName = "PARECER_RTO";

                    //DataGridViewTextBoxColumn campo16 = new DataGridViewTextBoxColumn();
                    DataGridViewCheckBoxColumn campo16 = new DataGridViewCheckBoxColumn();
                    campo16.Name             = "EXTRAPAUTA";
                    campo16.HeaderText       = "Extrapauta";
                    campo16.Width            = 100;
                    campo16.DataPropertyName = "EXTRAPAUTA";

                    //DataGridViewTextBoxColumn campo17 = new DataGridViewTextBoxColumn();
                    DataGridViewCheckBoxColumn campo17 = new DataGridViewCheckBoxColumn();
                    campo17.Name             = "EXCECAO";
                    campo17.HeaderText       = "Exceção";
                    campo17.Width            = 100;
                    campo17.DataPropertyName = "EXCECAO";

                    dgvReportPeriodo.Columns.Clear();
                    dgvReportPeriodo.AutoGenerateColumns = false;
                    dgvReportPeriodo.SelectionMode       = DataGridViewSelectionMode.FullRowSelect;
                    dgvReportPeriodo.Columns.AddRange(new DataGridViewColumn[] { campo1, campo2, campo3, campo4, campo5, campo6, campo7, campo8, campo9, campo10, campo11, campo12, campo13, campo14, campo15, campo16, campo17 });

                    #endregion

                    tslblStatus.Text            = string.Concat("Total de: ", dt.Rows.Count, " registro(s) localizado(s)");
                    dgvReportPeriodo.DataSource = dt;
                    cDGV modelo = new cDGV();
                    dgvReportPeriodo = modelo.Grade(dgvReportPeriodo);

                    if (dt.Rows.Count == 0)
                    {
                        tsbtnExportar.Enabled = false;
                    }
                    else
                    {
                        tsbtnExportar.Enabled = true;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 4
0
        private void inicio()
        {
            try
            {
                this.Cursor = Cursors.AppStarting;
                cRelatorio report = new cRelatorio();
                using (DataTable dt = report.report_atividade(dtIni.Value, dtFim.Value))
                {
                    #region COLUNAS
                    DataGridViewTextBoxColumn campo0 = new DataGridViewTextBoxColumn();
                    campo0.Name             = "ID";
                    campo0.HeaderText       = "ID Cronograma";
                    campo0.Width            = 100;
                    campo0.DataPropertyName = "ID_CRONOGRAMA";

                    DataGridViewTextBoxColumn campo1 = new DataGridViewTextBoxColumn();
                    campo1.Name             = "DATA_EXECUCAO_PLANEJADO";
                    campo1.HeaderText       = "Data Exec Plan";
                    campo1.Width            = 100;
                    campo1.DataPropertyName = "DATA_EXECUCAO_PLANEJADO";

                    DataGridViewTextBoxColumn campo2 = new DataGridViewTextBoxColumn();
                    campo2.Name             = "ESFORCO_PLANEJADO";
                    campo2.HeaderText       = "Esforço Planejado";
                    campo2.Width            = 100;
                    campo2.DataPropertyName = "ESFORCO_PLANEJADO";

                    DataGridViewTextBoxColumn campo3 = new DataGridViewTextBoxColumn();
                    campo3.Name             = "EVENTO";
                    campo3.HeaderText       = "Evento";
                    campo2.Width            = 100;
                    campo3.DataPropertyName = "EVENTO";

                    DataGridViewTextBoxColumn campo4 = new DataGridViewTextBoxColumn();
                    campo4.Name             = "CLIENTE";
                    campo4.HeaderText       = "Cliente";
                    campo4.Width            = 100;
                    campo4.DataPropertyName = "CLIENTE";

                    DataGridViewTextBoxColumn campo5 = new DataGridViewTextBoxColumn();
                    campo5.Name             = "INTRAG";
                    campo5.HeaderText       = "Intrag";
                    campo5.Width            = 100;
                    campo5.DataPropertyName = "INTRAG";

                    DataGridViewTextBoxColumn campo6 = new DataGridViewTextBoxColumn();
                    campo6.Name             = "SIGLA_SAC";
                    campo6.HeaderText       = "Sigla SAC";
                    campo6.Width            = 100;
                    campo6.DataPropertyName = "SIGLA_SAC";

                    DataGridViewTextBoxColumn campo7 = new DataGridViewTextBoxColumn();
                    campo7.Name             = "SIGLA_FY";
                    campo7.HeaderText       = "Sigla FY";
                    campo7.Width            = 100;
                    campo7.DataPropertyName = "SIGLA_FY";

                    DataGridViewTextBoxColumn campo8 = new DataGridViewTextBoxColumn();
                    campo8.Name             = "CNPJ_CPF";
                    campo8.HeaderText       = "CNPJ/CPF";
                    campo8.Width            = 100;
                    campo8.DataPropertyName = "CNPJ_CPF";

                    DataGridViewTextBoxColumn campo9 = new DataGridViewTextBoxColumn();
                    campo9.Name             = "DATA_DEMANDA";
                    campo9.HeaderText       = "Data Demanda";
                    campo9.Width            = 100;
                    campo9.DataPropertyName = "DATA_DEMANDA";

                    DataGridViewTextBoxColumn campo10 = new DataGridViewTextBoxColumn();
                    campo10.Name             = "RESPONSAVEL";
                    campo10.HeaderText       = "Responsável";
                    campo10.Width            = 100;
                    campo10.DataPropertyName = "RESPONSAVEL";

                    DataGridViewTextBoxColumn campo11 = new DataGridViewTextBoxColumn();
                    campo11.Name             = "RAZAO_SOCIAL";
                    campo11.HeaderText       = "Razão Social";
                    campo11.Width            = 100;
                    campo11.DataPropertyName = "RAZAO_SOCIAL";

                    DataGridViewTextBoxColumn campo12 = new DataGridViewTextBoxColumn();
                    campo12.Name             = "ID_DEMANDA";
                    campo12.HeaderText       = "ID Demanda";
                    campo12.Width            = 100;
                    campo12.DataPropertyName = "ID_DEMANDA";

                    DataGridViewTextBoxColumn campo13 = new DataGridViewTextBoxColumn();
                    campo13.Name             = "ATIVIDADE";
                    campo13.HeaderText       = "Atividade";
                    campo13.Width            = 100;
                    campo13.DataPropertyName = "ATIVIDADE";

                    DataGridViewTextBoxColumn campo14 = new DataGridViewTextBoxColumn();
                    campo14.Name             = "AVALIACAO";
                    campo14.HeaderText       = "Avaliação";
                    campo14.Width            = 100;
                    campo14.DataPropertyName = "AVALIACAO";

                    DataGridViewTextBoxColumn campo15 = new DataGridViewTextBoxColumn();
                    campo15.Name             = "STATUS";
                    campo15.HeaderText       = "Status";
                    campo15.Width            = 100;
                    campo15.DataPropertyName = "STATUS";

                    dgvReportAtiv.Columns.Clear();
                    dgvReportAtiv.AutoGenerateColumns = false;
                    dgvReportAtiv.SelectionMode       = DataGridViewSelectionMode.FullRowSelect;
                    dgvReportAtiv.Columns.AddRange(new DataGridViewColumn[] { campo0, campo1, campo2, campo3, campo4, campo5, campo6, campo7, campo8, campo9, campo10, campo11, campo12, campo13, campo14, campo15 });

                    //dgvPonto.Columns["DT"].Frozen = true;
                    //dgvPonto.Columns["DT"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter;
                    //dgvPonto.Columns["HRINICIO"].DefaultCellStyle.Format = "hh:mm";
                    //dgvPonto.Columns["HRINICIO"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter;
                    //dgvPonto.Columns["INTERVALO"].DefaultCellStyle.Format = "hh:mm";
                    //dgvPonto.Columns["INTERVALO"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter;
                    //dgvPonto.Columns["HR_FIM"].DefaultCellStyle.Format = "hh:mm";
                    //dgvPonto.Columns["HR_FIM"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter;
                    //dgvPonto.Columns["TOTAL"].DefaultCellStyle.Format = "hh:mm";
                    //dgvPonto.Columns["TOTAL"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter;
                    //dgvPonto.Columns["HR_CUMPRIR"].DefaultCellStyle.Format = "hh:mm";
                    //dgvPonto.Columns["HR_CUMPRIR"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter;
                    //dgvPonto.Columns["HR_EXTRAS"].DefaultCellStyle.Format = "hh:mm";
                    //dgvPonto.Columns["HR_EXTRAS"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter;
                    //dgvPonto.Columns["HR_PEND"].DefaultCellStyle.Format = "hh:mm";
                    //dgvPonto.Columns["HR_PEND"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter;
                    #endregion

                    tslblStatus.Text         = string.Concat("Total de: ", dt.Rows.Count, " registro(s) localizado(s)");
                    dgvReportAtiv.DataSource = dt;
                    cDGV modelo = new cDGV();
                    dgvReportAtiv = modelo.Grade(dgvReportAtiv);

                    if (dt.Rows.Count == 0)
                    {
                        tsbtnExportar.Enabled = false;
                    }
                    else
                    {
                        tsbtnExportar.Enabled = true;
                    }
                }
                this.Cursor = Cursors.Arrow;
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Arrow;
                throw ex;
            }
        }