internal bool Load(HRPaidTimeOffDataContext db, ENTNotificationEO.NotificationType notificationType, int entUserAccountId) { //Get the entity object from the DAL. ENTNotification eNTNotificationENTUserAccount = new ENTNotificationData().SelectByIdENTUserAccountId(db, (int)notificationType, entUserAccountId); MapEntityToProperties(eNTNotificationENTUserAccount); return(eNTNotificationENTUserAccount != null); }
public override bool Load(int id) { //Get the entity object from the DAL. ENTNotification eNTNotification = new ENTNotificationData().Select(id); MapEntityToProperties(eNTNotification); return(eNTNotification != null); }
internal bool Load(HRPaidTimeOffDataContext db, int id) { //Get the entity object from the DAL. ENTNotification eNTNotification = new ENTNotificationData().Select(db, id); MapEntityToProperties(eNTNotification); return(eNTNotification != null); }
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 ENTNotificationData().Insert(db, Description, FromEmailAddress, Subject, Body, userAccountId); } else { //Update if (!new ENTNotificationData().Update(db, ID, Description, FromEmailAddress, Subject, Body, userAccountId, Version)) { UpdateFailed(ref validationErrors); return(false); } } return(true); } else { //Didn't pass validation. return(false); } } else { throw new Exception("DBAction not Save."); } }