Esempio n. 1
0
        private void GetDropPecas()
        {
            PRODUTOSProvider   PRODUTOSP    = new PRODUTOSProvider();
            PRODUTOSCollection PRODUTOSColl = new PRODUTOSCollection();

            RowRelatorio.Clear();
            RowRelatorio.Add(new RowsFiltro("FLAGINATIVO", "System.String", "<>", "S"));
            PRODUTOSColl = PRODUTOSP.ReadCollectionByParameter(RowRelatorio, "NOMEPRODUTO");

            cbProduto.DisplayMember = "NOMEPRODUTO";
            cbProduto.ValueMember   = "IDPRODUTO";

            PRODUTOSEntity PRODUTOSTy = new PRODUTOSEntity();

            PRODUTOSTy.NOMEPRODUTO = ConfigMessage.Default.MsgDrop;
            PRODUTOSTy.IDPRODUTO   = -1;
            PRODUTOSColl.Add(PRODUTOSTy);

            Phydeaux.Utilities.DynamicComparer <PRODUTOSEntity> comparer = new Phydeaux.Utilities.DynamicComparer <PRODUTOSEntity>(cbProduto.DisplayMember);

            PRODUTOSColl.Sort(comparer.Comparer);
            cbProduto.DataSource = PRODUTOSColl;

            cbProduto.SelectedIndex = 0;
        }
Esempio n. 2
0
        private PRODUTOSEntity PesquisaCodBarra(string Pesquisa)
        {
            PRODUTOSEntity PRODUTOSPESBARRATY = new PRODUTOSEntity();

            try
            {
                RowRelatorio.Clear();
                RowRelatorio.Add(new RowsFiltro("CODBARRA", "System.String", "=", Pesquisa));

                PRODUTOSCollection PRODUTOSPESCODBARRACOLL = new PRODUTOSCollection();
                PRODUTOSPESCODBARRACOLL = PRODUTOSP.ReadCollectionByParameter(RowRelatorio);

                if (PRODUTOSPESCODBARRACOLL.Count > 0)
                {
                    PRODUTOSPESBARRATY = PRODUTOSP.Read(PRODUTOSPESCODBARRACOLL[0].IDPRODUTO);
                }
                else
                {
                    PRODUTOSPESBARRATY = null;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro técnico: " + ex.Message);
            }

            return(PRODUTOSPESBARRATY);
        }
Esempio n. 3
0
        private void txtDescProduto_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                PesquisaProduto();
            }

            if ((Control.ModifierKeys == Keys.Control) &&
                (e.KeyCode == Keys.E))
            {
                using (FrmSearchProduto frm = new FrmSearchProduto())
                {
                    frm.ShowDialog();
                    var result = frm.Result;

                    if (result > 0)
                    {
                        PRODUTOSTy          = PRODUTOSP.Read(result);
                        txtDescProduto.Text = PRODUTOSTy.NOMEPRODUTO;
                        txtValorUnit.Text   = Convert.ToDecimal(PRODUTOSTy.VALORVENDA1).ToString("n2");
                        txtQuant.Focus();
                        SomaTotaProduto();
                    }
                }
            }
        }
Esempio n. 4
0
        private void GetDropProdutos()
        {
            CreaterCursor Cr = new CreaterCursor();

            this.Cursor = Cr.CreateCursor(Cr.btmap, 0, 0);

            try
            {
                PRODUTOSProvider PRODUTOSP = new PRODUTOSProvider();
                PRODUTOSColl = PRODUTOSP.ReadCollectionByParameter(null, "NOMEPRODUTO");

                cbProduto.DisplayMember = "NOMEPRODUTO";
                cbProduto.ValueMember   = "IDPRODUTO";

                PRODUTOSEntity PRODUTOSTy = new PRODUTOSEntity();
                PRODUTOSTy.NOMEPRODUTO = ConfigMessage.Default.MsgDrop;
                PRODUTOSTy.IDPRODUTO   = -1;
                PRODUTOSColl.Add(PRODUTOSTy);

                Phydeaux.Utilities.DynamicComparer <PRODUTOSEntity> comparer = new Phydeaux.Utilities.DynamicComparer <PRODUTOSEntity>(cbProduto.DisplayMember);

                PRODUTOSColl.Sort(comparer.Comparer);
                cbProduto.DataSource = PRODUTOSColl;

                cbProduto.SelectedIndex = 0;

                this.Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Default;
                MessageBox.Show("Erro técnico: " + ex.Message);
            }
        }
Esempio n. 5
0
        private void GetProdutoLote()
        {
            try
            {
                RowRelatorio.Clear();

                LIS_ESTOQUELOTECollection LIS_ESTOQUELOTEColl_2 = new LIS_ESTOQUELOTECollection();
                LIS_ESTOQUELOTEColl_2 = LIS_ESTOQUELOTEP.ReadCollectionByParameter(RowRelatorio, "DATA");

                ProdutoColl.Clear();
                foreach (var item in LIS_ESTOQUELOTEColl_2)
                {
                    PRODUTOSEntity PRODUTOSTy = new PRODUTOSEntity();
                    PRODUTOSTy.IDPRODUTO   = Convert.ToInt32(item.IDPRODUTO);
                    PRODUTOSTy.NOMEPRODUTO = item.NOMEPRODUTO;
                    ProdutoColl.Add(PRODUTOSTy);
                }

                //Remove Produto Repetido
                PRODUTOSCollection PRODUTOSColl_2 = new PRODUTOSCollection();
                foreach (PRODUTOSEntity item in ProdutoColl)
                {
                    if (PRODUTOSColl_2.Find(delegate(PRODUTOSEntity item2) { return(item2.IDPRODUTO == item.IDPRODUTO); }) == null)
                    {
                        PRODUTOSColl_2.Add(item);
                    }
                }
                ProdutoColl = PRODUTOSColl_2;
                GetDropProduto();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro técnico: " + ex.Message);
            }
        }
