Example #1
0
 public void Index([DataBind("filter")] PromotionFilter filter)
 {
     PropertyBag["filter"]                 = filter;
     PropertyBag["systemTime"]             = SystemTime.Now().AddDays(3).Date;
     PropertyBag["promotions"]             = filter.Find <SupplierPromotion>();
     PropertyBag["promotionsPremoderated"] = DbSession.Query <SupplierPromotion>().Where(s => s.Moderator == null && s.Moderated == false).OrderBy(d => d.Begin).ToList();
     PropertyBag["SortBy"]                 = Request["SortBy"];
     PropertyBag["Direction"]              = Request["Direction"];
 }
Example #2
0
        public void ChangeDisabled(uint id, [DataBind("filter")] PromotionFilter filter)
        {
            var promotion = DbSession.Load <SupplierPromotion>(id);

            promotion.AgencyDisabled = !promotion.AgencyDisabled;
            Notify("Сохранено");
            promotion.UpdateStatus();
            DbSession.Save(promotion);
            RedirectToAction("Index", filter.ToUrl());
        }