Пример #1
0
        private void closeFormToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Hide();
            Login_Form ad = new Login_Form();

            ad.Show();
        }
Пример #2
0
 private static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Theme.CurentTheme  = "default.ini";
     Application.Run(LF = new Login_Form());
 }
        /*
         * Event listener for the Review Analyser tile
         */
        private void tile_reviewer_Click(object sender, EventArgs e)
        {
            this.Enabled = false;
            Login_Form login = new Login_Form(3, this);

            login.Show();
        }
Пример #4
0
        public ActionResult Index(Login_Form lf)
        {
            con = new SqlConnection("Data Source=.;Initial Catalog=CRM;Integrated Security=True");
            //com = new SqlCommand("select Username, Password from LoginForm where Username=@Username and Password=@Password");
            com            = new SqlCommand("EXEC Usr_login @uname='" + lf.Username + "',@pass='******'    ");
            com.Connection = con;
            con.Open();
            //com.Parameters.AddWithValue("Username", lf.Username);
            // com.Parameters.AddWithValue("Password", lf.Password);
            SqlDataReader dr = com.ExecuteReader();

            if (dr.Read())
            {
                ViewData["data"] = "<script>alert('Login Successful..')</script>";
                ModelState.Clear();
                Session["username"] = lf.Username.ToString();
                return(RedirectToAction("welcome"));
            }

            else
            {
                ViewBag.insertmessages = "<script>alert('Login faild..')</script>";
                ViewData["message"]    = "user loggin Details failed";
            }
            con.Close();

            return(View());
        }
        /*
         * Event listener for the Analysist tile
         */
        private void tile_analyst_Click(object sender, EventArgs e)
        {
            Login_Form login = new Login_Form(2, this);

            login.Show();
            this.Enabled = false;
        }
        private void button8_Click(object sender, EventArgs e)
        {
            this.Hide();
            u.Logout();
            Login_Form f1 = new Login_Form(0);

            f1.ShowDialog();
        }
 private void timer1_Tick(object sender, EventArgs e)
 {
     metroProgressBar1.Increment(1);
     if (metroProgressBar1.Value == 100)
     {
         timer1.Stop();
         this.Hide();
         Login_Form lg = new Login_Form();
         lg.ShowDialog();
     }
 }
        public Nurse()
        {
            InitializeComponent();
            if (SessionClass.SessionId == 0)
            {
                Login_Form f1 = new Login_Form(0);
                f1.ShowDialog();
            }

            label1.Text = "        " + SessionClass.SessionId.ToString();
        }
Пример #9
0
        private void FormPrincipal_Load(object sender, EventArgs e)
        {
            Test_Configuration.Test_Flies();
            ShowCredit(credits);
            var    form = new Login_Form();
            sendId send = new sendId(form.FoundFp);

            send(this);
            form.ShowDialog();
            Load_Somme();
        }
Пример #10
0
        private void Form1_Load(object sender, EventArgs e)
        {
            PubCon.testFile();
            var    form = new Login_Form();
            SendId send = new SendId(form.FundForm1);

            send(this);
            form.ShowDialog();
            //Login_Form frm = new Login_Form();
            //frm.ShowDialog();
            //SendId send = new SendId(login.FundForm1);
            //send(this);

            ShowProduit(produit);
        }
Пример #11
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            //if (this.Opacity > 0.0)
            //{
            //    this.Opacity -= 0.05;
            //}
            //else
            //{
            timer1.Stop();
            Login_Form l = new Login_Form();

            l.Show();
            this.Hide();

            // }
        }
Пример #12
0
 public ActionResult signup(Login_Form lf)
 {
     if (ModelState.IsValid == true)
     {
         con = new SqlConnection("Data Source=.;Initial Catalog=CRM;Integrated Security=True");
         com = new SqlCommand("EXEC Register @uname='" + lf.Username + "',@pass='******',@id=" + lf.Id + ",@name='" + lf.Name + "',@gen='" + lf.Gender + "' ");
         con.Open();
         com.Connection = con;
         com.Parameters.AddWithValue("@Username", lf.Username);
         com.Parameters.AddWithValue("@Password", lf.Password);
         com.Parameters.AddWithValue("@Id", lf.Id);
         com.Parameters.AddWithValue("@Name", lf.Name);
         com.Parameters.AddWithValue("@Gender", lf.Gender);
         com.ExecuteNonQuery();
         con.Close();
     }
     return(View());
 }
        private void closeFormToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            DialogResult dia = MessageBox.Show("Do You Really Wany To Log Out?", "Pharmacy System", MessageBoxButtons.YesNo);

            if (dia == DialogResult.Yes)
            {
                if (lblRank.Text == "1")
                {
                    this.Hide();
                    Admin_Form ad = new Admin_Form();
                    ad.ShowDialog();
                }
                else
                {
                    this.Hide();
                    Login_Form lf = new Login_Form();
                    lf.ShowDialog();
                }
            }
            else if (dia == DialogResult.No)
            {
                btnAddP.Focus();
            }
        }
Пример #14
0
 public string checkLoginAuthentication(int type, string username, string password, Login_Form login)
 {
     if ((username.Equals("")) || (password.Equals("")))
     {
         MetroFramework.MetroMessageBox.Show(login, "Login attempt failed" + "\n" + "Required fields are missing", "Login was unsuccessful", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return(null);
     }
     else
     {
         string encryptedPassword = encrypter.Encrypt(password, ENCRYPT_KEY);
         encryptedPassword = encryptedPassword.Trim();
         if (type == 1)
         {
             DataSet ds = dr.getAdmin(username, encryptedPassword);
             if (ds != null)
             {
                 int count = ds.Tables[0].Rows.Count;
                 if (count == 0)
                 {
                     MetroFramework.MetroMessageBox.Show(login, "Username or Password is incorrect", "Login was unsuccessful", MessageBoxButtons.OK, MessageBoxIcon.Information);
                     return(null);
                 }
                 else
                 {
                     return(ds.Tables[0].Rows[0]["name"].ToString());
                 }
             }
             return(null);
         }
         else if (type == 2)
         {
             DataSet ds = dr.getAnalyser(username, encryptedPassword);
             if (ds != null)
             {
                 int count = ds.Tables[0].Rows.Count;
                 if (count == 0)
                 {
                     MetroFramework.MetroMessageBox.Show(login, "Username or Password is incorrect", "Login was unsuccessful", MessageBoxButtons.OK, MessageBoxIcon.Information);
                     return(null);
                 }
                 else
                 {
                     return(ds.Tables[0].Rows[0]["name"].ToString());
                 }
             }
             return(null);
         }
         else
         {
             DataSet ds = dr.getReviewer(username, encryptedPassword);
             if (ds != null)
             {
                 int count = ds.Tables[0].Rows.Count;
                 if (count == 0)
                 {
                     MetroFramework.MetroMessageBox.Show(login, "Username or Password is incorrect", "Login was unsuccessful", MessageBoxButtons.OK, MessageBoxIcon.Information);
                     return(null);
                 }
                 else
                 {
                     return(ds.Tables[0].Rows[0]["name"].ToString());
                 }
             }
             return(null);
         }
     }
 }
Пример #15
0
 private void Select_Server_Form_FormClosing(object sender, FormClosingEventArgs e)
 {
     Login_Form.GetInstance().get_server();
     Login_Form.GetInstance().Show();
 }
Пример #16
0
 public void Fundform_Login(Login_Form login)
 {
     this.login = login;
 }