Exemple #1
0
 public BadgeAwardEditDTO Update(BadgeAwardEditDTO data)
 {
     using (var ctx = new Entities())
     {
         ctx.Database.Connection.Open();
         var saveBadgeAward = ctx.BadgeAwards.Where(ba => ba.BadgeAwardId == data.Id).Single();
         saveBadgeAward.AwardAmount = data.AwardAmount;
         ctx.SaveChanges();
     }
     return(data);
 }
 internal void LoadData(BadgeAwardEditDTO item)
 {
     using (this.BypassPropertyChecks)
     {
         this.Id             = item.Id;
         this.EmployeeId     = item.EmployeeId;
         this.EmployeeADName = item.EmployeeADName;
         this.BadgeId        = item.BadgeId;
         this.BadgeName      = item.BadgeName;
         this.AwardDate      = item.AwardDate;
         this.AwardAmount    = item.AwardAmount;
     }
 }
        private BadgeAwardEditDTO UnloadData()
        {
            var returnValue = new BadgeAwardEditDTO();

            using (this.BypassPropertyChecks)
            {
                returnValue.Id             = this.Id;
                returnValue.EmployeeId     = this.EmployeeId;
                returnValue.EmployeeADName = this.EmployeeADName;
                returnValue.BadgeId        = this.BadgeId;
                returnValue.BadgeName      = this.BadgeName;
                returnValue.AwardDate      = this.AwardDate;
                returnValue.AwardAmount    = this.AwardAmount;
            }
            return(returnValue);
        }