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 (ID <= 0) { //Add ID = new ENTRoleCapabilityData().Insert(db, ENTRoleId, Capability.ID, Convert.ToByte(AccessFlag), userAccountId); } else { //Update if (!new ENTRoleCapabilityData().Update(db, ID, ENTRoleId, Capability.ID, Convert.ToByte(AccessFlag), userAccountId, Version)) { UpdateFailed(ref validationErrors); return(false); } } return(true); } else { //Didn't pass validation. return(false); } } else { throw new Exception("DBAction not save."); } }
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 ENTEmailData().Insert(db, ToEmailAddress, CCEmailAddress, BCCEmailAddress, FromEmailAddress, Subject, Body, Convert.ToByte(EmailStatusFlag), userAccountId); } else { //Update if (!new ENTEmailData().Update(db, ID, ToEmailAddress, CCEmailAddress, BCCEmailAddress, FromEmailAddress, Subject, Body, Convert.ToByte(EmailStatusFlag), userAccountId, Version)) { UpdateFailed(ref validationErrors); return(false); } } return(true); } else { //Didn't pass validation. return(false); } } else { throw new Exception("DBAction not Save."); } }
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 HolidayData().Insert(db, HolidayName, HolidayDate, userAccountId); } else { //Update if (!new HolidayData().Update(db, ID, HolidayName, HolidayDate, userAccountId, Version)) { UpdateFailed(ref validationErrors); return(false); } } return(true); } else { //Didn't pass validation. return(false); } } else { throw new Exception("DBAction not Save."); } }
/// <summary> /// This is used to save a record and start a new transaction. /// The implementor of BaseEO needs to create their own Save method that expects the /// transaction to be passed in. /// </summary> public bool Save(ref ENTValidationErrors validationErrors, int userAccountId) { if (DBAction == DBActionEnum.Save) { // Begin database transaction using (var ts = new TransactionScope()) { // Create connection using (var db = new HRPaidTimeOffDataContext())//DBHelper.GetHRPaidTimeOffConnectionString())) { //Now save the record if (this.Save(db, ref validationErrors, userAccountId)) { // Commit transaction if update was successful ts.Complete(); return(true); } return(false); } } } throw new Exception("DBAction not Save."); }
public override void Delete(HRPaidTimeOffDataContext db, int id) { db.ENTWFItemDelete(id); }
protected override void ValidateDelete(HRPaidTimeOffDataContext db, ref ENTValidationErrors validationErrors) { //TODO: validate that user has requests //throw new NotImplementedException(); }
protected override void DeleteForReal(HRPaidTimeOffDataContext db) { throw new NotImplementedException(); }
public bool Update(HRPaidTimeOffDataContext db, int eNTWFItemStateHistoryId, int eNTWFItemId, int eNTWFStateId, int eNTUserAccountId, int updateENTUserAccountId, Binary version) { int rowsAffected = db.ENTWFItemStateHistoryUpdate(eNTWFItemStateHistoryId, eNTWFItemId, eNTWFStateId, eNTUserAccountId, updateENTUserAccountId, version); return(rowsAffected == 1); }
protected abstract void DeleteForReal(HRPaidTimeOffDataContext db);
public List <ENTNotificationENTUserAccount> SelectByENTWFStateId(HRPaidTimeOffDataContext db, int entWFStateId, int entNotificationId) { return(db.ENTNotificationENTUserAccountSelectByENTWFStateId(entWFStateId, entNotificationId).ToList()); }
public bool IsDuplicateWindowsAccountName(HRPaidTimeOffDataContext db, int userAccountId, string windowsAccountnName) { return(IsDuplicate(db, "ENTUserAccount", "WindowsAccountName", "ENTUserAccountId", windowsAccountnName, userAccountId)); }
public override void Delete(HRPaidTimeOffDataContext db, int id) { db.ENTRoleUserAccountDelete(id); }
public override void Delete(HRPaidTimeOffDataContext db, int id) { db.ENTWFOwnerGroupUserAccountDelete(id); }
public bool IsDuplicateHolidayDate(HRPaidTimeOffDataContext db, int holidayId, DateTime holidayDate) { return(IsDuplicate(db, "Holiday", "HolidayDate", "HolidayId", holidayDate, holidayId)); }
public bool Update(HRPaidTimeOffDataContext db, int holidayId, string holidayName, DateTime holidayDate, int updateENTUserAccountId, Binary version) { int rowsAffected = db.HolidayUpdate(holidayId, holidayName, holidayDate, updateENTUserAccountId, version); return(rowsAffected == 1); }
public override void Delete(HRPaidTimeOffDataContext db, int id) { db.ENTNotificationENTUserAccountDelete(id); }
public bool Update(HRPaidTimeOffDataContext db, int eNTNotificationENTUserAccountId, int eNTNotificationId, int eNTUserAccountId, int updateENTUserAccountId, Binary version) { int rowsAffected = db.ENTNotificationENTUserAccountUpdate(eNTNotificationENTUserAccountId, eNTNotificationId, eNTUserAccountId, updateENTUserAccountId, version); return(rowsAffected == 1); }
public bool Update(HRPaidTimeOffDataContext db, int eNTWorkflowId, string workflowName, string eNTWorkflowObjectName, int updateENTUserAccountId, Binary version) { int rowsAffected = db.ENTWorkflowUpdate(eNTWorkflowId, workflowName, eNTWorkflowObjectName, updateENTUserAccountId, version); return(rowsAffected == 1); }
public abstract bool Save(HRPaidTimeOffDataContext db, ref ENTValidationErrors validationErrors, int userAccountId);
public bool IsDuplicateObjectName(HRPaidTimeOffDataContext db, int entWorkflowId, string entWorkflowObjectName) { return(IsDuplicate(db, "ENTWorkflow", "ENTWorkflowObjectName", "ENTWorkflowID", entWorkflowObjectName, entWorkflowId)); }
protected abstract void ValidateDelete(HRPaidTimeOffDataContext db, ref ENTValidationErrors validationErrors);
public bool IsWorkflowAssociatedWithItem(HRPaidTimeOffDataContext db, int entWorkflowId) { return(db.ENTWFItemSelectByWorkflowId(entWorkflowId).ToList()[0].CountOfWFItems > 0); }
protected override void ValidateDelete(HRPaidTimeOffDataContext db, ref ENTValidationErrors validationErrors) { // No validate }
protected override void ValidateDelete(HRPaidTimeOffDataContext db, ref ENTValidationErrors validationErrors) { //throw new NotImplementedException(); //Check if associates with a transition }
public abstract void Delete(HRPaidTimeOffDataContext db, int id);
protected override void ValidateDelete(HRPaidTimeOffDataContext db, ref ENTValidationErrors validationErrors) { throw new NotImplementedException(); }
public bool IsDuplicateRoleName(HRPaidTimeOffDataContext db, int entRoleId, string roleName) { return(IsDuplicate(db, "ENTRole", "RoleName", "ENTRoleId", roleName, entRoleId)); }
public override void Delete(HRPaidTimeOffDataContext db, int id) { throw new NotImplementedException(); }
public bool Update(HRPaidTimeOffDataContext db, int eNTWFItemId, int eNTWorkflowId, int itemId, int submitterENTUserAccountId, int currentWFStateId, int updateENTUserAccountId, Binary version) { int rowsAffected = db.ENTWFItemUpdate(eNTWFItemId, eNTWorkflowId, itemId, submitterENTUserAccountId, currentWFStateId, updateENTUserAccountId, version); return(rowsAffected == 1); }
public bool Update(HRPaidTimeOffDataContext db, int entRoleId, string roleName, int updateENTUserAccountId, Binary version) { int rowsAffected = db.ENTRoleUpdate(entRoleId, roleName, updateENTUserAccountId, version); return(rowsAffected == 1); }