Esempio n. 6
0
        private PRODUTOSEntity BuscaProduto(string CODPRODUTOFORNECEDOR)
        {
            PRODUTOSEntity result = new PRODUTOSEntity();

            try
            {
                RowRelatorio.Clear();
                RowRelatorio.Add(new RowsFiltro("CODPRODUTOFORNECEDOR", "System.String", "=", CODPRODUTOFORNECEDOR.ToString()));

                LIS_PRODUTOSCollection LIS_PRODUTOSColl = new LIS_PRODUTOSCollection();
                LIS_PRODUTOSProvider   LIS_PRODUTOSP    = new LIS_PRODUTOSProvider();

                LIS_PRODUTOSColl = LIS_PRODUTOSP.ReadCollectionByParameter(RowRelatorio);

                if (LIS_PRODUTOSColl.Count > 0)
                {
                    result = PRODUTOSP.Read(Convert.ToInt32(LIS_PRODUTOSColl[0].IDPRODUTO));
                }


                return(result);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro técnico: " + ex.Message);
                return(result);
            }
        }
Esempio n. 7
0
 private void cbProduto_SelectedValueChanged(object sender, EventArgs e)
 {
     if (cbProduto.SelectedIndex > 0)
     {
         PRODUTOSEntity PRODUTOS_EstoqTy = new PRODUTOSEntity();
         PRODUTOS_EstoqTy = PRODUTOSP.Read(Convert.ToInt32(cbProduto.SelectedValue));
         decimal ValorVenda = Convert.ToDecimal(PRODUTOS_EstoqTy.VALORVENDA1);
         txtValorUnitProd.Text = ValorVenda.ToString("n2");
         SomaProduto();
     }
 }
Esempio n. 8
0
        private void PesquisaProduto(string IDPRODUTO)
        {
            PRODUTOSTy = null;
            if (chkPesqCodBarra.Checked)
            {
                PRODUTOSTy = PesquisaCodBarra(cbProduto.Text);
            }
            else if (chkCodRef.Checked)
            {
                PRODUTOSTy = PesquisaCodReferencia(cbProduto.Text);
            }
            else
            {
                if (ValidacoesLibrary.ValidaTipoInt32(cbProduto.Text))
                {
                    PRODUTOSTy = PRODUTOSP.Read(Convert.ToInt32(IDPRODUTO));
                    if (PRODUTOSTy != null)
                    {
                        cbProduto.SelectedValue = PRODUTOSTy.IDPRODUTO;
                    }
                }
            }

            if (PRODUTOSTy == null)
            {
                cbProduto.Focus();
                DialogResult dr = MessageBox.Show("Código inválido, deseja efetuar a pesquisa?",
                                                  ConfigSistema1.Default.NameSytem, MessageBoxButtons.YesNo);

                if (dr == DialogResult.Yes)
                {
                    using (FrmSearchProduto frm = new FrmSearchProduto())
                    {
                        frm.ShowDialog();
                        var result = frm.Result;

                        if (result > 0)
                        {
                            PRODUTOSTy = PRODUTOSP.Read(result);
                            cbProduto.SelectedValue = PRODUTOSTy.IDPRODUTO;
                            LocalizarProdutoPedido(PRODUTOSTy.IDPRODUTO);
                        }
                    }
                }
            }
            else
            {
                PRODUTOSTy = PRODUTOSP.Read(PRODUTOSTy.IDPRODUTO);
                cbProduto.SelectedValue = PRODUTOSTy.IDPRODUTO;
                LocalizarProdutoPedido(PRODUTOSTy.IDPRODUTO);
            }
        }
Esempio n. 9
0
        private void SomaComposiscao()
        {
            decimal result = 0;

            foreach (LIS_COMPOSPRODUTOEntity item in LIS_COMPOSPRODUTOColl)
            {
                //Obtem o valor de venda do produto
                PRODUTOSProvider PRODUTOSP  = new PRODUTOSProvider();
                PRODUTOSEntity   PRODUTOStY = PRODUTOSP.Read(Convert.ToInt32(item.IDPRODUTO));

                result += Convert.ToDecimal(item.QUANTIDADE * PRODUTOStY.VALORVENDA1);
            }

            txtValorTotal.Text = result.ToString("n2");
        }
Esempio n. 10
0
        private void cbProduto_SelectedValueChanged(object sender, EventArgs e)
        {
            if (cbProduto.SelectedIndex > 0)
            {
                PRODUTOSEntity   PRODUTOSTY = new PRODUTOSEntity();
                PRODUTOSProvider PRODUTOSP  = new PRODUTOSProvider();
                PRODUTOSTY = PRODUTOSP.Read(Convert.ToInt32(cbProduto.SelectedValue));

                if (PRODUTOSTY != null)
                {
                    txtValor.Text = Convert.ToInt32(PRODUTOSTY.VALORVENDA1).ToString("n2");
                    // cbRetorno.SelectedIndex = PRODUTOSTY.RETORNO == "S" ? 0 : 1;
                }
                else
                {
                    txtValor.Text = "0,00";
                }
            }
        }
Esempio n. 11
0
        private void PesquisaProduto()
        {
            PRODUTOSTy = null;
            PRODUTOSTy = PesquisaCodBarra(txtDescProduto.Text);


            if (PRODUTOSTy == null)
            {
                DialogResult dr = MessageBox.Show("Código de Barra inválido, deseja efetuar a pesquisa?",
                                                  ConfigSistema1.Default.NameSytem, MessageBoxButtons.YesNo);

                if (dr == DialogResult.Yes)
                {
                    using (FrmSearchProduto frm = new FrmSearchProduto())
                    {
                        frm.ShowDialog();
                        var result = frm.Result;

                        if (result > 0)
                        {
                            PRODUTOSTy          = PRODUTOSP.Read(result);
                            txtDescProduto.Text = PRODUTOSTy.NOMEPRODUTO;
                            txtValorUnit.Text   = Convert.ToDecimal(PRODUTOSTy.VALORVENDA1).ToString("n2");
                            txtQuant.Focus();
                            SomaTotaProduto();
                        }
                    }
                }
            }
            else
            {
                PRODUTOSTy          = PRODUTOSP.Read(PRODUTOSTy.IDPRODUTO);
                txtDescProduto.Text = PRODUTOSTy.NOMEPRODUTO;
                txtValorUnit.Text   = Convert.ToDecimal(PRODUTOSTy.VALORVENDA1).ToString("n2");
                txtQuant.Focus();
                SomaTotaProduto();

                if (BmsSoftware.ConfigNFCe.Default.AdicionaProdutoAposLeituraCódigoBarra.Trim() == "S")
                {
                    Grava();
                }
            }
        }
