public ActionResult login(string Password, string Email)
        {
            if (Email != null || Password != null)
            {
                LoginModel login = new LoginModel();
                login.Email    = Email;
                login.Password = Password;
                IHttpActionResult user = new UserappsapiController().Postlogin(login);

                var x = user as OkNegotiatedContentResult <Error>;
                if (x.Content.Status != 0)
                {
                    if (x.Content.Status == 1)
                    {
                        Session["userRole"] = "admin";
                    }
                    else if (x.Content.Status == 2)
                    {
                        Session["userRole"] = "user";
                    }
                    Session["userRole1"] = x.Content.userapps.uR.ToString();
                    ViewBag.role         = x.Content.userapps.uR;
                    return(RedirectToAction("Index", "products"));
                }
            }

            return(View());
        }
        public ActionResult register([Bind(Include = "userId,name,Email,Password,phone,country,image")] Userapp userapp, HttpPostedFileBase file)
        {
            IHttpActionResult user = new UserappsapiController().PostRejester(userapp);
            HomeController    home = new HomeController();

            home.FileUpload(file);
            var x = user as OkNegotiatedContentResult <Error>;

            if (x.Content.Status != 0)
            {
                if (x.Content.Status == 1)
                {
                    Session["userRole"] = "admin";
                }
                if (x.Content.Status == 2)
                {
                    Session["userRole"] = "user";
                }
                Session["userRole"] = x.Content.userapps.uR.ToString();
                return(RedirectToAction("Index", "products"));
            }

            return(View(userapp));
        }