Example #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string rut  = txtrut.Text;
            string pass = txtpass.Password;
            //Verificar usuario
            vendedorFacade vendFac   = new vendedorFacade();
            string         passAdmin = vendFac.getpassbyRut(rut);

            byte[] data      = Encoding.ASCII.GetBytes(pass);
            SHA1   algorithm = SHA1.Create();

            byte[]        hash = algorithm.ComputeHash(data);
            StringBuilder sb   = new StringBuilder();

            //string base64 = Convert.ToBase64String(hash);

            /*for (int i = 0; i < hash.Length; i++)
             * {
             *  sb.AppendFormat("{x2}", hash[i]);
             * }*/
            foreach (Byte b in hash)
            {
                sb.Append(b.ToString("x2"));
            }

            if (passAdmin.Equals(sb.ToString()))
            {
                //ir a pagina reporte

                TransLoginToReporte tl = getContent();

                //method1();
                //tl.btnLogin.Visibility = Visibility.Visible;
                Reportes reporte = new Reportes();
                reporte.setContent(tl);
                reporte.ladmin.Content = "Administrador:" + vendFac.getNombreAdminByRut(txtrut.Text);
                tl.pageTransitionControl.ShowPage(reporte);

                //method1();
            }
            else
            {
                lmsg.Content = "Administrador no existe";

                /* System.Threading.Thread.Sleep(600);
                 * Microsoft.VisualBasic.Interaction.AppActivate(
                 *    System.Diagnostics.Process.GetCurrentProcess().Id);
                 * System.Windows.Forms.SendKeys.SendWait(" ");
                 * lmsg.Content = "";*/
            }
        }
Example #2
0
        public void setLogin(TransLoginToReporte l)
        {
            trans = l;

        }
Example #3
0
 public void setLogin(TransLoginToReporte l)
 {
     trans = l;
 }