Beispiel #1
0
        private void btn_Demo_Click(object sender, EventArgs e)
        {
            Hide();
            frm_Main Main = new frm_Main();

            Main.UserID = 1;
            Main.Demo   = true;
            Main.Show();
        }
Beispiel #2
0
        private void btn_Login_Click(object sender, EventArgs e)
        {
            frm_Main Main = new frm_Main();

            Main.UserID        = user_id;
            Main.btn_User.Text = txt_Name.Text;
            Main.Show();
            Properties.Settings.Default.LoginUser = txt_Name.Text;
            Properties.Settings.Default.Save();
            Hide();

            //BL.BL.Users users = new BL.BL.Users();

            //users.Name = txt_Name.Text;
            //users.Password = txt_Password.Text;

            //DataTable dt = new DataTable();
            //dt = users.Select();

            //foreach (DataRow r in dt.Rows)
            //{
            //    if (r["Name"].ToString() == users.Name && r["Password"].ToString() == users.Password)
            //    {
            //        Hide();
            //        string c = CheckAth();
            //        if (c == "OK")
            //        {
            //            frm_Main Main = new frm_Main();
            //            user_id = Convert.ToInt32(r["ID"]);
            //            Main.UserID = user_id;
            //            Main.btn_User.Text = txt_Name.Text;
            //            Main.Show();
            //            Properties.Settings.Default.LoginUser = txt_Name.Text;
            //            Properties.Settings.Default.Save();
            //            return;
            //        }
            //        else
            //        {
            //            frm_PreventNo p = new frm_PreventNo();
            //            p.UserID = Convert.ToInt16(r["ID"]);
            //            p.Case = c;
            //            p.ShowDialog();
            //            return;
            //        }
            //    }
            //}
            //MessageBox.Show("أسم المستخدم أو كلمة المرور غير صحيحة", "خطأ في بيانات الدخول", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
        }
Beispiel #3
0
        private void btn_Run_Click(object sender, EventArgs e)
        {
            if (txt_Run.Text.Length != 6)
            {
                return;
            }

            int q = (Convert.ToInt32(txt_Authorization.Text.Substring(1, 1)) * 5);
            int w = (Convert.ToInt32(txt_Authorization.Text.Substring(2, 1)) * 4);
            int t = (Convert.ToInt32(txt_Authorization.Text.Substring(3, 1)) * 8);
            int r = (Convert.ToInt32(txt_Authorization.Text.Substring(4, 1)) * 6);


            string txt     = txt_Run.Text.Substring(0, 4);
            int    AddDays = Convert.ToInt32(txt_Run.Text.Substring(4, 2));
            string run     = q.ToString().Substring(0, 1) + w.ToString().Substring(0, 1) + t.ToString().Substring(0, 1) + r.ToString().Substring(0, 1);

            if (AddDays == 38)
            {
                AddDays = 3650;
            }
            else if (AddDays > 70)
            {
                AddDays = 70;
            }

            if (txt == run)
            {
                string i = Encrypt(id);
                Properties.Settings.Default.ID        = i;
                Properties.Settings.Default.d         = Encrypt(ExpireDate(AddDays));
                Properties.Settings.Default.LoginUser = "******";
                Properties.Settings.Default.Save();

                Hide();
                frm_Main Main = new frm_Main();
                Main.UserID = UserID;
                Main.Show();
            }
            else
            {
                Application.Exit();
            }
        }
Beispiel #4
0
        private void btn_Demo_Click_1(object sender, EventArgs e)
        {
            frm_Main Main = new frm_Main();

            Main.Show();
        }