public virtual Guid Update(Guid id, IDonationCaseContract value)
 {
     var persistedObject = session.Get<Entities.DonationCase>(id);
     if (persistedObject != null)
     {
         Mapper.Map<IDonationCaseContract, Entities.DonationCase>(value, persistedObject);
     }
     
     session.Save(persistedObject);
     this.flashMessenger.AddMessageByKey("SaveDonationCaseSuccess", FlashMessageType.Success);
     return id;
 }
        public virtual Guid Update(Guid id, IDonationCaseContract value)
        {
            var persistedObject = session.Get <Entities.DonationCase>(id);

            if (persistedObject != null)
            {
                Mapper.Map <IDonationCaseContract, Entities.DonationCase>(value, persistedObject);
            }

            session.Save(persistedObject);
            this.flashMessenger.AddMessageByKey("SaveDonationCaseSuccess", FlashMessageType.Success);
            return(id);
        }
        public virtual Guid Add(IDonationCaseContract value)
        {
            var persistedObject = new Entities.DonationCase
            {
                DonationCaseStatus = value.DonationCaseStatus,
                EndDate            = value.EndDate,
                Name      = value.Name,
                StartDate = value.StartDate,
                Id        = Guid.NewGuid()
            };

            session.Save(persistedObject);
            this.flashMessenger.AddMessageByKey("CreateDonationCaseSuccess", FlashMessageType.Success);
            return(persistedObject.Id);
        }
       public virtual Guid Add(IDonationCaseContract value)
       {
           var persistedObject = new Entities.DonationCase
           {
               DonationCaseStatus = value.DonationCaseStatus,
               EndDate = value.EndDate,
               Name = value.Name,
               StartDate = value.StartDate,
               Id = Guid.NewGuid()
           };

           session.Save(persistedObject);
           this.flashMessenger.AddMessageByKey("CreateDonationCaseSuccess" , FlashMessageType.Success);
           return persistedObject.Id;
       }