コード例 #1
0
        protected void changepass_btn_Click(object sender, EventArgs e)
        {
            EmpRegistration obj = new EmpRegistration();

            obj.Eusername = Session["employee"].ToString();
            obj.Newpwd    = tbconfirm_pass.Text;
            obj.UpdateEmployregPassword();
            obj.UpdateEmployloginPassword();
            if (tbnew_pass.Text == tbconfirm_pass.Text)
            {
                lbsuccess.Visible = true;
            }
        }
コード例 #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            EmpRegistration = await _context.EmpRegistration.FirstOrDefaultAsync(m => m.Empid == id);

            if (EmpRegistration == null)
            {
                return(NotFound());
            }
            return(Page());
        }
コード例 #3
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            EmpRegistration = await _context.EmpRegistration.FindAsync(id);

            if (EmpRegistration != null)
            {
                _context.EmpRegistration.Remove(EmpRegistration);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
コード例 #4
0
        private void login()
        {
            if (isEmpty())
            {
                DataTable userTable;
                userTable = dataAccess.GetData <Users>($"where UserName = '******' and Password = '******'");

                if (userTable.Rows.Count > 0)
                {
                    if (userTable.Rows[0].Field <int>("UserType") == (int)Users.UserTypeEnum.Admin)
                    {
                        AdminHomeForm adminHome = new AdminHomeForm(userTable);
                        adminHome.Show();
                        this.Hide();
                    }
                    else if (userTable.Rows[0].Field <int>("UserType") == (int)Users.UserTypeEnum.Employee)
                    {
                        if (userTable.Rows[0].Field <bool>("Information_given"))
                        {
                            DataTable employeeTable = dataAccess.GetData <Employee>($"where User_id = '{userTable.Rows[0].Field<int>("id")}'");
                            if (employeeTable.Rows[0].Field <int>("Designation") == (int)Employee.DesignationEnum.Manager)
                            {
                                EmpHomeForm employeeHome = new EmpHomeForm(userTable);
                                employeeHome.Show();
                                this.Hide();
                            }
                            else
                            {
                                MessageBox.Show("You are not a manager So you can't Login to the home page!!!");
                            }
                        }
                        else
                        {
                            EmpRegistration employeeRegistration = new EmpRegistration(userTable);
                            employeeRegistration.Show();
                            this.Hide();
                        }
                    }
                    else if (userTable.Rows[0].Field <int>("UserType") == (int)Users.UserTypeEnum.Customer)
                    {
                        DataTable customerTable = dataAccess.GetData <Customers>($"where User_Id = '{userTable.Rows[0].Field<int>("Id")}'");
                        if (customerTable.Rows[0].Field <bool>("Is_verified"))
                        {
                            CustHomeForm customeerHome = new CustHomeForm(userTable);
                            customeerHome.Show();
                            this.Hide();
                        }
                        else
                        {
                            MessageBox.Show("Please wait for verification");
                        }
                    }
                }
                else
                {
                    MessageBox.Show("UserName or Password is not correct!!!");
                    errorProvider1.SetError(txtUserName, "User Name maybe wrong!!!");
                    errorProvider1.SetError(txtPassword, "Password Maybe wrong!!!");
                }
            }
        }