Ejemplo n.º 1
0
        public ActionResult Login(string user, string pwd)
        {
            string cntroller = string.Empty, action = string.Empty;

            try
            {
                Tbl_LoginMaster obj = new Tbl_LoginMaster();
                if (MVCHelper.CheckLogin(user.Trim(), pwd.Trim(), ref obj))
                {
                    if (Convert.ToBoolean(obj.IsClient))
                    {
                        action = "Userpage"; cntroller = "IP";
                    }
                    else
                    {
                        action = "Home"; cntroller = "IP";
                    }
                }
                else
                {
                    action = "Login"; cntroller = "Login";
                    TempData["invalidmsg"] = "Wrong Credential!!!.";
                }
                return(RedirectToAction(action, cntroller));
            }
            catch (Exception ex)
            {
                TempData["invalidmsg"] = "Somthing wrong!!!.";
                return(View());
            }
        }