Exemplo n.º 1
0
 public Promotion(Promotion promotion, ContextModels.Account user)
     : this(user)
 {
     Name         = promotion.Name + " Копия";
     Annotation   = promotion.Annotation;
     MediaFile    = promotion.MediaFile;
     AllSuppliers = promotion.AllSuppliers;
     RegionMask   = promotion.RegionMask;
     PromotionToDrug.AddEach(promotion.PromotionToDrug.Select(x => new PromotionToDrug(x.DrugId, x.PromotionId)));
     PromotionsToSupplier.AddEach(promotion.PromotionsToSupplier.Select(x => new PromotionsToSupplier(x.PromotionId, x.SupplierId)));
 }
Exemplo n.º 2
0
 public Promotion(ContextModels.Account user)
     : this()
 {
     Name         = "";
     Annotation   = "";
     UpdateTime   = DateTime.Now;
     Enabled      = true;
     Status       = PromotionStatus.New;
     ProducerId   = user.AccountCompany.ProducerId.Value;
     Begin        = DateTime.Today;
     End          = DateTime.Today;
     AllSuppliers = true;
     unchecked {
         RegionMask = (long)ulong.MaxValue;
     }
 }
Exemplo n.º 3
0
 public virtual bool CheckSecurity(ContextModels.Account user)
 {
     return(user.AccountCompany?.ProducerId == ProducerId);
 }