Esempio n. 12
0
        private void DataGriewDados_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (DataGriewDados.Rows[e.RowIndex].Cells[e.ColumnIndex].Value != null)
                {
                    if (ValidacoesLibrary.ValidaTipoDecimal(DataGriewDados.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()))
                    {
                        string ValueCell_ESTOQUEMANUAL = DataGriewDados.Rows[e.RowIndex].Cells[2].Value.ToString().TrimEnd().ToUpper();
                        string ValueCell_VALORVENDA1   = DataGriewDados.Rows[e.RowIndex].Cells[3].Value.ToString().TrimEnd().ToUpper();
                        string ValueCell_VALORCOMPRA1  = DataGriewDados.Rows[e.RowIndex].Cells[5].Value.ToString().TrimEnd().ToUpper();

                        //Salva Dados no produto
                        PRODUTOSEntity   PRODUTOSTy = new PRODUTOSEntity();
                        PRODUTOSProvider PRODUTOSP  = new PRODUTOSProvider();
                        int CodPRoduto = Convert.ToInt32(DataGriewDados.Rows[e.RowIndex].Cells[0].Value.ToString());
                        PRODUTOSTy = PRODUTOSP.Read(CodPRoduto);
                        if (PRODUTOSTy != null)
                        {
                            PRODUTOSTy.ESTOQUEMANUAL   = Convert.ToDecimal(ValueCell_ESTOQUEMANUAL);
                            PRODUTOSTy.VALORVENDA1     = Convert.ToDecimal(ValueCell_VALORVENDA1);
                            PRODUTOSTy.VALORCUSTOFINAL = Convert.ToDecimal(ValueCell_VALORCOMPRA1);
                            PRODUTOSP.Save(PRODUTOSTy);

                            //Soma Total Venda1/Compra1
                            Decimal TotalVenda1  = Convert.ToDecimal(PRODUTOSTy.ESTOQUEMANUAL * PRODUTOSTy.VALORVENDA1);
                            Decimal TotalCompra1 = Convert.ToDecimal(PRODUTOSTy.ESTOQUEMANUAL * PRODUTOSTy.VALORCUSTOFINAL);
                            DataGriewDados.Rows[e.RowIndex].Cells[4].Value = TotalVenda1.ToString("n2");
                            DataGriewDados.Rows[e.RowIndex].Cells[6].Value = TotalCompra1.ToString("n2");
                        }
                    }
                    else
                    {
                        DataGriewDados.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = "0";
                        MessageBox.Show("Valor inválido!!");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro técnico: " + ex.Message);
            }
        }
Esempio n. 13
0
        private void GetDropProdutos()
        {
            PRODUTOSColl = PRODUTOSP.ReadCollectionByParameter(null, "NOMEPRODUTO");

            cbProduto.DisplayMember = "NOMEPRODUTO";
            cbProduto.ValueMember   = "IDPRODUTO";

            PRODUTOSEntity PRODUTOSTy = new PRODUTOSEntity();

            PRODUTOSTy.NOMEPRODUTO = ConfigMessage.Default.MsgDrop;
            PRODUTOSTy.IDPRODUTO   = -1;
            PRODUTOSColl.Add(PRODUTOSTy);

            Phydeaux.Utilities.DynamicComparer <PRODUTOSEntity> comparer = new Phydeaux.Utilities.DynamicComparer <PRODUTOSEntity>(cbProduto.DisplayMember);

            PRODUTOSColl.Sort(comparer.Comparer);
            cbProduto.DataSource = PRODUTOSColl;

            cbProduto.SelectedIndex = 0;
        }
Esempio n. 14
0
        private void GetDropProduto()
        {
            try
            {
                cbProduto.DisplayMember = "NOMEPRODUTO";
                cbProduto.ValueMember   = "IDPRODUTO";

                PRODUTOSEntity PRODUTOSTy = new PRODUTOSEntity();
                PRODUTOSTy.NOMEPRODUTO = ConfigMessage.Default.MsgDrop;
                PRODUTOSTy.IDPRODUTO   = -1;
                ProdutoColl.Add(PRODUTOSTy);

                Phydeaux.Utilities.DynamicComparer <PRODUTOSEntity> comparer = new Phydeaux.Utilities.DynamicComparer <PRODUTOSEntity>(cbProduto.DisplayMember);

                ProdutoColl.Sort(comparer.Comparer);
                cbProduto.DataSource = ProdutoColl;

                cbProduto.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro técnico: " + ex.Message);
            }
        }
