Exemplo n.º 1
0
        public static Double GetInOutWorkingHour(Att_InOut inout, Cat_Shift shift)
        {
            DateTime workdate = new DateTime(inout.WorkDate.Year, inout.WorkDate.Month, inout.WorkDate.Day
                                            , shift.InTime.Hour, shift.InTime.Minute, shift.InTime.Second);
            DateTime shiftStart = workdate;
            DateTime shiftEnd = workdate.AddHours(shift.CoOut);

            return GetIntersectAmount(inout.InTime.Value, inout.OutTime.Value, shiftStart, shiftEnd).TotalHours;

        }
Exemplo n.º 2
0
        private Att_RptExceptionDataEntity SetExceptionData(Att_InOut InOut, Hre_Profile profile, Cat_Shift shift, DateTime idx,string userExport)
        {
            Att_RptExceptionDataEntity exceptionData = new Att_RptExceptionDataEntity();
            exceptionData.ID = Guid.NewGuid();
            exceptionData.InOutID = InOut == null ? Guid.Empty : InOut.ID;
            //exceptionData.EntityType = ClassNames.Att_InOut;
            exceptionData.EntityType = "Att_InOut";
            exceptionData.CodeEmp = profile.CodeEmp;
            exceptionData.ShiftID = shift == null ? Guid.Empty : shift.ID;
            exceptionData.ProfileID = profile.ID;
            exceptionData.ProfileName = profile.ProfileName;
            exceptionData.UserExport = userExport;
            exceptionData.DateExport = DateTime.Today;

            //exceptionData.Position = profile.Cat_Position == null ? string.Empty : profile.Cat_Position.PositionName;

            //string[] strDepartment = GradeCfgDAO.getLinkDepartment(ListCacheOrgStructure, profile.Cat_OrgStructure, true);
            //exceptionData.Department = strDepartment[1];

            exceptionData.Date = idx;
            return exceptionData;
        }
Exemplo n.º 3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="inout"></param>
        /// <param name="shift"></param>
        /// <returns></returns>
        public static Double GetShiftRosterShiftInOutHour(Att_InOut inout, Cat_Shift shift)
        {
            DateTime workdate = new DateTime(inout.WorkDate.Year, inout.WorkDate.Month, inout.WorkDate.Day
                                            , shift.InTime.Hour, shift.InTime.Minute, shift.InTime.Second);
            DateTime shiftStart = workdate;
            DateTime shiftEnd = workdate.AddHours(shift.CoOut);
            DateTime dateIn = inout.InTime.Value;
            DateTime dateOut = inout.OutTime.Value;

            Double _hrs = 0;
            if (dateIn.CompareTo(shiftStart) > 0)
                _hrs += dateIn.Subtract(shiftStart).TotalHours;
            else
                _hrs += shiftStart.Subtract(dateIn).TotalHours;

            if (dateOut.CompareTo(shiftEnd) > 0)
                _hrs += dateOut.Subtract(shiftEnd).TotalHours;
            else
                _hrs += shiftEnd.Subtract(dateOut).TotalHours;

            return _hrs;
        }