Ejemplo n.º 1
0
        /// <summary>
        /// saves Staff record
        /// </summary>
        /// <returns><see cref="System.Data.SqlClient.SqlDataReader">SqlDataReader</see></returns>
        public void SaveStaff(int personID, int classLuid, int subDepartmentLuid, string title, DateTime hireDate, DateTime terminationDate,
                              int terminationTypeLuid, int noticeTypeLuid, DateTime exitInterview, bool rehireEligible, DateTime rehireDate, string rehireNote,
                              DateTime ministerDate, int badgeFob, DateTime badgeIssued, string keys, int supervisorID, int benefitEligibleLuid,
                              DateTime benefitStartDate, DateTime benefitEndDate, int medicalChoiceLuid, int dentalChoiceLuid, int visionChoiceLuid,
                              int lifeInsuranceClassLuid, bool retirementParticipant, Decimal retirementContribution, Decimal retirementMatch,
                              decimal hsa, bool electCobra, DateTime cobraLetterSent, DateTime cobraEndDate, decimal fica, int weeklyHours, string userID)
        {
            ArrayList lst = new ArrayList();

            lst.Add(new SqlParameter("@PersonID", personID));
            lst.Add(new SqlParameter("@ClassLuid", classLuid));
            lst.Add(new SqlParameter("@SubDepartmentLuid", subDepartmentLuid));
            lst.Add(new SqlParameter("@Title", title));
            lst.Add(new SqlParameter("@HireDate", hireDate));
            lst.Add(new SqlParameter("@TerminationDate", terminationDate));
            lst.Add(new SqlParameter("@TerminationTypeLuid", terminationTypeLuid));
            lst.Add(new SqlParameter("@NoticeTypeLuid", noticeTypeLuid));
            lst.Add(new SqlParameter("@ExitInterview", exitInterview));
            lst.Add(new SqlParameter("@RehireEligible", rehireEligible));
            lst.Add(new SqlParameter("@RehireDate", rehireDate));
            lst.Add(new SqlParameter("@RehireNote", rehireNote));
            lst.Add(new SqlParameter("@MinisterDate", ministerDate));
            lst.Add(new SqlParameter("@BadgeFob", badgeFob));
            lst.Add(new SqlParameter("@BadgeIssued", badgeIssued));
            lst.Add(new SqlParameter("@Keys", keys));
            lst.Add(new SqlParameter("@SupervisorID", FKHelper.SaveForeignKey(supervisorID)));
            lst.Add(new SqlParameter("@BenefitEligibleLuid", benefitEligibleLuid));
            lst.Add(new SqlParameter("@BenefitStartDate", benefitStartDate));
            lst.Add(new SqlParameter("@BenefitEndDate", benefitEndDate));
            lst.Add(new SqlParameter("@MedicalChoiceLuid", medicalChoiceLuid));
            lst.Add(new SqlParameter("@DentalChoiceLuid", dentalChoiceLuid));
            lst.Add(new SqlParameter("@VisionChoiceLuid", visionChoiceLuid));
            lst.Add(new SqlParameter("@LifeInsuranceClassLuid", lifeInsuranceClassLuid));
            lst.Add(new SqlParameter("@RetirementParticipant", retirementParticipant));
            lst.Add(new SqlParameter("@RetirementContribution", retirementContribution));
            lst.Add(new SqlParameter("@RetirementMatch", retirementMatch));
            lst.Add(new SqlParameter("@Hsa", hsa));
            lst.Add(new SqlParameter("@ElectCobra", electCobra));
            lst.Add(new SqlParameter("@CobraLetterSent", cobraLetterSent));
            lst.Add(new SqlParameter("@CobraEndDate", cobraEndDate));
            lst.Add(new SqlParameter("@Fica", fica));
            lst.Add(new SqlParameter("@WeeklyHours", weeklyHours));
            lst.Add(new SqlParameter("@UserId", userID));


            try
            {
                this.ExecuteNonQuery("cust_ccv_sp_hr_save_staff", lst);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                lst = null;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// saves SalaryHistory record
        /// </summary>
        /// <returns><see cref="System.Data.SqlClient.SqlDataReader">SqlDataReader</see></returns>
        public int SaveSalaryHistory(int salaryHistoryID, int personID, bool fullTime, decimal hourlyRate, decimal salary, decimal housing, decimal fuel,
                                     DateTime raiseDate, decimal raiseAmount, int reviewScoreLuid, DateTime reviewDate, int reviewerID, DateTime nextReview, string userID)
        {
            ArrayList lst = new ArrayList();

            lst.Add(new SqlParameter("@SalaryHistoryID", salaryHistoryID));
            lst.Add(new SqlParameter("@PersonID", FKHelper.SaveForeignKey(personID)));
            lst.Add(new SqlParameter("@FullTime", fullTime));
            lst.Add(new SqlParameter("@HourlyRate", hourlyRate));
            lst.Add(new SqlParameter("@Salary", salary));
            lst.Add(new SqlParameter("@Housing", housing));
            lst.Add(new SqlParameter("@Fuel", fuel));
            lst.Add(new SqlParameter("@RaiseDate", raiseDate));
            lst.Add(new SqlParameter("@RaiseAmount", raiseAmount));
            lst.Add(new SqlParameter("@ReviewScoreLuid", reviewScoreLuid));
            lst.Add(new SqlParameter("@ReviewDate", reviewDate));
            lst.Add(new SqlParameter("@ReviewerID", FKHelper.SaveForeignKey(reviewerID)));
            lst.Add(new SqlParameter("@NextReview", nextReview));
            lst.Add(new SqlParameter("@UserID", userID));

            SqlParameter paramOut = new SqlParameter();

            paramOut.ParameterName = "@ID";
            paramOut.Direction     = ParameterDirection.Output;
            paramOut.SqlDbType     = SqlDbType.Int;
            lst.Add(paramOut);

            try
            {
                this.ExecuteNonQuery("cust_ccv_sp_hr_save_salaryHistory", lst);
                return((int)((SqlParameter)(lst[lst.Count - 1])).Value);
            }
            catch (SqlException ex)
            {
                if (ex.Number == 2627)                 //Unique Key Violation
                {
                    return(-1);
                }
                else
                {
                    throw ex;
                }
            }
            finally
            {
                lst = null;
            }
        }
        /// <summary>
        /// saves LeaveHistory record
        /// </summary>
        /// <returns><see cref="System.Data.SqlClient.SqlDataReader">SqlDataReader</see></returns>
        public int SaveLeaveHistory(int leaveHistoryID, int personID, int leaveTypeLuid, string leaveReason, DateTime leaveDate, DateTime returnDate, string notes, string userID)
        {
            ArrayList lst = new ArrayList();

            lst.Add(new SqlParameter("@LeaveHistoryID", leaveHistoryID));
            lst.Add(new SqlParameter("@PersonID", FKHelper.SaveForeignKey(personID)));
            lst.Add(new SqlParameter("@LeaveTypeLuid", leaveTypeLuid));
            lst.Add(new SqlParameter("@LeaveReason", leaveReason));
            lst.Add(new SqlParameter("@LeaveDate", leaveDate));
            lst.Add(new SqlParameter("@ReturnDate", returnDate));
            lst.Add(new SqlParameter("@Notes", notes));
            lst.Add(new SqlParameter("@UserID", userID));

            SqlParameter paramOut = new SqlParameter();

            paramOut.ParameterName = "@ID";
            paramOut.Direction     = ParameterDirection.Output;
            paramOut.SqlDbType     = SqlDbType.Int;
            lst.Add(paramOut);

            try
            {
                this.ExecuteNonQuery("cust_ccv_sp_hr_save_leaveHistory", lst);
                return((int)((SqlParameter)(lst[lst.Count - 1])).Value);
            }
            catch (SqlException ex)
            {
                if (ex.Number == 2627)                 //Unique Key Violation
                {
                    return(-1);
                }
                else
                {
                    throw ex;
                }
            }
            finally
            {
                lst = null;
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// saves AccessArea record
        /// </summary>
        /// <returns><see cref="System.Data.SqlClient.SqlDataReader">SqlDataReader</see></returns>
        public void SaveAccessArea(int personID, int areaLuid, string userID)
        {
            ArrayList lst = new ArrayList();

            lst.Add(new SqlParameter("@PersonID", FKHelper.SaveForeignKey(personID)));
            lst.Add(new SqlParameter("@AreaLuid", areaLuid));
            lst.Add(new SqlParameter("@UserID", userID));


            try
            {
                this.ExecuteNonQuery("cust_ccv_sp_hr_save_accessArea", lst);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                lst = null;
            }
        }
        /// <summary>
        /// Saves job application record
        /// </summary>
        /// <returns><see cref="int">int</see></returns>
        public int SaveJobApplicant(int jobApplicantID, Guid jobApplicantGuid, int personID, int jobPostingID, string firstName,
                                    string lastName, string email, string howHeard, string howLongChristian, bool class100,
                                    DateTime class100Date, bool churchMember, bool neighorhoodGroup, bool serving,
                                    string servingMinistry, bool baptized, bool tithing, string experience, string ledToApply,
                                    string coverletter, int resumeBlobID, bool rejectionNoticeSent, bool reviewedByHR, string userID)
        {
            ArrayList lst = new ArrayList();

            lst.Add(new SqlParameter("@ApplicantID", jobApplicantID));
            lst.Add(new SqlParameter("@Guid", jobApplicantGuid));
            lst.Add(new SqlParameter("@PersonID", FKHelper.SaveForeignKey(personID)));
            lst.Add(new SqlParameter("@JobPostingID", FKHelper.SaveForeignKey(jobPostingID)));
            lst.Add(new SqlParameter("@FirstName", firstName));
            lst.Add(new SqlParameter("@LastName", lastName));
            lst.Add(new SqlParameter("@Email", email));
            lst.Add(new SqlParameter("@HowHeard", howHeard));
            lst.Add(new SqlParameter("@HowLongChristian", howLongChristian));
            lst.Add(new SqlParameter("@Class100", class100));
            lst.Add(new SqlParameter("@Class100Date", class100Date));
            lst.Add(new SqlParameter("@Churchmember", churchMember));
            lst.Add(new SqlParameter("@NeighborhoodGroup", neighorhoodGroup));
            lst.Add(new SqlParameter("@Serving", serving));
            lst.Add(new SqlParameter("@ServingMinistry", servingMinistry));
            lst.Add(new SqlParameter("@Baptized", baptized));
            lst.Add(new SqlParameter("@Tithing", tithing));
            lst.Add(new SqlParameter("@Experience", experience));
            lst.Add(new SqlParameter("@LedToApply", ledToApply));
            lst.Add(new SqlParameter("@Coverletter", coverletter));
            lst.Add(new SqlParameter("@ResumeBlobID", FKHelper.SaveForeignKey(resumeBlobID)));
            lst.Add(new SqlParameter("@RejectionNoticeSent", rejectionNoticeSent));
            lst.Add(new SqlParameter("@ReviewedByHR", reviewedByHR));
            lst.Add(new SqlParameter("@UserID", userID));

            SqlParameter paramOut = new SqlParameter();

            paramOut.ParameterName = "@ID";
            paramOut.Direction     = ParameterDirection.Output;
            paramOut.SqlDbType     = SqlDbType.Int;
            lst.Add(paramOut);

            try
            {
                this.ExecuteNonQuery("cust_ccv_sp_hr_save_applicant", lst);
                return((int)((SqlParameter)(lst[lst.Count - 1])).Value);
            }
            catch (SqlException ex)
            {
                if (ex.Number == 2627) // Unique Key Violation
                {
                    return(-1);
                }
                else
                {
                    throw ex;
                }
            }
            finally
            {
                lst = null;
            }
        }