예제 #1
0
 public PromotionCreateModel(Promotion p)
 {
     this.Event = p.Event;
     this.Available = p.Available;
     this.Deals = p.Deals.ToList();
     this.MaxReferal = p.MaxReferal;
     //this.Taken = p.Taken;
 }
예제 #2
0
 public void Setup()
 {
     if (this.AccountBase != null && this.BusinessId != null)
     {
         var b = this.AccountBase.BusinessActions.GetBusiness(BusinessId);
         this.Business = AutoMapper.Mapper.Map<DataEntities.Business, ModelEntities.Business>(b);
         this.Promotion = new ModelEntities.Promotion(this.Business);
         this.IsValid = true;
     }
 }
예제 #3
0
        public Promotion ToPromotion()
        {
            Promotion p = new Promotion();
            p.Available = this.Available;
            p.Deals = this.Deals;
            p.Event = this.Event;

            p.MaxReferal = this.MaxReferal;
            return p;
        }
 public ActionResult Create(Promotion promotion)
 {
     try
     {
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
예제 #5
0
        public ActionResult Edit(Guid id, Entities.Promotion p)
        {
            try
            {
                // TODO: Add update logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
예제 #6
0
 public PromoCreateModel(AccountBase accountBase, Guid businessId, ModelEntities.Promotion promotion)
 {
     this.AccountBase = accountBase;
     this.BusinessId  = businessId;
     this.Promotion   = promotion;
 }