Exemplo n.º 1
0
        /// <summary>
        /// 检查上下班状态是否迟到早退
        /// </summary>
        /// <param name="action">动作DutyAction</param>
        /// <returns>返回值</returns>
        public bool CheckStatus(DutyAction action)
        {
            WA_Setting was      = new WA_Setting();
            DutyTime   dutytime = was.GetDutyTime(staffid);

            //如果是上班
            if (action == DutyAction.OnDuty)
            {
                if ((DateTime.Now - ondutyflexibilitytime) > (DateTime.Today + dutytime.OnDutyTime.TimeOfDay))
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            //如果下班
            else
            {
                if ((DateTime.Now + offdutyflexibilitytime) < (DateTime.Today + dutytime.OffDutyTime.TimeOfDay))
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 检查上下班状态是否迟到早退
        /// </summary>
        /// <param name="action">动作DutyAction</param>
        /// <param name="staffid">人员id</param>
        /// <returns>返回值</returns>
        public bool CheckStatus(DutyAction action, int staffid)
        {
            this.staffid = staffid;
            WA_Setting was      = new WA_Setting();
            DutyTime   dutytime = was.GetDutyTime(staffid);

            //如果是上班
            if (action == DutyAction.OnDuty)
            {
                if ((DateTime.Now.TimeOfDay - ondutyflexibilitytime) > dutytime.OnDutyTime.TimeOfDay)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            //如果下班
            else
            {
                if ((DateTime.Now.TimeOfDay + offdutyflexibilitytime) < dutytime.OffDutyTime.TimeOfDay)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
        }
Exemplo n.º 3
0
Arquivo: WA.cs Projeto: blfsir/benzoa
 /// <summary>
 /// ������°�״̬�Ƿ�ٵ�����
 /// </summary>
 /// <param name="action">����DutyAction</param>
 /// <returns>����ֵ</returns>
 public bool CheckStatus(DutyAction action)
 {
     WA_Setting was = new WA_Setting();
     DutyTime dutytime = was.GetDutyTime(staffid);
     //������ϰ�
     if(action==DutyAction.OnDuty)
     {
         if((DateTime.Now - ondutyflexibilitytime)> (DateTime.Today + dutytime.OnDutyTime.TimeOfDay))
             return false;
         else
             return true;
     }
         //����°�
     else
     {
         if((DateTime.Now + offdutyflexibilitytime) < (DateTime.Today + dutytime.OffDutyTime.TimeOfDay))
             return false;
         else
             return true;
     }
 }
Exemplo n.º 4
0
Arquivo: WA.cs Projeto: blfsir/benzoa
 /// <summary>
 /// ������°�״̬�Ƿ�ٵ�����
 /// </summary>
 /// <param name="action">����DutyAction</param>
 /// <param name="staffid">��Աid</param>
 /// <returns>����ֵ</returns>
 public bool CheckStatus(DutyAction action,int staffid)
 {
     this.staffid = staffid;
     WA_Setting was = new WA_Setting();
     DutyTime dutytime = was.GetDutyTime(staffid);
     //������ϰ�
     if(action==DutyAction.OnDuty)
     {
         if((DateTime.Now.TimeOfDay - ondutyflexibilitytime) > dutytime.OnDutyTime.TimeOfDay)
             return false;
         else
             return true;
     }
     //����°�
     else
     {
         if((DateTime.Now.TimeOfDay + offdutyflexibilitytime) < dutytime.OffDutyTime.TimeOfDay)
             return false;
         else
             return true;
     }
 }