Ejemplo n.º 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.");
            }
        }
Ejemplo n.º 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.");
            }
        }
Ejemplo n.º 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.");
            }
        }
Ejemplo n.º 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.");
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 7
0
 protected override void DeleteForReal(HRPaidTimeOffDataContext db)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 9
0
 protected abstract void DeleteForReal(HRPaidTimeOffDataContext db);
Ejemplo n.º 10
0
 public List <ENTNotificationENTUserAccount> SelectByENTWFStateId(HRPaidTimeOffDataContext db, int entWFStateId, int entNotificationId)
 {
     return(db.ENTNotificationENTUserAccountSelectByENTWFStateId(entWFStateId, entNotificationId).ToList());
 }
Ejemplo n.º 11
0
 public bool IsDuplicateWindowsAccountName(HRPaidTimeOffDataContext db, int userAccountId, string windowsAccountnName)
 {
     return(IsDuplicate(db, "ENTUserAccount", "WindowsAccountName", "ENTUserAccountId", windowsAccountnName, userAccountId));
 }
Ejemplo n.º 12
0
 public override void Delete(HRPaidTimeOffDataContext db, int id)
 {
     db.ENTRoleUserAccountDelete(id);
 }
Ejemplo n.º 13
0
 public override void Delete(HRPaidTimeOffDataContext db, int id)
 {
     db.ENTWFOwnerGroupUserAccountDelete(id);
 }
Ejemplo n.º 14
0
 public bool IsDuplicateHolidayDate(HRPaidTimeOffDataContext db, int holidayId, DateTime holidayDate)
 {
     return(IsDuplicate(db, "Holiday", "HolidayDate", "HolidayId", holidayDate, holidayId));
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 16
0
 public override void Delete(HRPaidTimeOffDataContext db, int id)
 {
     db.ENTNotificationENTUserAccountDelete(id);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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));
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 23
0
 protected override void ValidateDelete(HRPaidTimeOffDataContext db, ref ENTValidationErrors validationErrors)
 {
     // No validate
 }
Ejemplo n.º 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);
Ejemplo n.º 26
0
 protected override void ValidateDelete(HRPaidTimeOffDataContext db, ref ENTValidationErrors validationErrors)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 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);
        }