public async Task <ActionResult> Register(Account model)
        {
            _EmployeesManager = new commonEmployeesEntities();
            _AccountManager   = new lear_DailiesCertificationRequirementEntities();

            // Check if model is Valid
            if (ModelState.IsValid)
            {
                // Check if password is Match
                System.Diagnostics.Debug.WriteLine(Request["Confirm"].ToString() + "___" + model.Password);
                if (model.Password == Request["Confirm"].ToString())
                {
                    // Check if BadgeNo is exist!;
                    var user = _EmployeesManager.Employees_Details.Where(u => u.Employee_ID == model.BagdeNo).SingleOrDefault();
                    if (user != null)
                    {
                        // Check if account is already exist
                        var account = _AccountManager.Users.Where(a => a.BadgeNo == model.BagdeNo).SingleOrDefault();
                        if (account != null)
                        {
                            ModelState.AddModelError("", "Account already exist");
                        }
                        else //if not save to User table
                        {
                            var users = _EmployeesManager.Database.SqlQuery <Approver>("Select * from approvers").ToList <Approver>();
                            model.Roles = "Default";
                            foreach (Approver app in users)
                            {
                                System.Diagnostics.Debug.WriteLine(app.approver);
                                if (model.BagdeNo.Equals(app.approver.ToString()))
                                {
                                    model.Roles = "Approver";
                                    break;
                                }
                            }
                            // Implement here Password:Encryption
                            PasswordSecurity ps = new PasswordSecurity();
                            var pass            = ps.Encryptdata(model.Password);
                            //System.Diagnostics.Debug.WriteLine(pass);

                            //System.Diagnostics.Debug.WriteLine(ps.Decryptdata(pass)+"DECRYPTED");
                            User useraccount = new User()
                            {
                                BadgeNo = model.BagdeNo, Roles = model.Roles, Password = pass
                            };
                            _AccountManager.Users.Add(useraccount);
                            _AccountManager.SaveChanges();

                            return(RedirectToAction("Home", "Home"));
                        }
                    }
                    else
                    {
                        ModelState.AddModelError("", "BadgeNo is not exist");
                    }
                }
                else
                {
                    ModelState.AddModelError("", "Password is not Match!");
                }
                //return RedirectToAction("Index", "Home");
            }
            return(View(model));
        }