예제 #1
0
        public static IEnumerable<Question> GetList(QuestionFilter filter= null)
        {
            string filterStr = null;
            if (filter != null && !(!filter.Id.HasValue && filter.Manager == null && filter.Product == null && !filter.States.Any(s => s.Checked) && !filter.Top.HasValue))
            {
                filterStr = String.Format("?id={0}&managerSid={1}&queStates={2}&top={3}&prodSid={4}",
                    filter.Id.HasValue ? filter.Id.Value.ToString() : null, filter.Manager != null && !String.IsNullOrEmpty(filter.Manager.AdSid) ? filter.Manager.AdSid : null, String.Join(",", filter.States.Where(s => s.Checked).Select(s => s.Id)), filter.Top.HasValue ? filter.Top.Value.ToString() : null, filter.Product != null && !String.IsNullOrEmpty(filter.Product.AdSid) ? filter.Product.AdSid : null);
            }

            Uri uri = new Uri(String.Format("{0}/Question/GetList{1}", OdataServiceUri, filterStr));
            string jsonString = GetJson(uri);
            var model = JsonConvert.DeserializeObject<IEnumerable<Question>>(jsonString);
            return model;
        }
 public ActionResult QueFilter(QuestionFilter qFilter)
 {
     return View("List", qFilter);
 }
 public ActionResult QueFilterClear(QuestionFilter qFilter)
 {
     var filter = new QuestionFilter();
     return View("List", filter);
 }
        public ActionResult List()
        {
            //var list = Question.GetList();
            ViewBag.Sid = Question.GetSid();

            var filter = new QuestionFilter();

            return View(filter);
        }