Пример #1
0
        public PartnerModel GetCreateModel()
        {
            var model = new PartnerModel();

            this.FillPartnerModel(model);

            return model;
        }
Пример #2
0
        public long CreatePartner(PartnerModel model)
        {
            var partner = new PartnerEntity { Name = model.Name, Disabled = model.Disabled };

            this.Manager.Create(partner);

            return partner.Id;
        }
Пример #3
0
        public PartnerModel GetEditModel(long id)
        {
            var partner = this.Manager.Load(id);

            var model = new PartnerModel { PartnerId = partner.Id, Name = partner.Name, Disabled = partner.Disabled };

            this.FillPartnerModel(model);

            return model;
        }
Пример #4
0
        public long UpdatePartner(PartnerModel model)
        {
            Contract.Assert(model.PartnerId.HasValue);

            var partner = this.Manager.Load(model.PartnerId.Value);

            partner.Name = model.Name;
            partner.Disabled = model.Disabled;

            using (var tx = new Transaction())
            {
                this.Manager.Update(partner);

                tx.Complete();
            }

            return partner.Id;
        }
Пример #5
0
 public void FillPartnerModel(PartnerModel model)
 {
 }