Esempio n. 1
0
        private void btnEntrar_Click(object sender, EventArgs e)
        {
            Controle controle = new Controle();

            controle.acessar(txtUsuario.Text, txtSenha.Text);

            if (controle.mensagem.Equals(""))
            {
                if (controle.tem)
                {
                    MessageBox.Show("Logado com sucesso", "Entrando", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Bem_vindo bv = new Bem_vindo();
                    bv.Show();
                }
                else
                {
                    MessageBox.Show("Login não encontrado, verifique as credenciais e tente novamente", "ERRO!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show(controle.mensagem);
            }
        }
        public List <Controle> InsertControle(Controle monControle)
        {
            SqlConnection   objConnexion = AccesBD.GetInstance().GetSqlConnexion();
            List <Controle> maListe      = new List <Controle>();
            SqlCommand      maCommande   = new SqlCommand("sp_CreerControle", objConnexion);

            maCommande.CommandType = CommandType.StoredProcedure;
            maCommande.Parameters.Add("idZoneStockage", SqlDbType.Int);
            maCommande.Parameters[0].Value = monControle.IdZoneStockage;
            maCommande.Parameters.Add("idEntreprise", SqlDbType.Int);
            maCommande.Parameters[1].Value = monControle.IdEntreprise;
            maCommande.Parameters.Add("idTypeControle", SqlDbType.Int);
            maCommande.Parameters[2].Value = monControle.IdTypeControle;
            maCommande.Parameters.Add("dateControle", SqlDbType.Date);
            maCommande.Parameters[3].Value = monControle.DateControle;
            maCommande.Parameters.Add("resumeControle", SqlDbType.VarChar);
            maCommande.Parameters[4].Value = monControle.ResumeControle;
            maCommande.Parameters.Add("montantHtControle", SqlDbType.Float);
            maCommande.Parameters[5].Value = monControle.MontantHTControle;
            objConnexion.Open();
            maCommande.ExecuteNonQuery();
            AccesBD.GetInstance().CloseConnexion();
            return(maListe);
        }
Esempio n. 3
0
        private void btnCadastrar_Click(object sender, EventArgs e)
        {
            //Padrão
            Arm arm = new Arm();

            arm.Patrimonio = txtPatrimonioArm.Text.ToUpper();
            arm.Mac        = txtMac.Text.ToUpper();

            arm.VersaoDeHardwarePC  = txtVersaoHardware.Text.ToUpper();
            arm.SerialIris          = Convert.ToInt16(txtIris.Text);
            arm.VersaoDeSoftwarerPC = txtVersaoSoftwarePc.Text.ToUpper();
            arm.SerialColibri       = Convert.ToInt16(txtColibri.Text);

            //Atual
            arm.WindowsCe       = txtVersaoAtualWindowsCe.Text.ToUpper();
            arm.BootLoader      = txtVersaoAtualBootloader.Text.ToUpper();
            arm.SoftwareTrufix  = txtVersaoAtualSoftwareTrufix.Text.ToUpper();
            arm.SoftwareToradex = txtVersaoAtualSoftwareTdx.Text.ToUpper();

            //Versão atua   lizada
            arm.PatrimonioPcAtualizado       = txtVersaoAtualizadaPatrimonio.Text.ToUpper();
            arm.VersaoDeHardwareAtualizadoPc = txtVersaoAtualizadaHardware.Text.ToUpper();
            arm.WindowsCeAtualizado          = txtVersaoAtualizadoWindowsCe.Text.ToUpper();
            arm.BootLoaderAtualizado         = txtVersaoAtualizadaBootLoader.Text.ToUpper();
            arm.SoftwareTrufixAtualizado     = txtVersaoAtualiadoSoftwareTrufix.Text.ToUpper();
            arm.VersaoDeSoftwareAtualizadoPC = txtVersaoAtualiadoSoftwareTrufix.Text.ToUpper();
            arm.SoftwareToradexAtualizado    = txtVersaoAtualizadaSoftwareTdx.Text.ToUpper();
            string data1 = DateTime.Now.ToString("yyyy-dd-MM HH:mm:ss");
            string data2 = DateTime.Now.ToString("yyyy-dd-MM HH:mm:ss");

            arm.DataDeEntrada = Convert.ToDateTime(data1);
            arm.DataDeSaida   = Convert.ToDateTime(data2);
            Controle controle = new Controle();

            MessageBox.Show(controle.CadastrarArm(arm), "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Esempio n. 4
0
        private void btnEntrar_Click(object sender, EventArgs e)
        {
            Controle controle = new Controle();

            controle.acessar(txbNome.Text, txbSenha.Text);

            if (controle.mensagem.Equals(""))
            {
                if (controle.tem)
                {
                    MessageBox.Show("Usuário logado com Sucesso!", "Entrando...", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    MenuOpcoes menu = new MenuOpcoes();
                    menu.Show();
                }
                else
                {
                    MessageBox.Show("Login não encontrado, verifique login e senha", "Erro!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show(controle.mensagem);
            }
        }
Esempio n. 5
0
        /*criacao do metodo executar para pegar a operacao*/
        private void Executar(String op)
        {
            Controle controle = new Controle(txbPrimeiroNumero.Text, txbSegundoNumero.Text, op);

            /*
             *
             * controle.num1 = txbPrimeiroNumero.Text;
             * controle.num2 = txbSegundoNumero.Text;
             * controle.op = op;
             * /*chamado do metodo*/
            controle.Executar();
            if (controle.mensagem.Equals(""))
            {
                lblResultado.Text = controle.resposta;
            }
            else
            {
                MessageBox.Show(controle.mensagem);
                txbPrimeiroNumero.Clear();
                txbSegundoNumero.Clear();
                lblResultado.Text = "Resultado";
                txbPrimeiroNumero.Focus();
            }
        }
Esempio n. 6
0
 void Awake()
 {
     compVelocidade = GetComponent <Velocidade>();
     tr             = GetComponent <Transform>();
     ctrl           = GetComponent <Controle>();
 }
Esempio n. 7
0
        private async void Feed()
        {
            controle = new Controle();

            RssList = await controle.BaixarFeed("http://new.d24am.com/rss?section=3");
        }
Esempio n. 8
0
 public static void SetDevPresence(List <ContratoDTO> contractList, int sprintDays, bool adaptarionSprint = false)
 {
     Controle.SetDevPresence(contractList, sprintDays, adaptarionSprint);
 }
Esempio n. 9
0
 public static double CalcTeamSize(SprintDevDTO sprintDev, FornecedorDTO selectedPartner)
 {
     return(Controle.CalcTeamSize(sprintDev, selectedPartner));
 }
 public void CreerControle( Controle monControle)
 {
     DAOControle.GetInstanceDAOControle().InsertControle(monControle);
 }
Esempio n. 11
0
 /// <summary>
 /// Constructeur de la classe.
 /// </summary>
 public FrmAbsences(Controle controle)
 {
     InitializeComponent();
     this.StartPosition = FormStartPosition.CenterParent;
     this.controle      = controle;
 }
Esempio n. 12
0
 public CaixaServico()
 {
     controle = new Controle <Caixa>();
 }
Esempio n. 13
0
 public static void init(Transform prefab, LayerMask solido)
 {
     BuscaLargura.prefab = prefab;
     BuscaLargura.solido = solido;
     mapa = Controle.getMapa();
 }
Esempio n. 14
0
        static void Main(string[] args)
        {
            //NumDoc 154988

            (new EmitenteDao()).SelecionaEmitente();

            Certificado.getInstance.Seleciona_Certificado();

            GerarXML.str_Ambiente = "2";



            Controle control = (new ControleNFiscalDao()).getControle();

            if (control != null)
            {
                Controle.getInstance.ultima_NFCe            = control.ultima_NFCe;
                Controle.getInstance.csc_Homologacao        = control.csc_Homologacao;
                Controle.getInstance.csc_Producao           = control.csc_Producao;
                Controle.getInstance.caminho_XMLAutorizado  = control.caminho_XMLAutorizado;
                Controle.getInstance.caminho_XMLCancelado   = control.caminho_XMLCancelado;
                Controle.getInstance.caminho_XMLInutilizado = control.caminho_XMLInutilizado;

                control = null;
            }



            Pedido pedido = (new PedidoDao()).getPedido(247259);

            //pedido.cliente = (new ClienteDao()).getClientePedido(pedido.numdoc);
            pedido.cliente     = (new ClienteDao()).getClientePedido(247259);
            pedido.cliente.end = ((new EnderecoDao()).getEnderecoCliente(pedido.numdoc));

            pedido.operacao      = (new OperacaoDao()).getOperacaoPedido(pedido.numdoc);
            pedido.lstPedidoItem = (new PedidoItemDao()).getlst_Itens(pedido.numdoc);

            //pedido.emitente = (new EmitenteDao()).getEmitente();
            //pedido.emitente.endereco = (new EnderecoDao()).getEnderecoEmitente();

            ProdutoDao pd = new ProdutoDao();

            foreach (PedidoItem pedidoitem in pedido.lstPedidoItem)
            {
                pedidoitem.produto              = pd.getProduto(pedidoitem.codpro);
                pedidoitem.produto.subGrupo     = pd.getSubGrupo(pedidoitem.produto.codgrupo, pedidoitem.produto.codsubGrupo);
                pedidoitem.produto.produto_loja = new Produto_Loja {
                    desconto = 0
                };
            }

            pedido.nfiscal = "81";


            GerarXML geraxml = new GerarXML();
            var      xml     = geraxml.NFe(pedido);


            var xmlAssinado = (new AssinarXML()).AssinaXML(xml.InnerXml, "infNFe", Certificado.getInstance.oCertificado);


            //========================================================================
            var Grava = File.CreateText(@"C:\Users\Admin\Desktop\XML_GERADO.XML");

            Grava.Write(xmlAssinado.InnerXml);
            Grava.Close();
            //========================================================================



            var retValidar = (new ValidarXML()).Valida(xmlAssinado, "NFe");

            //========================================================================
            Grava = File.CreateText(@"C:\Users\Admin\Desktop\XML_VALIDADO.XML");
            Grava.Write(retValidar);
            Grava.Close();
            //========================================================================


            var urlQRCode = geraxml.Gera_Url_QRCode(xmlAssinado, pedido);

            //Inserindo a URL QRCode no xml já assinado
            xmlAssinado.LoadXml(xmlAssinado.InnerXml.Replace("</infNFe>", "</infNFe><infNFeSupl><qrCode><![CDATA[" + urlQRCode + "]]></qrCode><urlChave>http://www4.fazenda.rj.gov.br/consultaNFCe/QRCode</urlChave></infNFeSupl>"));


            //========================================================================
            Grava = File.CreateText(@"C:\Users\Admin\Desktop\XML_ASSINADO_QRCODE.XML");
            Grava.Write(xmlAssinado.InnerXml);
            Grava.Close();
            //========================================================================


            string retTransmitir = "";

            if (retValidar == string.Empty)
            {
                retTransmitir = (new TransmitirXML()).XML_NFCe4(xmlAssinado, pedido.nfiscal, Certificado.getInstance.oCertificado);
            }
            else
            {
                Console.Write(retValidar);
            }


            //========================================================================
            Grava = File.CreateText(@"C:\Users\Admin\Desktop\XML_EMITIDO.XML");
            Grava.Write(retTransmitir);
            Grava.Close();
            //========================================================================



            //MP2032.ConfiguraModeloImpressora(7); // Bematech MP-4200 TH
            //MP2032.IniciaPorta("USB");

            //pedido.chave = "33180911500080000160650010000001011757287148";

            //ProjetoPDVUtil.ImpressoraBema.GeraDANFE_NFCe(pedido, urlQRCode);


            //MP2032.FechaPorta();


            //printa(servico.GeraLote(x));



            Console.Write("Fim");
            //Console.ReadKey();
        }
Esempio n. 15
0
    public override void executaAcao()
    {
        personagem.apagaRotas();

        if (Controle.clicouNoNada())
        {
            if (personagem.anda(Metodos.getPosicaoMouseNaGrid()))
            {
                novoEstado();
            }
            else
            {
                voltaEstado();
            }
        }
        else
        {
            personagem.mudaBox();
            if (Controle.getClicado2() != null && BuscaLargura.buscaOrientada(personagem.toPasso(), Controle.getClicado2().toPasso(), personagem.alcance))
            {
                if (Controle.getClicado2().setMensagem(personagem))
                {
                    Controle.reiniciaClicados();
                    finaliza();
                }
            }
            else
            {
                voltaEstado();
            }
            personagem.mudaBox();
        }
    }
Esempio n. 16
0
        private void btnMultiplicar_Click(object sender, EventArgs e)
        {
            Controle controle = new Controle();

            lblResultado.Text = controle.Calcular(txbPrimeiroNumero.Text, txbSegundoNumero.Text, "*");
        }
Esempio n. 17
0
        public string EnviarEmail(string destinatario)
        {
            GerarCodigo();
            string remetente = "*****@*****.**", senha_remetente = "admin123_", stmp = "smtp.gmail.com"; int port = 587;


            if (EmailouUsuarioExistente(destinatario))
            {
                comandosSql.CommandText = "Select * from Tb_login where usuario = @user or email = @email";

                comandosSql.Parameters.AddWithValue("@user", destinatario);

                comandosSql.Parameters.AddWithValue("@email", destinatario);
                try
                {
                    comandosSql.Connection = Conexao_BD.Conectar();
                    leituraDadosSql        = comandosSql.ExecuteReader();
                    if (leituraDadosSql.Read())
                    {
                        email = leituraDadosSql.GetString(2);
                        senha = leituraDadosSql.GetString(4);
                    }
                }
                catch (Exception erro)
                {
                    mensagem = "erro inesperado" + erro;
                }

                SmtpClient        client;
                NetworkCredential login;
                MailMessage       msg;

                try
                {
                    login              = new NetworkCredential(remetente, senha_remetente);
                    client             = new SmtpClient(stmp);
                    client.Port        = port;
                    client.EnableSsl   = true;
                    client.Credentials = login;

                    msg = new MailMessage();
                    msg.To.Add(email);
                    msg.From    = new MailAddress(remetente);
                    msg.Subject = "Solicitação de Recuperação de senha - Software Solution";
                    msg.Body    = codigo1;

                    Controle controle = new Controle();
                    controle.mensagem = codigo1;

                    msg.BodyEncoding = Encoding.UTF8;
                    msg.IsBodyHtml   = false;
                    msg.Priority     = MailPriority.High;
                    client.Send(msg);
                    this.mensagem = "Enviamos um E-mail para o seu email" + email + " cadastrado no sistma\nVerifique seu email";
                }
                catch (Exception)
                {
                    MessageBox.Show("Houve algum problema");
                }
            }
            return(mensagem);
        }
    public static string recebeMensagem(string msg)
    {
        Debug.Log(msg);

        string[] decode  = msg.Split(';');
        string   metodo  = decode[0].Split(':')[1];
        string   retorno = "";
        Dictionary <string, string> parametros = new Dictionary <string, string>();

        if (msg.Contains("parametros"))
        {
            string   variaveis = decode[1].Split(':')[1];
            string[] valores   = variaveis.Split(',');
            foreach (string valore in valores)
            {
                string nome  = valore.Split('=')[0];
                string valor = valore.Split('=')[1];
                parametros.Add(nome, valor);
            }
        }

        if (metodo.Equals("mudaTurno"))
        {
            Controle.mudaTurno();
            retorno = Metodos.criaResposta(metodo, "200");
        }

        if (metodo.Equals("movimenta"))
        {
            LinkedList <GameObject>             players = new LinkedList <GameObject>(GameObject.FindGameObjectsWithTag("Player"));
            LinkedList <GameObject> .Enumerator enu     = players.GetEnumerator();
            while (enu.MoveNext())
            {
                Personagem per = enu.Current.GetComponent <Personagem>();
                string     id;
                parametros.TryGetValue("id", out id);
                if (per.id.Equals(id))
                {
                    string pos_x;
                    string pos_y;
                    parametros.TryGetValue("pos_x", out pos_x);
                    parametros.TryGetValue("pos_y", out pos_y);
                    Vector2 vec = new Vector2(float.Parse(pos_x), float.Parse(pos_y));
                    if (per.anda(vec, true))
                    {
                        return(Metodos.criaResposta(metodo, "200"));
                    }
                    else
                    {
                        return(Metodos.criaResposta(metodo, "300"));
                    }
                }
            }
            Metodos.criaResposta(metodo, "500");
        }

        if (metodo.Equals("habilidade"))
        {
            Personagem origem  = new Personagem();
            Personagem destino = new Personagem();

            LinkedList <GameObject>             players = new LinkedList <GameObject>(GameObject.FindGameObjectsWithTag("Player"));
            LinkedList <GameObject> .Enumerator enu     = players.GetEnumerator();
            while (enu.MoveNext())
            {
                Personagem per = enu.Current.GetComponent <Personagem>();
                string     id_destino;
                string     id_origem;
                parametros.TryGetValue("id_destino", out id_destino);
                parametros.TryGetValue("id_origem", out id_origem);
                if (per.id.Equals(id_destino))
                {
                    destino = per;
                }
                if (per.id.Equals(id_origem))
                {
                    origem = per;
                }
            }
            string habilidade;
            parametros.TryGetValue("habilidade", out habilidade);
            Interpretador interpretador = new InterpretadorDeHabilidades();
            if (interpretador.recebeMensagem(destino, origem, habilidade, false))
            {
                return(Metodos.criaResposta(metodo, "200"));
            }
            else
            {
                return(Metodos.criaResposta(metodo, "500"));
            }
        }

        return(retorno);
    }
Esempio n. 19
0
 // Use this for initialization
 void Start()
 {
     ctl        = FindObjectOfType <Controle>();
     velocidade = ctl.velocidadeJogo;
 }
 public FrmAuthentification(Controle controle)
 {
     this.controle = controle;
     InitializeComponent();
 }
Esempio n. 21
0
 public ReceitaServico()
 {
     controle = new Controle <Receita>();
 }
Esempio n. 22
0
 public static List <IntervaloDTO> GenerateRanges()
 {
     return(Controle.GenerateRanges());
 }
 void Awake()
 {
     controle = GetComponent <Controle>();
 }
Esempio n. 24
0
 public static void CalcPointsPerTeamMember(SprintDevDTO devSprint)
 {
     Controle.CalcPointsPerTeamMember(devSprint);
 }
Esempio n. 25
0
        protected void ChangePassword_Click(object sender, EventArgs e)
        {
            // Variable des champs textbox
            string text           = "";
            bool   ok             = VerifChamps();
            string user           = username.Text;
            string oldpass        = apassword.Text;
            string newPass        = npassword.Text;
            string confirmNewPass = ncpassword.Text;

            // Si tout les champs sont remplis
            if (ok)
            {
                //Si le l'ancien mot de passe == le nouveau ou que le nouveau ne correspond pas à la confirmation
                if (oldpass == newPass || newPass != confirmNewPass)
                {
                    text = "L'ancien mot de passe et le nouveau sont les mêmes ou le nouveau et la confirmation ne correspondent pas";
                    OldPass.ForeColor  = System.Drawing.Color.Red;
                    NewPass.ForeColor  = System.Drawing.Color.Red;
                    cNewPass.ForeColor = System.Drawing.Color.Red;
                    //Messagebox erreur?
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "tmp", "<script type='text/javascript'>MessageBoxErreur(\"" + text + "\");</script>", false);
                }
                else
                {
                    // Hash l'ancien password
                    string oldpassHash = Controle.hashPassword(oldpass, null, System.Security.Cryptography.SHA256.Create());
                    // Verifie si c'est correspondant
                    bool Correspondant = Controle.userPassCorrespondant(user, oldpassHash);
                    if (Correspondant)
                    {
                        // Crypter le nouveau mot de passe et envoyer
                        string newpassHash = Controle.hashPassword(newPass, null, System.Security.Cryptography.SHA256.Create());

                        //Changer le password du user avec le nouveau password hashé
                        bool ChangeOk = Controle.updatePassword(user, newpassHash);
                        if (ChangeOk)
                        {
                            // Messagebox changement réussi
                            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "tmp", "<script type='text/javascript'>MessageBoxReussi();</script>", false);
                            usernameLB.ForeColor = System.Drawing.Color.Black;
                            OldPass.ForeColor    = System.Drawing.Color.Black;
                            NewPass.ForeColor    = System.Drawing.Color.Black;
                            cNewPass.ForeColor   = System.Drawing.Color.Black;
                        }
                    }
                    else
                    {
                        text = "Le nom  d'utilisateur et l'ancien mot de passe ne correspondent pas";
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "tmp", "<script type='text/javascript'>MessageBoxErreur(\"" + text + "\");</script>", false);
                        usernameLB.ForeColor = System.Drawing.Color.Red;
                        OldPass.ForeColor    = System.Drawing.Color.Red;
                    }
                }
            }
            else
            {
                text = "Vous devez remplir tout les champs requis";
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "tmp", "<script type='text/javascript'>MessageBoxErreur(\"" + text + "\");</script>", false);
                usernameLB.ForeColor = System.Drawing.Color.Red;
                OldPass.ForeColor    = System.Drawing.Color.Red;
                NewPass.ForeColor    = System.Drawing.Color.Red;
                cNewPass.ForeColor   = System.Drawing.Color.Red;
                ViderTB();
            }
        }
Esempio n. 26
0
 public static void CalcSmSprintData(List <SprintSmDTO> sprintsSmList)
 {
     Controle.CalcSmSprintData(sprintsSmList);
 }
Esempio n. 27
0
 /// <summary>
 /// Initialisation des composants graphiques
 /// Récupération du controleur
 /// </summary>
 /// <param name="controle"></param>
 public FrmHabilitations(Controle controle)
 {
     InitializeComponent();
     this.controle = controle;
     Init();
 }
Esempio n. 28
0
        public void Logar()
        {
            Controle controle = new Controle();

            controle.acessar(txbLogin.Text, txbSenha.Text);
            if (controle.mensagem.Equals(""))
            {
                if (txbLogin.Text == string.Empty) //Ou qualquer outro número que você definir
                {
                    MessageBox.Show("DIGITE O E-MAIL!", "ATENÇÃO!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else if (txbSenha.Text == string.Empty) //Ou qualquer outro número que você definir
                {
                    MessageBox.Show("DIGITE A SENHA!", "ATENÇÃO!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    if (controle.tem)
                    {
                        strSql = "SELECT NivelAcesso, usuario FROM Logins WHERE email='" + txbLogin.Text + "'";
                        sqlCon = new SqlConnection(strCon);
                        sqlCon.Open();
                        SqlCommand    comando = new SqlCommand(strSql, sqlCon);
                        SqlDataReader dr      = comando.ExecuteReader();
                        dr.Read();
                        string lvlAcesso = dr["NivelAcesso"].ToString();
                        string nome      = dr["usuario"].ToString();

                        if (lvlAcesso == "GERENTE" || lvlAcesso == "ATENDENTE")
                        {
                            if (lvlAcesso == "GERENTE")
                            {
                                TelaPrincipal tela = new TelaPrincipal();
                                tela.lblnome.Text = "BEM VINDO(A) " + nome.ToUpper();
                                tela.lblfunc.Text = "GERENTE";
                                tela.ShowDialog();

                                txbLogin.Clear();
                                txbSenha.Clear();
                            }
                            else if (lvlAcesso == "ATENDENTE")
                            {
                                TelaPrincipal tela = new TelaPrincipal();
                                tela.lblnome.Text = "BEM VINDO(A) " + nome.ToUpper();
                                tela.lblfunc.Text = "ATENDENTE";
                                tela.clienteToolStripMenuItem.Enabled    = false;
                                tela.fornecedorToolStripMenuItem.Enabled = false;
                                tela.produtoToolStripMenuItem.Enabled    = false;
                                tela.ShowDialog();

                                txbLogin.Clear();
                                txbSenha.Clear();
                            }
                        }
                        else
                        {
                            MessageBox.Show("O FUNCIONÁRIO NÃO TEM PERMISSÃO\nPARA ACESSAR O SISTEMA!", "USUÁRIO SEM PERMISSÃO!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            txbSenha.Clear();
                        }
                    }
                    else
                    {
                        txbSenha.Clear();
                        MessageBox.Show("Login não encontrado", "ERRO!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        txbSenha.Clear();
                    }
                }
            }
            else
            {
                MessageBox.Show(controle.mensagem);
            }
        }
Esempio n. 29
0
 static void Main(string[] args)
 {
     Console.WriteLine(Controle.hashPassword("Warst", null, System.Security.Cryptography.SHA256.Create()).ToString());
     Console.ReadLine();
 }
Esempio n. 30
0
        private void BotaoSalvar_Click(object sender, EventArgs e)
        {
            string table = "";

            switch (tab_Produtos.SelectedTab.Text)
            {
            case "Ácido Cloridrico":
                table = "tblAcidocloridrico";
                break;

            case "Ácido Sulfurico":
                table = "tblAcidoSulfurico";
                break;

            case "Tolueno":
                table = "tblTolueno";
                break;

            case "Hidroxido de Postásio":
                table = "tblHidroxidoPostasio";
                break;

            case "Acetona":
                table = "tblAcetona";
                break;

            case "Metiletilcetona":
                table = "tblMetiletilcetona";
                break;
            }

            LoginDalComandos logindal = new LoginDalComandos();
            int ValorEstoqueAtual     = logindal.ValorAtualEstoque(table);

            MessageBox.Show("Esse é o valor Atual do Estoque\n" + Convert.ToString(ValorEstoqueAtual), "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Information);

            DateTime DataEmissaonf   = Cx_Data_Emissao_NF.Value;
            DateTime DataPedido      = Cx_Data_Pedido.Value;
            DateTime Data_Lancamento = DateTime.Today;

            if (Cx_Quant_Compra.Text == "")
            {
                Cx_Quant_Compra.Text = "0";
            }
            if (Cx_Quant_Usada.Text == "")
            {
                Cx_Quant_Usada.Text = "0";
            }


            QuantidadeCompra    = float.Parse(Cx_Quant_Compra.Text);
            QuantidadeUtilizada = float.Parse(Cx_Quant_Usada.Text);
            string Resultado;

            Resultado = logindal.Estoque(QuantidadeCompra, QuantidadeUtilizada, ValorEstoqueAtual);
            MessageBox.Show($"Este é o resultado do Estoque após o incremento: {Resultado}", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Information);

            Controle controle = new Controle();
            String   mensagem = controle.CadastrarProduto(table, Cx_Produto.Text, Cx_Item.Text, Cx_Numero_NF.Text, Cx_Pedido_Compra.Text, Cx_Quant_Compra.Text, Cx_Quant_Usada.Text,
                                                          Cx_Usuario_Logado.Text, DataEmissaonf, DataPedido, Data_Lancamento, Resultado);

            if (controle.tem)
            {
                MessageBox.Show(mensagem, "Cadastro", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            else

            {
                MessageBox.Show(controle.mensagem);
            }
            AtualizarDados();
            ResetarForm();
        }
Esempio n. 31
0
 public void Inicializar(Controle controle)
 {
     _controle = controle;
 }