コード例 #1
0
 public virtual Guid Update(Guid id, IDonorContract donorValue)
 {
     var donor = session.Get<Entities.Donor>(id);
     var referral = session.Get<Entities.Donor>(donorValue.ReferralId);
     if (donor != null)
     {
         donor.JoinDate = donorValue.JoinDate;
         donor.DonorStatus = donorValue.DonorStatus;
         donor.Name = donorValue.Name;
         donor.Email = donorValue.Email;
         donor.Mobile = donorValue.Mobile;
         donor.Telephone = donorValue.Telephone;
         donor.Referral = referral;
     }
     FlashMessenger.AddMessageByKey("UpdateDonorSuccess", FlashMessageType.Success);
     session.Save(donor);
     return id;
 }
コード例 #2
0
        public virtual Guid Update(Guid id, IDonorContract donorValue)
        {
            var donor    = session.Get <Entities.Donor>(id);
            var referral = session.Get <Entities.Donor>(donorValue.ReferralId);

            if (donor != null)
            {
                donor.JoinDate    = donorValue.JoinDate;
                donor.DonorStatus = donorValue.DonorStatus;
                donor.Name        = donorValue.Name;
                donor.Email       = donorValue.Email;
                donor.Mobile      = donorValue.Mobile;
                donor.Telephone   = donorValue.Telephone;
                donor.Referral    = referral;
            }
            FlashMessenger.AddMessageByKey("UpdateDonorSuccess", FlashMessageType.Success);
            session.Save(donor);
            return(id);
        }
コード例 #3
0
        public virtual Guid Add(IDonorContract donor)
        {
            var referral    = session.Get <Entities.Donor>(donor.ReferralId);
            var donorObject = new Entities.Donor()
            {
                Id          = new Guid(),
                JoinDate    = donor.JoinDate,
                DonorStatus = donor.DonorStatus,
                Name        = donor.Name,
                Email       = donor.Email,
                Mobile      = donor.Mobile,
                Telephone   = donor.Telephone,
                Referral    = referral
            };

            session.Save(donorObject);
            this.FlashMessenger.AddMessageByKey("CreateDonorSuccess", FlashMessageType.Success);
            return(donorObject.Id);
        }
コード例 #4
0
       public virtual Guid Add(IDonorContract donor)
       {
           var referral = session.Get<Entities.Donor>(donor.ReferralId);
           var donorObject = new Entities.Donor()
           {
               Id = new Guid(),
               JoinDate = donor.JoinDate ,
               DonorStatus = donor.DonorStatus,
               Name = donor.Name,
               Email = donor.Email,
               Mobile = donor.Mobile,
               Telephone = donor.Telephone,
               Referral = referral
           };

           session.Save(donorObject);
           this.FlashMessenger.AddMessageByKey("CreateDonorSuccess" , FlashMessageType.Success);
           return donorObject.Id;
       }