Exemple #1
0
        public JsonResult ResendServey(long SurveyId, DateTime dueDate)
        {
            string userId = "";
            long   Id     = _survey.UpdateSurveyDueDate(SurveyId, dueDate);

            if (Id > 0)
            {
                List <TblPoolSurvey> tblPools = _survey.GetPoolBySurveyId(SurveyId);
                foreach (var item in tblPools)
                {
                    var users = item.TblUserSurvey.Where(x => x.PoolSurveyId == item.Id).Select(x => x.UserId).ToList();
                    userId = "";
                    foreach (var id in users)
                    {
                        if (string.IsNullOrEmpty(userId))
                        {
                            userId = id.ToString();
                        }
                        else
                        {
                            userId = userId + id.ToString();
                        }
                    }

                    _survey.SendSurveyFromPool(Id, item.PoolTemplate.Id, userId, item.PoolTemplate);
                }
            }

            return(Json(new
            {
                status = "success",
            }));
        }