public ActionResult Login(Employee employee, string returnUrl)
 {
     try
     {
         bool status = empLogic.Login(employee);
         var  data   = empLogic.GetEmployeeDetailsById(employee.UserId);
         if (status)
         {
             FormsAuthentication.SetAuthCookie(employee.UserId.ToString(), false);
             FormsAuthentication.RedirectFromLoginPage(employee.UserId.ToString(), false);
             if (Url.IsLocalUrl(returnUrl))
             {
                 return(Redirect(returnUrl));
             }
             else
             {
                 if (data.RegistrationStatus == "Approved")
                 {
                     TempData["Msg"]          = "Welcome to Employee Deshboard <br/> Your User id is : " + employee.UserId;
                     TempData["userId"]       = employee.UserId;
                     TempData["userCategory"] = employee.userCategory;
                     return(RedirectToAction("Index"));
                 }
                 else if (data.RegistrationStatus == "Rejected")
                 {
                     TempData["Msg"] = "Request rejected ! Contact Admin for more information.";
                     return(RedirectToAction("Login"));
                 }
                 else if (data.RegistrationStatus == "Pending")
                 {
                     TempData["Msg"] = "Hello " + data.First_name + ", <br/> Your Request is still pending <br/> Please Wait For Request Approval <br/> Thank You";
                     return(RedirectToAction("HomePage"));
                 }
                 else
                 {
                     TempData["status"] = "false";
                     return(View());
                 }
             }
         }
         else
         {
             TempData["status"] = "false";
             return(RedirectToAction("Login"));
         }
     }
     catch (Exception)
     {
         TempData["status"] = "false";
         return(View());
     }
 }