示例#1
0
 /// <summary>
 /// 构造函数。
 /// </summary>
 public StudentWork()
 {
     this.time = DateTime.Now;
     this.Status = EnumWorkStatus.None;
     this.type = EnumWorkType.Public;
     this.student = new Student();
 }
示例#2
0
 /// <summary>
 /// HLavna funkcua pre buttony
 /// </summary>
 /// <param name="employeeId"></param>
 /// <param name="type"></param>
 public void ProcessAction(int employeeId, EnumWorkType type)
 {
     if (type == EnumWorkType.Exit)
     {
         ExitTimeBlock(employeeId);
     }
     else
     {
         CreateNewAndFinishPreviousRecord(employeeId, type);
     }
 }
示例#3
0
        public void CreateNewTimeBlock(int idEmployee, EnumWorkType type, DateTime startTime, DateTime?finishTime = null)
        {
            DailyRecord dailyRecord = new DailyRecord
            {
                Start      = startTime,
                Finish     = finishTime,
                IdEmployee = idEmployee,
                IdWorktype = (int)type
            };

            _dailyRecordRepository.InsertDialyRecord(dailyRecord);
        }
示例#4
0
        public void CreateNewAndFinishPreviousRecord(int employeeId, EnumWorkType type)
        {
            DateTime    currentTime = DateTime.Now;
            DailyRecord dailyRecord = _dailyRecordRepository.GetLastDailyRecordByEmployeeId(employeeId);

            if (dailyRecord != null)
            {
                if (dailyRecord.Finish == null)
                {
                    UpdateFinishInTimeBlock(dailyRecord, currentTime);
                }
                else
                {
                    CreateNewTimeBlock(employeeId, EnumWorkType.Other, (DateTime)dailyRecord.Finish, currentTime);
                }
            }
            CreateNewTimeBlock(employeeId, type, currentTime);
        }
示例#5
0
 private void DescribeAndProcessAction(EnumWorkType type)
 {
     if (string.IsNullOrWhiteSpace(txtEmpIdNum.Text))
     {
         lblName.Text = ShowError();
         timerClearDisplay.Start();
     }
     else
     {
         bool success = Int32.TryParse(txtEmpIdNum.Text, out int employeeId);
         if (success && _logic.IsCorrectEmp(employeeId))
         {
             _logic.ProcessAction(employeeId, type);
             Describe(employeeId, type);
             timerClearDisplay.Start();
         }
         else
         {
             lblName.Text = ShowError();
             timerClearDisplay.Start();
         }
     }
 }
示例#6
0
 /// <summary>
 /// 获取类型名称。
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static string GetTypeName(EnumWorkType type)
 {
     if (type == EnumWorkType.Protected)
         return "不公开";
     return "公开";
 }
示例#7
0
 static JDFAutoMISDetails()
 {
     atrInfoTable[0] = new AtrInfoTable(AttributeName.COSTTYPE, 0x33333311, AttributeInfo.EnumAttributeType.enumeration, EnumCostType.getEnum(0), null);
     atrInfoTable[1] = new AtrInfoTable(AttributeName.DEVICEOPERATIONMODE, 0x33333311, AttributeInfo.EnumAttributeType.enumeration, EnumDeviceOperationMode.getEnum(0), null);
     atrInfoTable[2] = new AtrInfoTable(AttributeName.WORKTYPE, 0x33333311, AttributeInfo.EnumAttributeType.enumeration, EnumWorkType.getEnum(0), null);
     atrInfoTable[3] = new AtrInfoTable(AttributeName.WORKTYPEDETAILS, 0x33333311, AttributeInfo.EnumAttributeType.string_, null, null);
 }
示例#8
0
 ///
 ///          <summary> * (9) get attribute WorkType </summary>
 ///          * <returns> the value of the attribute </returns>
 ///
 public virtual EnumWorkType getWorkType()
 {
     return(EnumWorkType.getEnum(getAttribute(AttributeName.WORKTYPE, null, null)));
 }
示例#9
0
 //         ---------------------------------------------------------------------
 //        Methods for Attribute WorkType
 //        ---------------------------------------------------------------------
 ///
 ///          <summary> * (5) set attribute WorkType </summary>
 ///          * <param name="enumVar">: the enumVar to set the attribute to </param>
 ///
 public virtual void setWorkType(EnumWorkType enumVar)
 {
     setAttribute(AttributeName.WORKTYPE, enumVar == null ? null : enumVar.getName(), null);
 }
示例#10
0
 private void DescribeAndProcessAction(EnumWorkType workType)
 {
     _logicTerminal.ProcessAction(_loginId, workType);
     _writer.Writer($"{_logicTerminal.DescriptionFullname(_loginId)} {workType}");
 }
示例#11
0
 private void Describe(int employeeId, EnumWorkType type)
 {
     lblName.Text     = _logic.DescriptionFullname(employeeId);
     lblDateNow.Text  = DateTime.Now.DateDescription();
     lblWorkType.Text = type.ToString();
 }