Example #1
0
        public float GetTotalHours(HourType type)
        {
            float RunningTotal = 0;

            for (int x = 0; x < 14; x++)
            {
                RunningTotal += _days[x].GetHours(type);
            }

            return RunningTotal;
        }
Example #2
0
        public float GetHours(DateTime date, HourType type)
        {
            DateTime TempDate = TrimDay(date);

            for (int x = 0; x < 14; x++)
            {
                if (TempDate.Equals(_days[x].GetDate()))
                {
                    return _days[x].GetHours(type);
                }
                TempDate.AddDays(1);
            }
            throw new ArgumentOutOfRangeException("date", "The provided date was not found within the TimeCard");
        }
Example #3
0
        public void SetHours(DateTime date, HourType type, float hours)
        {
            Boolean SomethingSet = false;
            DateTime TempDate = TrimDay(date);

            for (int x = 0; x < 14; x++)
            {
                if (TempDate.Equals(_days[x].GetDate()))
                {
                    _days[x].SetHours(type, hours);
                    SomethingSet = true;
                }
                TempDate.AddDays(1);
            }
            if (!SomethingSet)
            {
                throw new ArgumentOutOfRangeException("date", "The provided date was not found within the TimeCard");
            }
        }
Example #4
0
            public void FillRow(string 員工編號, DateTime 日期, string 工作單號, decimal 工時, int 數量, string 借入產線, string QCN, int 工品編號, HourType 工時類型)
            {
                System.Text.StringBuilder sb = new System.Text.StringBuilder();

                if (員工編號 == null || 員工編號.Trim() == string.Empty)
                    sb.AppendLine("員工編號不得為空值");

                if (工作單號 == null || 工作單號.Trim() == string.Empty)
                    sb.AppendLine("工作單號不得為空值");

                //if (品號 == null || 品號.Trim() == string.Empty)
                //    sb.AppendLine("品號不得為空值");

                if (QCN == null || QCN.Trim() == string.Empty && 數量 > 0)
                    sb.AppendLine("QC#不得為空值");

                if (工時 < 0)
                    sb.AppendLine("工時必須為一個正整數");

                // For 1.03
                if (數量 < 0)
                    sb.AppendLine("數量必須為一個正整數");

                if (sb.Length > 0)
                    throw new SWLHMSException(sb.ToString());

                this.編號 = Global.GenerateUniqueNumber();
                this.員工編號 = 員工編號;
                this.日期 = 日期;
                this.工作單號 = 工作單號;
                //this.品號 = 品號;
                this.工時 = 工時;
                this.非生產編號 = -1;
                if (this.Table.Columns.IndexOf("待驗數量") != -1)
                    this["待驗數量"] = 數量;
                else
                    this.數量 = 數量;
                this.借入產線 = 借入產線;
                this.QCN = QCN;
                this.工品編號 = 工品編號;
                this.工時類型 = (int)工時類型;

                this["備註"] = DBNull.Value;
            }
Example #5
0
 public static OffSetInfo FromHours( int hours, HourType hourType )
 {
     return new OffSetInfo( hours * 60, hourType );
 }
Example #6
0
 public OffSetInfo( int minutesOffset, HourType hourType )
 {
     this.MinutesOffset = minutesOffset;
     this.HourType = hourType;
 }
Example #7
0
 public OffSetInfo( int minutesOffset )
 {
     this.MinutesOffset = minutesOffset;
     this.HourType = HourType.NotApplicable;
 }