Example #1
0
        private void submitBtn_Click(object sender, RoutedEventArgs e)
        {
            UserMaster usrmasterRef = new UserMaster();

            usrmasterRef.mobileNo = mobileNotxt.Text.Trim();

            if (passwordBoxsample.Password.Trim() == "")
            {
                MessageBox.Show("Please enter password !");
            }
            else
            {
                usrmasterRef.pwd = passwordBoxsample.Password.Trim();
                UserMasterDAO usrmasterDAORef = new UserMasterDAOImpl();
                int           i = usrmasterDAORef.login(usrmasterRef);
                if (i == 1)
                {
                    radCarouse1 r = new radCarouse1();
                    r.Show();
                    Hide();
                }
                else if (i == 0)
                {
                    mobileNotxt.Text           = "";
                    passwordBoxsample.Password = "";
                    MessageBox.Show("invalid credential!");
                }
            }
        }
Example #2
0
        private void submitbtn_Click(object sender, EventArgs e)
        {
            UserMaster usrmasterRef = new UserMaster();

            usrmasterRef.mobileNo = mobileNoTxt.Text.Trim();
            usrmasterRef.pwd      = pwdTxt.Text.Trim();
            RoleMaster role = new RoleMaster();


            usrmasterRef.designationRef = role;
            UserMasterDao usrmasterDAORef = new UserMasterDAOImpl();
            UserMaster    usrmasterRef1   = usrmasterDAORef.login(usrmasterRef);

            username = usrmasterRef1.username;
            mobileNo = usrmasterRef1.mobileNo;
            EmailId  = usrmasterRef1.emailId;
            if (usrmasterRef1 != null)
            {
                Console.WriteLine("Role Name ={0}", usrmasterRef1.designationRef.roleName);
                if (usrmasterRef1.designationRef.roleName == "Manager")
                {
                    manager Check = new manager();
                    Check.Show();
                    Hide();
                }
                else if (usrmasterRef1.designationRef.roleName == "Waiter")
                {
                    Waiter Check = new Waiter();
                    Check.Show();
                    Hide();
                }
                else if (usrmasterRef1.designationRef.roleName == "Admin")
                {
                    adminpage Check = new adminpage();
                    Check.Show();
                    Hide();
                }
            }

            else
            {
                MessageBox.Show("couln't login");
            }
        }