private async Task Surveys_Refresh(object sender, EventArgs e)
        {
            await GetSurveys();

            SurveyList.ItemsSource = Surveys.Surveys;
            SurveyList.EndRefresh();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Binds the SurveyList dropdown to list of Surveys in meta table
        /// </summary>
        protected void BuildSurveyList()
        {
            DataView surveys = BusinessObject.GetAllAsDataView <MetadataSurvey>();

            surveys.Sort          = MetadataSurvey.SurveyType + " ASC";
            SurveyList.DataSource = surveys;
            SurveyList.DataBind();
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            LocalizePage();
            MessageLabel.Visible = false;

            if (!Page.IsPostBack)
            {
                SurveyList.SurveyId = SurveyId;
                SurveyList.BindDropDown();
                // Header.SurveyId = SurveyId;
                ((Wap)((PageBase)Page).Master).HeaderControl.SurveyId = SurveyId;
                FillFields();
            }
        }
Exemplo n.º 4
0
        // GET: Preview
        public ActionResult Index()
        {
            ViewBag.PageTitle = "Indian Decision | Preview";

            List <SurveyVO> objSurveyList = _surveyBizManager.GetAllSurvey(null, null, null, false);

            var viewModel = new SurveyList
            {
                ListSurvey = objSurveyList,
            };

            ViewBag.Heading = "Survey Preview";
            return(View("../admin/preview/index", viewModel));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            LocalizePage();

            if (!Page.IsPostBack)
            {
                SurveyList.SurveyId = SurveyId;
                SurveyList.BindDropDown();
                // Header.SurveyId = SurveyId;
                ((Wap)((PageBase)Page).Master).HeaderControl.SurveyId = SurveyId;
                FillFields();
            }

            BuildAddInList();
        }
Exemplo n.º 6
0
        public ActionResult SurveyByCategory(int?page, int CategoryId, String CategoryName)
        {
            List <CategoryVO> objCategoryList = new List <CategoryVO>();
            List <SurveyVO>   objSurveyList   = _surveyBizManager.GetAllSurvey(null, CategoryId, null, true);

            foreach (SurveyVO ObjSurvey in objSurveyList)
            {
                if (CheckCookie("Voted_" + ObjSurvey.SurveyId))
                {
                    ObjSurvey.IsVoted   = true;
                    ObjSurvey.VoteValue = GetCookie("Voted_" + ObjSurvey.SurveyId);
                }
                if (CheckCookie("Rated_" + ObjSurvey.SurveyId))
                {
                    ObjSurvey.IsRated   = true;
                    ObjSurvey.RateValue = GetCookie("Rated_" + ObjSurvey.SurveyId);
                }
            }

            var pager = new Pager(objSurveyList.Count(), page);

            var viewModel = new SurveyList
            {
                ListSurvey = objSurveyList.Skip((pager.CurrentPage - 1) * pager.PageSize).Take(pager.PageSize).ToList(),
                Pager      = pager
            };

            ViewBag.Heading   = CategoryName;
            ViewBag.PageTitle = CategoryName;
            ViewBag.Link      = "survey/" + CategoryId + "/get-survey/" + CategoryName + "?page=";

            if (Session["Categories"] == null)
            {
                objCategoryList = _categoryBizManager.GetAllCategory(null, true);

                Session["Categories"] = objCategoryList;
            }
            else
            {
                objCategoryList = Session["Categories"] as List <CategoryVO>;
            }

            ViewBag.SurveyCategory = objCategoryList;

            return(View("../User/home/index", viewModel));
        }
Exemplo n.º 7
0
        // GET: Home
        public ActionResult Index(int?page)
        {
            ViewBag.PageTitle = "Home | Indian Decision";
            List <CategoryVO> objCategoryList = new List <CategoryVO>();

            List <SurveyVO> objSurveyList = _surveyBizManager.GetAllSurvey(null, null, null, true);

            if (Session["Categories"] == null)
            {
                objCategoryList       = _categoryBizManager.GetAllCategory(null, true);
                Session["Categories"] = objCategoryList;
            }
            else
            {
                objCategoryList = Session["Categories"] as List <CategoryVO>;
            }

            foreach (SurveyVO ObjSurvey in objSurveyList)
            {
                if (CheckCookie("Voted_" + ObjSurvey.SurveyId))
                {
                    ObjSurvey.IsVoted   = true;
                    ObjSurvey.VoteValue = GetCookie("Voted_" + ObjSurvey.SurveyId);
                }
                if (CheckCookie("Rated_" + ObjSurvey.SurveyId))
                {
                    ObjSurvey.IsRated   = true;
                    ObjSurvey.RateValue = GetCookie("Rated_" + ObjSurvey.SurveyId);
                }
            }

            var pager = new Pager(objSurveyList.Count(), page);

            var viewModel = new SurveyList
            {
                ListSurvey = objSurveyList.Skip((pager.CurrentPage - 1) * pager.PageSize).Take(pager.PageSize).ToList(),
                Pager      = pager
            };

            ViewBag.Heading        = "Latest Survey";
            ViewBag.Link           = "home/index?page=";
            ViewBag.SurveyCategory = objCategoryList;
            return(View("../user/home/index", viewModel));
        }
Exemplo n.º 8
0
        public void SetAdminSection(string TabValue)
        {
            RemoveChild();
            pnlContainerDP.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
            switch (TabValue)
            {
            case "SurveyList":

                surveylist = new SurveyList();
                surveylist.Focus();
                surveylist.mdiWinow = this;
                pnlContainerDP.Children.Add(surveylist);
                pnlContainerDP.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
                break;

            case "AddEditSurvey":
                addeditsurvey = new AddEditSurvey();
                addeditsurvey.Focus();
                addeditsurvey.mdiWinow = this;
                pnlContainerDP.Children.Add(addeditsurvey);
                break;

            case "AddEditSurveyStep2":
                addeditsurveystep2 = new AddEditSurveyStep2();
                addeditsurveystep2.Focus();
                addeditsurveystep2.mdiWinow = this;
                pnlContainerDP.Children.Add(addeditsurveystep2);
                break;

            case "AddEditSurveyStep3":
                addeditsurveystep3 = new AddEditSurveyStep3();
                addeditsurveystep3.Focus();
                addeditsurveystep3.mdiWinow = this;
                pnlContainerDP.Children.Add(addeditsurveystep3);
                break;

            case "AddEditSurveyStep4":
                addeditsurveystep4 = new AddEditSurveyStep4();
                addeditsurveystep4.Focus();
                addeditsurveystep4.mdiWinow = this;
                pnlContainerDP.Children.Add(addeditsurveystep4);
                break;
            }
        }
Exemplo n.º 9
0
 private void Surveys_Refresh(object sender, EventArgs e)
 {
     GetSurveys();
     SurveyList.ItemsSource = Surveys;
     SurveyList.EndRefresh();
 }