/// <summary> /// 构造函数。 /// </summary> public StudentWork() { this.time = DateTime.Now; this.Status = EnumWorkStatus.None; this.type = EnumWorkType.Public; this.student = new Student(); }
/// <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); } }
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); }
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); }
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(); } } }
/// <summary> /// 获取类型名称。 /// </summary> /// <param name="type"></param> /// <returns></returns> public static string GetTypeName(EnumWorkType type) { if (type == EnumWorkType.Protected) return "不公开"; return "公开"; }
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); }
/// /// <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))); }
// --------------------------------------------------------------------- // 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); }
private void DescribeAndProcessAction(EnumWorkType workType) { _logicTerminal.ProcessAction(_loginId, workType); _writer.Writer($"{_logicTerminal.DescriptionFullname(_loginId)} {workType}"); }
private void Describe(int employeeId, EnumWorkType type) { lblName.Text = _logic.DescriptionFullname(employeeId); lblDateNow.Text = DateTime.Now.DateDescription(); lblWorkType.Text = type.ToString(); }