Exemple #1
0
 public JsonResult GetAllTemplateInformation()
 {
     //var username = "******";
     var headers = new HeaderManager(Request);
     M2ESession session = TokenManager.getSessionInfo(headers.AuthToken, headers);
     var userTemplateList = new UserProductSurveyTemplateService();
     var isValidToken = TokenManager.IsValidSession(headers.AuthToken);
     if (isValidToken)
     {
         return Json(userTemplateList.GetAllTemplateInformation(session.UserName));
     }
     else
     {
         ResponseModel<string> response = new ResponseModel<string>();
         response.Status = 401;
         response.Message = "Unauthorized";
         return Json(response);
     }
     
    
 }
Exemple #2
0
        public JsonResult GetUserActiveThreads()
        {
            //var username = "******";
            var status = Request.QueryString["status"].ToString(CultureInfo.InvariantCulture);
            var headers = new HeaderManager(Request);
            M2ESession session = TokenManager.getSessionInfo(headers.AuthToken, headers);
            var userTemplateList = new UserProductSurveyTemplateService();            
            var isValidToken = TokenManager.IsValidSession(headers.AuthToken);
            if (isValidToken)
            {
                return Json(userTemplateList.GetUserActiveThreads(session.UserName, status));
            }
            else
            {
                ResponseModel<string> response = new ResponseModel<string>();
                response.Status = 401;
                response.Message = "Unauthorized";
                return Json(response);
            }
            

        }
Exemple #3
0
        public JsonResult AllocateThreadToUserByRefKey()
        {
            //var username = "******";
            ResponseModel<string> response = new ResponseModel<string>();
            var refKey = Request.QueryString["refKey"].ToString(CultureInfo.InvariantCulture);
            var headers = new HeaderManager(Request);
            M2ESession session = TokenManager.getSessionInfo(headers.AuthToken, headers);
            var userTemplateList = new UserProductSurveyTemplateService();            
            var isValidToken = TokenManager.IsValidSession(headers.AuthToken);
            if (isValidToken)
            {
                response = userTemplateList.AllocateThreadToUserByRefKey(refKey, session.UserName);
            }
            else
            {                
                response.Status = 401;
                response.Message = "Unauthorized";                
            }
            return Json(response);

        }