public EmployeeVacationRequestViewItem(VacationRequest vacationRequest, String shiftPartnerFullName)
 {
     _vacationRequestID = vacationRequest.getVacationRequestID();
     _vacationStartDate = vacationRequest.getVacationStartDate();
     _vacationEndDate = vacationRequest.getVacationEndDate();
     _requesterID = vacationRequest.getEmployeeID();
     _netVacationDays = vacationRequest.getNetVacationDays();
     _vacationRequestProcessingState = vacationRequest.getVacationRequestProcessingState();
     _shiftPartnerFullName = shiftPartnerFullName;
 }
 public VacationReplacementRequestViewItem(VacationRequest vacationRequest, String requesterFullName)
 {
     this._vacationRequestID = vacationRequest.getVacationRequestID();
     this._requesterID = vacationRequest.getEmployeeID();
     this._vacationStartDate = vacationRequest.getVacationStartDate();
     this._vacationEndDate = vacationRequest.getVacationEndDate();
     this._netVacationDays = vacationRequest.getNetVacationDays();
     this._requesterFullName = requesterFullName;
     this._vacationRequestProcessingState = vacationRequest.getVacationRequestProcessingState();
 }
 public AllVacationRequestViewItem(VacationRequest vacationRequest, String requesterFullName)
 {
     _vacationRequestID = vacationRequest.getVacationRequestID();
     _vacationStartDate = vacationRequest.getVacationStartDate();
     _vacationEndDate = vacationRequest.getVacationEndDate();
     _requesterID = vacationRequest.getEmployeeID();
     _netVacationDays = vacationRequest.getNetVacationDays();
     _vacationRequestProcessingState = vacationRequest.getVacationRequestProcessingState();
     _requesterFullName = requesterFullName;
     _modificationDate = vacationRequest.getModificationDate();
 }
 public PendingVacationRequestViewItem(VacationRequest vacationRequest, String requesterName, String deputyName, int remainingVacationDays)
 {
     this._vacationRequestID = vacationRequest.getVacationRequestID();
     this._requesterID = vacationRequest.getEmployeeID();
     this._vacationStartDate = vacationRequest.getVacationStartDate();
     this._vacationEndDate = vacationRequest.getVacationEndDate();
     this._netVacationDays = vacationRequest.getNetVacationDays();
     this._vacationRequestProcessingState = vacationRequest.getVacationRequestProcessingState();
     this._requesterFullName = requesterName;
     this._deputyFullName = deputyName;
     this._vacationPeriodOverlapNote = vacationRequest.getVacationPeriodOverlapNote();
     this._vacationLockPeriodNote = vacationRequest.getVacationLockPeriodNote();
     this._remainingVacationDays = remainingVacationDays;
 }
Esempio n. 5
0
        /// <summary>
        /// constructor to create a vacation request 
        /// </summary>
        public VacationRequest(String EmployeeID, DateTime VacationStartDate, DateTime VacationEndDate)
        {
            this._employeeID = EmployeeID;
            this._vacationStartDate = VacationStartDate;
            this._vacationEndDate = VacationEndDate;

            //init with default values:
            this._vacationRequestID = 0;
            this._submissionDate = DateTime.Today;
            this._vacationType = DEFAULT_VACATION_TYPE;
            this._vacationRequestProcessingState = VacationRequestProcessingState.submitted;
            this._modificationDate = DateTime.Now;
            this._vacationPeriodOverlapNote = false; ;
            this._vacationLockPeriodNote = false;
            this._netVacationDays = 0;
        }
        public static String ConvertStateToString(VacationRequestProcessingState ProcessingState)
        {
            String result = "unbekannt";

            switch (ProcessingState)
            {
                case VacationRequestProcessingState.agreed: result = AGREED; break;
                case VacationRequestProcessingState.approved: result = APPROVED; break;
                case VacationRequestProcessingState.canceled: result = CANCELED; break;
                case VacationRequestProcessingState.permitted: result = PERMITTED; break;
                case VacationRequestProcessingState.rejectedByDeputy: result = REJECTED_BY_DEPUTY; break;
                case VacationRequestProcessingState.rejectedByDivisionManager: result = REJECTED_BY_DIVISION_MANAGER; break;
                case VacationRequestProcessingState.submitted: result = SUBMITTED; break;
                case VacationRequestProcessingState.taken: result = TAKEN; break;
                default: result = UNKNOWN; break;
            }
            return result;
        }
Esempio n. 7
0
 /// <summary>
 /// general constructor 
 /// </summary>
 public VacationRequest(ulong VacationRequestID, String EmployeeID, DateTime VacationStartDate, DateTime VacationEndDate, DateTime SubmissionDate, String VacationType, VacationRequestProcessingState VacationRequestProcessingState, DateTime ModificationDate, Boolean VacationPeriodOverlapNote, Boolean VacationLockPeriodNote, int NetVacationDays)
 {
     this._vacationRequestID = VacationRequestID;
     this._employeeID = EmployeeID;
     this._vacationStartDate = VacationStartDate;
     this._vacationEndDate = VacationEndDate;
     this._submissionDate = SubmissionDate;
     this._vacationType = VacationType;
     this._vacationRequestProcessingState = VacationRequestProcessingState;
     this._modificationDate = ModificationDate;
     this._vacationPeriodOverlapNote = VacationPeriodOverlapNote;
     this._vacationLockPeriodNote = VacationLockPeriodNote;
     this._netVacationDays = NetVacationDays;
 }
Esempio n. 8
0
 public void setVacationRequestProcessingState(VacationRequestProcessingState VacationRequestProcessingState)
 {
     this._vacationRequestProcessingState = VacationRequestProcessingState;
 }
Esempio n. 9
0
        // geändert
        /// <summary>
        /// updates the State of the VacationRequest with the given VacationRequestID
        /// </summary>
        /// <param name="VacationRequestID">ID of the VacationRequest in which the state will be changed</param>
        /// <param name="State">the to-be VacationProcessingState</param>
        /// <param name="modificationDate">Dateime of modification</param>
        /// <returns>true or false (update successfull or not)</returns>
        public Boolean UpdateVacationRequestStatus(ulong VacationRequestID, VacationRequestProcessingState State, DateTime modificationDate )
        {
            bool Result = false;
            using (SqlConnection connection = new SqlConnection(sqlConnectionString))
            {
                string sqlStatement =                                                                                                       //insert ID like that because of DataType conflicts
                    "UPDATE dbo.VacationRequest SET VacationProcessingState = @VacationProcessingState, ModificationDate = @modificationDate WHERE VacationRequestID = @VacationRequestID";
                using (SqlCommand cmd = new SqlCommand(sqlStatement, connection))
                {
                    cmd.Parameters.AddWithValue("VacationRequestID", (long) VacationRequestID);
                    cmd.Parameters.AddWithValue("VacationProcessingState", ConvertVacationRequestProcessingStateToString(State));
                    cmd.Parameters.AddWithValue("modificationDate", modificationDate);

                    try
                    {
                        connection.Open();
                        cmd.ExecuteNonQuery(); //insert,delete,update is NonQuery
                        Result = true;
                    }
                    catch (SqlException e) //if failure in Database result = false
                    {
                        {
                            Result = false;
                        }
                    }
                }
            }
            return Result;
        }