Esempio n. 15
0
        private void AtualizaBD(string FileName)
        {
            StreamReader rd       = null;
            Stream       myStream = null;
            string       MsgErro  = string.Empty;

            try
            {
                //Declaro o StreamReader para o caminho onde se encontra o arquivo
                rd = new StreamReader(FileName);
                //Declaro uma string que será utilizada para receber a linha completa do arquivo
                string linha = null;
                //Declaro um array do tipo string que será utilizado para adicionar o conteudo da linha separado
                string[] linhaseparada = null;
                //realizo o while para ler o conteudo da linha

                while ((linha = rd.ReadLine()) != null)
                {
                    //com o split adiciono a string 'quebrada' dentro do array
                    linhaseparada = linha.Split(';');
                    //aqui incluo o método necessário para continuar o trabalho

                    //STA
                    if (linhaseparada[0] == "STA") //Salva Dados de Status
                    {
                        //Verifica se o Status Existe no Banco de Dados
                        if (VerificaExisteStatus(Convert.ToInt32(linhaseparada[1])))
                        {
                            MsgErro  = "STA " + linhaseparada[1];
                            STATUSTy = STATUSP.Read(Convert.ToInt32(linhaseparada[1]));
                            if (Convert.ToInt32(linhaseparada[2]) > 0)
                            {
                                STATUSTy.IDGRUPOSTATUS = Convert.ToInt32(linhaseparada[2]);
                                STATUSTy.NOME          = linhaseparada[3];
                                STATUSP.Save(STATUSTy);
                            }
                        }
                        else
                        {
                            MsgErro                = "STA " + linhaseparada[1];
                            STATUSTy.IDSTATUS      = -1;
                            STATUSTy.IDGRUPOSTATUS = Convert.ToInt32(linhaseparada[2]);
                            STATUSTy.NOME          = linhaseparada[3];
                            STATUSP.Save(STATUSTy);
                        }
                    }
                    else if (linhaseparada[0] == "UNI") //Salva Dados Unidade
                    {
                        //Verifica se a Unidade Existe no Banco de Dados
                        if (VerificaExisteUnidade(Convert.ToInt32(linhaseparada[1])))
                        {
                            MsgErro        = "UNI " + linhaseparada[1];
                            UNIDADETy      = UNIDADEP.Read(Convert.ToInt32(linhaseparada[1]));
                            UNIDADETy.NOME = linhaseparada[2];
                            UNIDADEP.Save(UNIDADETy);
                        }
                        else
                        {
                            MsgErro             = "UNI " + linhaseparada[1];
                            UNIDADETy.IDUNIDADE = -1;
                            UNIDADETy.NOME      = linhaseparada[2];
                            UNIDADEP.Save(UNIDADETy);
                        }
                    }
                    else if (linhaseparada[0] == "GSA") //Grupo Categoria de Produto
                    {
                        //Verifica se a Categoria de Produto Existe no Banco de Dados
                        if (VerificaExisteGrupoCategoria(Convert.ToInt32(linhaseparada[1])))
                        {
                            MsgErro               = "GSA " + linhaseparada[1];
                            GRUPOCATEGORIATy      = GRUPOCATEGORIAP.Read(Convert.ToInt32(linhaseparada[1]));
                            GRUPOCATEGORIATy.NOME = linhaseparada[2];
                            GRUPOCATEGORIAP.Save(GRUPOCATEGORIATy);
                        }
                        else
                        {
                            MsgErro = "GSA " + linhaseparada[1];
                            GRUPOCATEGORIATy.IDGRUPOCATEGORIA = -1;
                            GRUPOCATEGORIATy.NOME             = linhaseparada[2];
                            GRUPOCATEGORIAP.Save(GRUPOCATEGORIATy);
                        }
                    }
                    else if (linhaseparada[0] == "MAR") //Salva Dados Marca
                    {
                        //Verifica se a Marca Existe no Banco de Dados
                        if (VerificaExisteMarca(Convert.ToInt32(linhaseparada[1])))
                        {
                            MsgErro      = "MAR " + linhaseparada[1];
                            MARCATy      = MARCAP.Read(Convert.ToInt32(linhaseparada[1]));
                            MARCATy.NOME = linhaseparada[2];
                            MARCAP.Save(MARCATy);
                        }
                        else
                        {
                            MsgErro         = "MAR " + linhaseparada[1];
                            MARCATy.IDMARCA = -1;
                            MARCATy.NOME    = linhaseparada[2];
                            MARCAP.Save(MARCATy);
                        }
                    }
                    else if (linhaseparada[0] == "COR") //Salva Dados COR
                    {
                        //Verifica se a COR Existe no Banco de Dados
                        if (VerificaExisteCor(Convert.ToInt32(linhaseparada[1])))
                        {
                            MsgErro    = "COR " + linhaseparada[1];
                            CORTy      = CORP.Read(Convert.ToInt32(linhaseparada[1]));
                            CORTy.NOME = linhaseparada[2];
                            CORP.Save(CORTy);
                        }
                        else
                        {
                            MsgErro     = "COR " + linhaseparada[1];
                            CORTy.IDCOR = -1;
                            CORTy.NOME  = linhaseparada[2];
                            CORP.Save(CORTy);
                        }
                    }
                    else if (linhaseparada[0] == "AMB") //Salva Dados Ambiente
                    {
                        //Verifica se o Ambiente Existe no Banco de Dados
                        if (VerificaExisteAmbiente(Convert.ToInt32(linhaseparada[1])))
                        {
                            MsgErro         = "AMB " + linhaseparada[1];
                            AMBIENTETy      = AMBIENTEP.Read(Convert.ToInt32(linhaseparada[1]));
                            AMBIENTETy.NOME = linhaseparada[2];
                            AMBIENTEP.Save(AMBIENTETy);
                        }
                        else
                        {
                            MsgErro = "AMB " + linhaseparada[1];
                            AMBIENTETy.IDAMBIENTE = -1;
                            AMBIENTETy.NOME       = linhaseparada[2];
                            AMBIENTEP.Save(AMBIENTETy);
                        }
                    }
                    else if (linhaseparada[0] == "FUNC") //Salva Dados Funcionario
                    {
                        //Verifica se o Funcionario Existe no Banco de Dados
                        if (VerificaExisteFuncionario(Convert.ToInt32(linhaseparada[1])))
                        {
                            //Dados FUNCIONARIO
                            MsgErro                 = "FUNC " + linhaseparada[1];
                            FUNCIONARIOTy           = FUNCIONARIOP.Read(Convert.ToInt32(linhaseparada[1]));
                            FUNCIONARIOTy.NOME      = linhaseparada[2];
                            FUNCIONARIOTy.ENDERECO  = linhaseparada[3];
                            FUNCIONARIOTy.CIDADE    = linhaseparada[4];
                            FUNCIONARIOTy.UF        = linhaseparada[5];
                            FUNCIONARIOTy.CEP       = linhaseparada[6];
                            FUNCIONARIOTy.BAIRRO    = linhaseparada[7];
                            FUNCIONARIOTy.CPF       = linhaseparada[8];
                            FUNCIONARIOTy.EMAIL     = linhaseparada[9];
                            FUNCIONARIOTy.TELEFONE1 = linhaseparada[10];
                            FUNCIONARIOTy.TELEFONE2 = linhaseparada[11];
                            FUNCIONARIOTy.FUNCAO    = linhaseparada[12];
                            FUNCIONARIOP.Save(FUNCIONARIOTy);
                        }
                        else
                        {
                            MsgErro = "FUNC " + linhaseparada[1];
                            FUNCIONARIOTy.IDFUNCIONARIO = -1;
                            FUNCIONARIOTy.NOME          = linhaseparada[2];
                            FUNCIONARIOTy.ENDERECO      = linhaseparada[3];
                            FUNCIONARIOTy.CIDADE        = linhaseparada[4];
                            FUNCIONARIOTy.UF            = linhaseparada[5];
                            FUNCIONARIOTy.CEP           = linhaseparada[6];
                            FUNCIONARIOTy.BAIRRO        = linhaseparada[7];
                            FUNCIONARIOTy.CPF           = linhaseparada[8];
                            FUNCIONARIOTy.EMAIL         = linhaseparada[9];
                            FUNCIONARIOTy.TELEFONE1     = linhaseparada[10];
                            FUNCIONARIOTy.TELEFONE2     = linhaseparada[11];
                            FUNCIONARIOTy.FUNCAO        = linhaseparada[12];
                            FUNCIONARIOTy.CODSTATUS     = 10;
                            FUNCIONARIOP.Save(FUNCIONARIOTy);
                        }
                    }
                    else if (linhaseparada[0] == "PRO") //Salva Dados Produto
                    {
                        //Verifica se a Produto Existe no Banco de Dados
                        if (VerificaExisteProduto(Convert.ToInt32(linhaseparada[1])))
                        {
                            MsgErro                         = "PRO " + linhaseparada[1];
                            PRODUTOSTy                      = PRODUTOSP.Read(Convert.ToInt32(linhaseparada[1]));
                            PRODUTOSTy.NOMEPRODUTO          = linhaseparada[2];
                            PRODUTOSTy.CODPRODUTOFORNECEDOR = linhaseparada[3];
                            PRODUTOSTy.VALORVENDA1          = Convert.ToDecimal(linhaseparada[4]);

                            if (Convert.ToInt32(linhaseparada[5]) > 0)
                            {
                                PRODUTOSTy.IDUNIDADE = Convert.ToInt32(linhaseparada[5]);
                            }

                            if (Convert.ToInt32(linhaseparada[6]) > 0)
                            {
                                PRODUTOSTy.IDGRUPOCATEGORIA = Convert.ToInt32(linhaseparada[6]);
                            }

                            if (Convert.ToInt32(linhaseparada[7]) > 0)
                            {
                                PRODUTOSTy.IDSTATUS = Convert.ToInt32(linhaseparada[7]);
                            }

                            if (Convert.ToInt32(linhaseparada[8]) > 0)
                            {
                                PRODUTOSTy.IDMARCA = Convert.ToInt32(linhaseparada[8]);
                            }

                            PRODUTOSTy.FLAGINATIVO = linhaseparada[9];

                            PRODUTOSP.Save(PRODUTOSTy);
                        }
                        else
                        {
                            MsgErro = "PRO " + linhaseparada[1];
                            PRODUTOSTy.IDPRODUTO            = -1;
                            PRODUTOSTy.NOMEPRODUTO          = linhaseparada[2];
                            PRODUTOSTy.CODPRODUTOFORNECEDOR = linhaseparada[3];
                            PRODUTOSTy.VALORVENDA1          = Convert.ToDecimal(linhaseparada[4]);

                            if (Convert.ToInt32(linhaseparada[5]) > 0)
                            {
                                PRODUTOSTy.IDUNIDADE = Convert.ToInt32(linhaseparada[5]);
                            }

                            if (Convert.ToInt32(linhaseparada[6]) > 0)
                            {
                                PRODUTOSTy.IDGRUPOCATEGORIA = Convert.ToInt32(linhaseparada[6]);
                            }

                            if (Convert.ToInt32(linhaseparada[7]) > 0)
                            {
                                PRODUTOSTy.IDSTATUS = Convert.ToInt32(linhaseparada[7]);
                            }

                            if (Convert.ToInt32(linhaseparada[8]) > 0)
                            {
                                PRODUTOSTy.IDMARCA = Convert.ToInt32(linhaseparada[8]);
                            }

                            PRODUTOSTy.FLAGINATIVO = linhaseparada[9];

                            PRODUTOSP.Save(PRODUTOSTy);
                        }
                    }
                    else if (linhaseparada[0] == "CLI") //Salva Dados de Cliente
                    {
                        //Verifica se o cleinte Existe no Banco de Dados

                        if (VerificaExisteCliente(Convert.ToInt32(linhaseparada[1])))
                        {
                            MsgErro                 = "CLI " + linhaseparada[1];
                            CLIENTETy               = CLIENTEP.Read(Convert.ToInt32(linhaseparada[1]));
                            CLIENTETy.NOME          = linhaseparada[2];
                            CLIENTETy.TELEFONE1     = linhaseparada[3];
                            CLIENTETy.TELEFONE2     = linhaseparada[4];
                            CLIENTETy.CPF           = linhaseparada[5];
                            CLIENTETy.CNPJ          = linhaseparada[6];
                            CLIENTETy.IE            = linhaseparada[7];
                            CLIENTETy.ENDERECO1     = linhaseparada[8];
                            CLIENTETy.NUMEROENDER   = linhaseparada[9];
                            CLIENTETy.COMPLEMENTO1  = linhaseparada[10];
                            CLIENTETy.BAIRRO1       = linhaseparada[11];
                            CLIENTETy.CEP1          = linhaseparada[12];
                            CLIENTETy.COD_MUN_IBGE  = Convert.ToInt32(linhaseparada[13]);
                            CLIENTETy.EMAILCLIENTE  = linhaseparada[14];
                            CLIENTETy.FLAGBLOQUEADO = linhaseparada[15];
                            CLIENTEP.Save(CLIENTETy);
                        }
                        else
                        {
                            MsgErro                 = "CLI " + linhaseparada[1];
                            CLIENTETy.IDCLIENTE     = -1;
                            CLIENTETy.NOME          = linhaseparada[2];
                            CLIENTETy.TELEFONE1     = linhaseparada[3];
                            CLIENTETy.TELEFONE2     = linhaseparada[4];
                            CLIENTETy.CPF           = linhaseparada[5];
                            CLIENTETy.CNPJ          = linhaseparada[6];
                            CLIENTETy.IE            = linhaseparada[7];
                            CLIENTETy.ENDERECO1     = linhaseparada[8];
                            CLIENTETy.NUMEROENDER   = linhaseparada[9];
                            CLIENTETy.COMPLEMENTO1  = linhaseparada[10];
                            CLIENTETy.BAIRRO1       = linhaseparada[11];
                            CLIENTETy.CEP1          = linhaseparada[12];
                            CLIENTETy.COD_MUN_IBGE  = Convert.ToInt32(linhaseparada[13]);
                            CLIENTETy.EMAILCLIENTE  = linhaseparada[14];
                            CLIENTETy.FLAGBLOQUEADO = linhaseparada[15];
                            CLIENTEP.Save(CLIENTETy);
                        }
                    }
                }

                rd.Close();
            }
            catch (Exception ex)
            {
                rd.Close();
                MessageBox.Show("Erro ao Sicronizar o Banco de dados pelo arquivo scv");
                MessageBox.Show("Erro em: " + MsgErro);
                MessageBox.Show("Erro técnico: " + ex.Message);
            }
        }
