Пример #1
0
        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.");
            }
        }
Пример #2
0
        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.");
            }
        }
Пример #3
0
        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.");
            }
        }
Пример #4
0
 /// <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.");
 }
Пример #5
0
 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();
 }
Пример #7
0
 protected override void DeleteForReal(HRPaidTimeOffDataContext db)
 {
     throw new NotImplementedException();
 }
Пример #8
0
        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);
        }
Пример #9
0
 protected abstract void DeleteForReal(HRPaidTimeOffDataContext db);
Пример #10
0
 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));
 }
Пример #12
0
 public override void Delete(HRPaidTimeOffDataContext db, int id)
 {
     db.ENTRoleUserAccountDelete(id);
 }
Пример #13
0
 public override void Delete(HRPaidTimeOffDataContext db, int id)
 {
     db.ENTWFOwnerGroupUserAccountDelete(id);
 }
Пример #14
0
 public bool IsDuplicateHolidayDate(HRPaidTimeOffDataContext db, int holidayId, DateTime holidayDate)
 {
     return(IsDuplicate(db, "Holiday", "HolidayDate", "HolidayId", holidayDate, holidayId));
 }
Пример #15
0
        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);
        }
Пример #16
0
 public override void Delete(HRPaidTimeOffDataContext db, int id)
 {
     db.ENTNotificationENTUserAccountDelete(id);
 }
Пример #17
0
        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);
        }
Пример #19
0
 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));
 }
Пример #21
0
 protected abstract void ValidateDelete(HRPaidTimeOffDataContext db, ref ENTValidationErrors validationErrors);
 public bool IsWorkflowAssociatedWithItem(HRPaidTimeOffDataContext db, int entWorkflowId)
 {
     return(db.ENTWFItemSelectByWorkflowId(entWorkflowId).ToList()[0].CountOfWFItems > 0);
 }
Пример #23
0
 protected override void ValidateDelete(HRPaidTimeOffDataContext db, ref ENTValidationErrors validationErrors)
 {
     // No validate
 }
Пример #24
0
 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);
Пример #26
0
 protected override void ValidateDelete(HRPaidTimeOffDataContext db, ref ENTValidationErrors validationErrors)
 {
     throw new NotImplementedException();
 }
Пример #27
0
 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();
 }
Пример #29
0
        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);
        }