public bool SaveAttendeeDetrails(AthleteTestAttendeesModel objAttendee)
 {
     if (objAttendee.Id > 0)
     {
         AthleteTestAttendeesModel obj = _context.TblAthleteTestAttendees.Find(objAttendee.Id);
         obj.UserId             = objAttendee.UserId;
         obj.TestAttributeValue = objAttendee.TestAttributeValue;
         obj.UpdatedBy          = Convert.ToInt64(HttpHelper.GetSessionString(Constants.SessionUserId));
         obj.UpdatedDate        = DateTime.Now;
         _context.TblAthleteTestAttendees.Update(obj);
         _context.SaveChanges();
     }
     else
     {
         objAttendee.CreatedBy = Convert.ToInt64(HttpHelper.GetSessionString(Constants.SessionUserId));
         _context.TblAthleteTestAttendees.Add(objAttendee);
         _context.SaveChanges();
     }
     return(true);
 }
Example #2
0
 public bool SaveTestDetials(AthleteTestMasterModel tblAthleteTestMaster)
 {
     if (tblAthleteTestMaster.Id > 0)
     {
         AthleteTestMasterModel obj = _context.TblAthleteTestMaster.Find(tblAthleteTestMaster.Id);
         obj.TestTypeId  = tblAthleteTestMaster.TestTypeId;
         obj.TestDate    = tblAthleteTestMaster.TestDate;
         obj.UpdatedBy   = Convert.ToInt64(HttpHelper.GetSessionString(Constants.SessionUserId));
         obj.UpdatedDate = DateTime.Now;
         _context.TblAthleteTestMaster.Update(obj);
         _context.SaveChanges();
     }
     else
     {
         tblAthleteTestMaster.CreatedBy = Convert.ToInt64(HttpHelper.GetSessionString(Constants.SessionUserId));
         _context.TblAthleteTestMaster.Add(tblAthleteTestMaster);
         _context.SaveChanges();
     }
     return(true);
 }