Esempio n. 16
0
        private void Reajuste_Desconto()
        {
            DialogResult dr = MessageBox.Show("Deseja realmente fazer Reajuste/Desconto?",
                                              ConfigSistema1.Default.NameSytem, MessageBoxButtons.YesNo);

            if (dr == DialogResult.Yes)
            {
                progressBar1.Minimum = 0;
                progressBar1.Maximum = LIS_PRODUTOSColl.Count;
                try
                {
                    foreach (LIS_PRODUTOSEntity LIS_PRODUTOSTy in LIS_PRODUTOSColl)
                    {
                        int CodSelect = Convert.ToInt32(LIS_PRODUTOSTy.IDPRODUTO);

                        PRODUTOSEntity ProdutosTy = new PRODUTOSEntity();
                        ProdutosTy = PRODUTOSP.Read(CodSelect);

                        //Reajuste
                        if (chkPrecoVenda1.Checked)
                        {
                            ProdutosTy.VALORVENDA1 = ProdutosTy.VALORVENDA1 + ((ProdutosTy.VALORVENDA1 * Convert.ToDecimal(txtPorcReajuste.Text)) / 100);
                        }

                        if (chkPrecoVenda2.Checked)
                        {
                            ProdutosTy.VALORVENDA2 = ProdutosTy.VALORVENDA2 + ((ProdutosTy.VALORVENDA2 * Convert.ToDecimal(txtPorcReajuste.Text)) / 100);
                        }

                        if (chkPrecoVenda3.Checked)
                        {
                            ProdutosTy.VALORVENDA3 = ProdutosTy.VALORVENDA3 + ((ProdutosTy.VALORVENDA3 * Convert.ToDecimal(txtPorcReajuste.Text)) / 100);
                        }

                        if (chkCustoInicial.Checked)
                        {
                            ProdutosTy.VALORCUSTOINICIAL = ProdutosTy.VALORCUSTOINICIAL + ((ProdutosTy.VALORCUSTOINICIAL * Convert.ToDecimal(txtPorcReajuste.Text)) / 100);
                        }

                        if (chkCustoFinal.Checked)
                        {
                            ProdutosTy.VALORCUSTOFINAL = ProdutosTy.VALORCUSTOFINAL + ((ProdutosTy.VALORCUSTOFINAL * Convert.ToDecimal(txtPorcReajuste.Text)) / 100);
                        }

                        //Desconto
                        if (chkPrecoVenda1.Checked)
                        {
                            ProdutosTy.VALORVENDA1 = ProdutosTy.VALORVENDA1 - ((ProdutosTy.VALORVENDA1 * Convert.ToDecimal(txtPorcDesconto.Text)) / 100);
                        }

                        if (chkPrecoVenda2.Checked)
                        {
                            ProdutosTy.VALORVENDA2 = ProdutosTy.VALORVENDA2 - ((ProdutosTy.VALORVENDA2 * Convert.ToDecimal(txtPorcDesconto.Text)) / 100);
                        }

                        if (chkPrecoVenda3.Checked)
                        {
                            ProdutosTy.VALORVENDA3 = ProdutosTy.VALORVENDA3 - ((ProdutosTy.VALORVENDA3 * Convert.ToDecimal(txtPorcDesconto.Text)) / 100);
                        }

                        if (chkCustoInicial.Checked)
                        {
                            ProdutosTy.VALORCUSTOINICIAL = ProdutosTy.VALORCUSTOINICIAL - ((ProdutosTy.VALORCUSTOINICIAL * Convert.ToDecimal(txtPorcDesconto.Text)) / 100);
                        }

                        if (chkCustoFinal.Checked)
                        {
                            ProdutosTy.VALORCUSTOFINAL = ProdutosTy.VALORCUSTOFINAL - ((ProdutosTy.VALORCUSTOFINAL * Convert.ToDecimal(txtPorcDesconto.Text)) / 100);
                        }

                        PRODUTOSP.Save(ProdutosTy);
                        progressBar1.PerformStep();
                    }

                    MessageBox.Show("Reajuste/Desconto salvo com sucesso!",
                                    ConfigSistema1.Default.NomeEmpresa,
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Information,
                                    MessageBoxDefaultButton.Button1);
                }
                catch (Exception)
                {
                    MessageBox.Show("Não foi possível fazer Reajuste/Desconto em todos os registros!",
                                    ConfigSistema1.Default.NomeEmpresa,
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Information,
                                    MessageBoxDefaultButton.Button1);
                }
            }
        }
