Exemplo n.º 1
0
        private void BaseButton_OK_Click(object sender, EventArgs e)
        {
            //for (int i = 0; i < list.Count; i++)
            //{
            //    list.Add(taskAll[i]);
            //    task.D1OfSale = list[i];
            //}

            DataToTask();

            Confirm?.Invoke(task);
            SearchConfirm?.Invoke(search);
            this.DialogResult = DialogResult.OK;
        }
Exemplo n.º 2
0
        public ActionResult AdsList(string search, int?page, ItemsPerPage itemsPerPage = ItemsPerPage.p05, SearchConfirm searchconfirm = SearchConfirm.all)
        {
            try
            {
                var    query  = from obj in _ctx.Houses select obj;
                string header = "";
                switch (searchconfirm)
                {
                case 0:
                    query  = query.Where(x => x.IsConfirmed == Confirmation.Pass);
                    header = "Έγγκεκριμένες αγγελίες ";
                    break;

                case (SearchConfirm)1:
                    query  = query.Where(x => x.IsConfirmed == Confirmation.Pending);
                    header = "Εκκρεμών αγγελίες";
                    break;

                case (SearchConfirm)2:
                    query  = query.Where(x => x.IsConfirmed == Confirmation.Cancel);
                    header = "Απορριφθέντες αγγελίες";
                    break;

                default:
                    header = "Όλες οι αγγελίες";
                    break;
                }

                var houses = query
                             .Include(x => x.Area)
                             .Include(x => x.State)
                             .Include(x => x.User)
                             .OrderByDescending(x => x.Created)
                             .ToList().ToPagedList(page ?? 1, (int)itemsPerPage);


                AdminSearchViewModel vm = new AdminSearchViewModel
                {
                    Houses        = houses,
                    ItemsPerPage  = itemsPerPage,
                    SearchConfirm = searchconfirm,
                };
                ViewBag.Header = header;
                return(View(vm));
            }
            catch (Exception ex)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, $"{ex.Message}"));
            }
        }