Exemple #1
0
        public async Task <bool> LogOff()
        {
            ITokenContainer tokenContainer = new TokenContainer();

            ApiHelper.Client.ApiClient client = new ApiHelper.Client.ApiClient(HttpClientInstance.Instance, tokenContainer);
            GenericClient cb = new GenericClient(client);
            await cb.Post("Account/LogOff", new { });

            return(true);
        }
Exemple #2
0
        public async Task <ApiResponse> Register(LoginViewModel data)
        {
            ITokenContainer tokenContainer = new TokenContainer();

            ApiHelper.Client.ApiClient client = new ApiHelper.Client.ApiClient(HttpClientInstance.Instance, tokenContainer);
            GenericClient cb       = new GenericClient(client);
            var           response = await cb.Post("Account/CreatePassword", data);

            return(response);
        }
        public async Task <ActionResult> GetSubscriptionData()
        {
            string EnableSubscriptionFee = ConfigurationManager.AppSettings["EnableMamarSubscriptionFee"];

            if (!string.IsNullOrEmpty(EnableSubscriptionFee) && EnableSubscriptionFee != "__EnableMamarSubscriptionFee__" && Convert.ToBoolean(EnableSubscriptionFee))
            {
                string token = Request.Cookies["MAQTA-LOCAL-TOKEN"].Value;
                if (token == null)
                {
                    return(Json(new
                    {
                        redirectUrl = Url.Action("LogOff", "Account"),
                        isRedirect = true
                    }, JsonRequestBehavior.AllowGet));
                }
                ApiHelper.Client.ApiClient client = new ApiHelper.Client.ApiClient(HttpSubscriptionClient.Instance, token);
                GenericClient cb       = new GenericClient(client);
                var           response = await cb.Get("subscription/SubscriptionStatus");

                var objSubscription = JsonConvert.DeserializeObject <SubscriptionStatusResponse>(response.ResponseResult);
                if (objSubscription.isRestricted)
                {
                    return(Json(new ApiResponse()
                    {
                        StatusIsSuccessful = false, ResponseResult = "Subscription Disabled"
                    }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(response, JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                return(Json(new ApiResponse()
                {
                    StatusIsSuccessful = false, ResponseResult = "Subscription Disabled"
                }, JsonRequestBehavior.AllowGet));
            }
        }