Esempio n. 17
0
        private void PreencheGrid()
        {
            try
            {
                CreaterCursor Cr = new CreaterCursor();
                this.Cursor = Cr.CreateCursor(Cr.btmap, 0, 0);

                TotalGeral       = 0;
                TotalGeralVenda1 = 0;

                DataGriewDados.Rows.Clear();
                FORNECEDORProvider FORNECEDORP = new FORNECEDORProvider();
                PRODUTOSEntity     PRODUTOSTy  = new PRODUTOSEntity();
                PRODUTOSProvider   PRODUTOSP   = new PRODUTOSProvider();
                int Contador = 0;
                foreach (var LIS_PRODUTOSTy in LIS_PRODUTOSColl)
                {
                    DataGridViewRow row2                 = new DataGridViewRow();
                    string          NOMEPRODUTO          = LIS_PRODUTOSTy.NOMEPRODUTO;
                    string          IDPRODUTO            = LIS_PRODUTOSTy.IDPRODUTO.ToString();
                    string          CODPRODUTOFORNECEDOR = LIS_PRODUTOSTy.CODPRODUTOFORNECEDOR;
                    PRODUTOSTy = PRODUTOSP.Read(Convert.ToInt32(LIS_PRODUTOSTy.IDPRODUTO));

                    //Estoque
                    decimal ESTOQUEATUAL = 0;
                    if (mkstUltimaMovimentacao.Text == "  /  /")
                    {
                        ESTOQUEATUAL = Util.EstoqueAtual(Convert.ToInt32(LIS_PRODUTOSTy.IDPRODUTO), false);
                    }
                    else
                    {
                        ESTOQUEATUAL = Util.EstoqueAtual(Convert.ToInt32(LIS_PRODUTOSTy.IDPRODUTO), mkstUltimaMovimentacao.Text, false);
                    }

                    decimal VLUNITARIO = Convert.ToDecimal(LIS_PRODUTOSTy.VALORCUSTOFINAL);

                    decimal Total        = Convert.ToDecimal(ESTOQUEATUAL) * Convert.ToDecimal(LIS_PRODUTOSTy.VALORCUSTOFINAL);
                    decimal VLVENDA1     = Convert.ToDecimal(LIS_PRODUTOSTy.VALORVENDA1);
                    decimal TotalVenda1  = Convert.ToDecimal(ESTOQUEATUAL) * Convert.ToDecimal(LIS_PRODUTOSTy.VALORVENDA1);
                    decimal AlturaChapa  = Convert.ToDecimal(PRODUTOSTy.ALTURACHAPA);
                    decimal LarguraChapa = Convert.ToDecimal(PRODUTOSTy.LARGURACHAPA);
                    decimal TotalChapa   = AlturaChapa * LarguraChapa;

                    decimal TotalEstoqueChapa = 0;
                    if (TotalChapa > 0)
                    {
                        TotalEstoqueChapa = ESTOQUEATUAL / TotalChapa;
                    }

                    if (rbEstoqueNegativo.Checked && ESTOQUEATUAL < 0)
                    {
                        row2.CreateCells(DataGriewDados, IDPRODUTO, CODPRODUTOFORNECEDOR, NOMEPRODUTO, AlturaChapa, LarguraChapa, ESTOQUEATUAL.ToString("n4"), TotalEstoqueChapa);
                        row2.DefaultCellStyle.Font = new Font("Arial", 8, FontStyle.Bold);
                        DataGriewDados.Rows.Add(row2);
                        Contador++;
                        TotalGeral       += Total;
                        TotalGeralVenda1 += TotalVenda1;
                    }
                    else if (rbEstoqueZerado.Checked && ESTOQUEATUAL == 0)
                    {
                        row2.CreateCells(DataGriewDados, IDPRODUTO, CODPRODUTOFORNECEDOR, NOMEPRODUTO, AlturaChapa, LarguraChapa, ESTOQUEATUAL.ToString("n4"), TotalEstoqueChapa);
                        row2.DefaultCellStyle.Font = new Font("Arial", 8, FontStyle.Bold);
                        DataGriewDados.Rows.Add(row2);
                        Contador++;
                        TotalGeral       += Total;
                        TotalGeralVenda1 += TotalVenda1;
                    }
                    else if (rbEstoqueMaiorqueZero.Checked && ESTOQUEATUAL > 0)
                    {
                        row2.CreateCells(DataGriewDados, IDPRODUTO, CODPRODUTOFORNECEDOR, NOMEPRODUTO, AlturaChapa, LarguraChapa, ESTOQUEATUAL.ToString("n4"), TotalEstoqueChapa);
                        row2.DefaultCellStyle.Font = new Font("Arial", 8, FontStyle.Bold);
                        DataGriewDados.Rows.Add(row2);
                        Contador++;
                        TotalGeral       += Total;
                        TotalGeralVenda1 += TotalVenda1;
                    }
                    else if (rbTodos.Checked)
                    {
                        row2.CreateCells(DataGriewDados, IDPRODUTO, CODPRODUTOFORNECEDOR, NOMEPRODUTO, AlturaChapa, LarguraChapa, ESTOQUEATUAL.ToString("n4"), TotalEstoqueChapa);
                        row2.DefaultCellStyle.Font = new Font("Arial", 8, FontStyle.Bold);
                        DataGriewDados.Rows.Add(row2);
                        Contador++;
                        TotalGeral       += Total;
                        TotalGeralVenda1 += TotalVenda1;
                    }

                    lblTotalPesquisa.Text = Contador.ToString();

                    Application.DoEvents();
                }


                //Total Geral
                DataGridViewRow row3 = new DataGridViewRow();
                row3.CreateCells(DataGriewDados, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
                row3.DefaultCellStyle.Font = new Font("Arial", 8, FontStyle.Bold);
                DataGriewDados.Rows.Add(row3);

                this.Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Default;
                MessageBox.Show("Erro na pesquisa!");
                MessageBox.Show("Erro técnico: " + ex.Message);
            }
        }
Esempio n. 18
0
        private void PreencheGrid2()
        {
            TOTALGERALQUANTIDADE = 0;
            TOTALGERALPESO       = 0;
            TOTALVENDA           = 0;
            TOTALGERALVENDA      = 0;

            CreaterCursor Cr = new CreaterCursor();

            this.Cursor = Cr.CreateCursor(Cr.btmap, 0, 0);

            try
            {
                DataGriewDados.Rows.Clear();

                //Remove as Cidades Repetidas
                LIS_PRODUTOSPEDIDOCollection LIS_PRODUTOSPEDIDOColl_2 = new LIS_PRODUTOSPEDIDOCollection();
                foreach (LIS_PRODUTOSPEDIDOEntity item in LIS_PRODUTOSPEDIDOColl)
                {
                    if (LIS_PRODUTOSPEDIDOColl_2.Find(delegate(LIS_PRODUTOSPEDIDOEntity item2) { return(item2.IDPRODUTO == item.IDPRODUTO); }) == null)
                    {
                        LIS_PRODUTOSPEDIDOColl_2.Add(item);
                    }
                }

                DataGridViewRow row1_2 = new DataGridViewRow();

                foreach (var LIS_PRODUTOSPEDIDOTy in LIS_PRODUTOSPEDIDOColl_2)
                {
                    LIS_PRODUTOSPEDIDOCollection LIS_PRODUTOSPEDIDOColl_5 = new LIS_PRODUTOSPEDIDOCollection();
                    LIS_PRODUTOSPEDIDOColl_5 = BuscaPedidoPeloProduto(Convert.ToInt32(LIS_PRODUTOSPEDIDOTy.IDPRODUTO));
                    PRODUTOSEntity PRODUTOSTy = new PRODUTOSEntity();
                    PRODUTOSTy = PRODUTOSP.Read(Convert.ToInt32(LIS_PRODUTOSPEDIDOTy.IDPRODUTO));

                    string NomeMarca = string.Empty;
                    if (LIS_PRODUTOSPEDIDOTy.IDMARCA != null && LIS_PRODUTOSPEDIDOTy.IDMARCA > 0)
                    {
                        NomeMarca = MARCAP.Read(Convert.ToInt32(LIS_PRODUTOSPEDIDOTy.IDMARCA)).NOME;
                    }

                    decimal QUANTIDADE = 0;
                    decimal PESO       = 0;
                    TOTALVENDA = 0;
                    foreach (var LIS_PRODUTOSPEDIDOTy_2 in LIS_PRODUTOSPEDIDOColl_5)
                    {
                        QUANTIDADE += Convert.ToDecimal(LIS_PRODUTOSPEDIDOTy_2.QUANTIDADE);
                        //PESO += Convert.ToDecimal(PRODUTOSP.Read(Convert.ToInt32(LIS_PRODUTOSPEDIDOTy.IDPRODUTO)).PESO) * QUANTIDADE;
                        TOTALVENDA += Convert.ToDecimal(LIS_PRODUTOSPEDIDOTy_2.VALORTOTAL);
                    }

                    TOTALGERALVENDA += TOTALVENDA;

                    TOTALGERALQUANTIDADE += QUANTIDADE;
                    TOTALGERALPESO       += PESO;

                    string Codigo          = LIS_PRODUTOSPEDIDOTy.IDPRODUTO.ToString();
                    string Cod_Referencia  = PRODUTOSTy.CODPRODUTOFORNECEDOR;
                    string Cod_Barra       = PRODUTOSTy.CODBARRA;
                    string NOMEPRODUTO     = LIS_PRODUTOSPEDIDOTy.NOMEPRODUTO;
                    string VLUNITARIOMEDIO = Convert.ToDecimal(TOTALVENDA / QUANTIDADE).ToString("n2");


                    DataGridViewRow row2 = new DataGridViewRow();
                    row2.CreateCells(DataGriewDados, Codigo, Cod_Referencia, Cod_Barra, LIS_PRODUTOSPEDIDOTy.NOMEPRODUTO, NomeMarca, VLUNITARIOMEDIO, QUANTIDADE.ToString("n2"), TOTALVENDA.ToString("n2"), PESO.ToString("n2"));
                    row2.DefaultCellStyle.Font = new Font("Arial", 8);
                    DataGriewDados.Rows.Add(row2);
                }

                DataGridViewRow rowLinha = new DataGridViewRow();
                rowLinha.CreateCells(DataGriewDados, "", "", "", "", "", "TOTAL GERAL", TOTALGERALQUANTIDADE.ToString("n2"), TOTALGERALVENDA.ToString("n2"), TOTALGERALPESO.ToString("n2"));
                rowLinha.DefaultCellStyle.Font = new Font("Arial", 8, FontStyle.Bold);
                DataGriewDados.Rows.Add(rowLinha);

                this.Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Default;
                MessageBox.Show("Erro técnico: " + ex.Message);
            }
        }
Esempio n. 19
0
        private void Grava()
        {
            try
            {
                Boolean FlagSampa = false;
                if (File.Exists(ConfigSistema1.Default.PathInstall + @"\logcadprecliente.txt"))
                {
                    File.Delete(ConfigSistema1.Default.PathInstall + @"\logcadprecliente.txt");
                }

                int j = 0;
                if (Validacoes())
                {
                    Application.DoEvents();
                    progressBar1.Minimum = 0;
                    progressBar1.Maximum = DgBDOrigem.Rows.Count;
                    progressBar1.Value   = 0;

                    Application.DoEvents();
                    this.Text = "Adicionar Pré-Cliente Por Planilha - Aguarde...";

                    DataGridViewCell celula = null;
                    for (int i = 0; i < DgBDOrigem.RowCount - 1; i++)
                    {
                        for (int x = 0; x < DgBDOrigem.ColumnCount; x++)
                        {
                            celula = DgBDOrigem[x, i];
                            string valor = celula.Value.ToString().ToUpper();

                            if (x == 0)
                            {
                                CODIGOPRODUTO = valor;
                            }
                            else if (x == 1)
                            {
                                PRECOVENDA = valor;
                            }
                        }

                        //Remove espaços e letras
                        CODIGOPRODUTO = CODIGOPRODUTO.TrimEnd();
                        //Numero maximo de caractere
                        CODIGOPRODUTO = Util.LimiterText(CODIGOPRODUTO, 20);
                        PRECOVENDA    = Util.LimiterText(PRECOVENDA, 15);

                        if (CODIGOPRODUTO.TrimEnd().TrimStart() != string.Empty && PRECOVENDA.TrimEnd().TrimStart() != string.Empty)
                        {
                            PRODUTOSEntity PRODUTOSEnty = new PRODUTOSEntity();
                            PRODUTOSEnty = BuscaProduto(CODIGOPRODUTO);
                            if (PRODUTOSEnty != null)
                            {
                                if (rbPrecoVenda1.Checked)
                                {
                                    PRODUTOSEnty.VALORVENDA1 = Convert.ToDecimal(PRECOVENDA);
                                }
                                else if (rbPrecoVenda2.Checked)
                                {
                                    PRODUTOSEnty.VALORVENDA2 = Convert.ToDecimal(PRECOVENDA);
                                }
                                else if (rbPrecoVenda3.Checked)
                                {
                                    PRODUTOSEnty.VALORVENDA3 = Convert.ToDecimal(PRECOVENDA);
                                }

                                PRODUTOSP.Save(PRODUTOSEnty);
                                j++;
                            }
                        }

                        Application.DoEvents();
                        progressBar1.Value = i;
                    }

                    Application.DoEvents();
                    progressBar1.Value = DgBDOrigem.Rows.Count;
                    this.Text          = "Adicionar Pré-Cliente Por Planilha";

                    MessageBox.Show("Total de Registro incluídos: " + j.ToString());

                    string PastaOrigem = ConfigSistema1.Default.PathInstall;

                    if (File.Exists(ConfigSistema1.Default.PathInstall + @"\logcadprecliente.txt"))
                    {
                        System.Diagnostics.Process.Start(PastaOrigem + @"\logcadprecliente.txt");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ConfigMessage.Default.MsgSaveErro);
            }
        }