public ActionResult AddEmployee(DeleveryManDetail dm) { if ((string)Session["AdminMail"] == "*****@*****.**" && (string)Session["AdminPassword"] == "255242") { try { if (dm.name != null && dm.email != null && dm.adress != null && Convert.ToString(dm.phone) != null) { repo.AddEmployee(dm); repo.SendMail(dm.email); return(RedirectToAction(nameof(Index))); } return(RedirectToAction(nameof(AddEmployee))); } catch (Exception) { return(RedirectToAction(nameof(AddEmployee))); } } return(RedirectToAction(nameof(LogOut))); }