public override bool Save(HRPaidTimeOffDataContext db, ref ENTValidationErrors validationErrors, int userAccountId) { if (DBAction == DBActionEnum.Save) { //Validate the object Validate(db, ref validationErrors); //Check if there were any validation errors if (validationErrors.Count == 0) { if (IsNewRecord()) { //Add ID = new ENTWFOwnerGroupUserAccountData().Insert(db, ENTWFOwnerGroupId, ENTUserAccountId, userAccountId); } else { //Update if (!new ENTWFOwnerGroupUserAccountData().Update(db, ID, ENTWFOwnerGroupId, ENTUserAccountId, userAccountId, Version)) { UpdateFailed(ref validationErrors); return(false); } } return(true); } //Didn't pass validation. return(false); } throw new Exception("DBAction not Save."); }
public override bool Load(int id) { //Get the entity object from the DAL. var eNTWFOwnerGroupUserAccount = new ENTWFOwnerGroupUserAccountData().Select(id); MapEntityToProperties(eNTWFOwnerGroupUserAccount); return(true); }