public bool GetEventList(ErrorList errorlist, int idp) { Events = new EventsInfo(); string ret = Events.ProcessData(idp, SalarySheet.DT1, SalarySheet.DT2); if (ret == "OK") { return(true); } errorlist.AddPersonError(idp, ret); return(false); }
public ErrorList MakeReport(DateTime dt) { var er = new ErrorList(); var table_persons = MyData.DataSetKlons.PERSONS; var drs_persons = table_persons.WhereNotDeleted(); foreach (var dr in drs_persons) { var rrvd = new RepRowVacDays(); var er1 = GetVacDaysNotUsed(dr, dt, rrvd); if (er1 == "OK") { RepRows.Add(rrvd); } else { er.AddPersonError(dr.ID, er1); } } return(er); }
public ErrorList CheckDays(SalaryInfo wt, DateTime dt1, DateTime dt2, int idp) { var error_list = new ErrorList(); string errstr = string.Format("{0}.{1}", dt1.Year, dt1.Month); int i, j; int i1 = dt1.Day; int i2 = dt2.Day; EDayPlanId daycodeplan = EDayPlanId.None; EDayFactId daycodefact = EDayFactId.None; EDayPlanId daycodeplan2 = EDayPlanId.None; EDayFactId daycodefact2 = EDayFactId.None; bool iscodeset; for (i = i1; i <= i2; i++) { iscodeset = false; for (j = 0; j < this.Count; j++) { daycodeplan = this[j].Plan.DxPlan[i - 1]; if (!iscodeset) { daycodeplan2 = daycodeplan; iscodeset = true; continue; } if (daycodeplan != daycodeplan2) { var errs = string.Format("{0} nesakrīt darba laika plāna dati dažādiem amatiem dienai: {1}", errstr, i); error_list.AddPersonError(idp, errs); } } iscodeset = false; for (j = 0; j < this.Count; j++) { daycodefact = this[j].Fact.DxFact[i - 1]; daycodeplan = this[j].Plan.DxPlan[i - 1]; if (daycodefact == EDayFactId.X || daycodefact == EDayFactId.None) { continue; } if (!iscodeset) { daycodefact2 = daycodefact; daycodeplan2 = daycodeplan; iscodeset = true; if (!SomeDataDefs.CanPlanHaveFact(daycodeplan, daycodefact)) { var errs = string.Format("{0} nekorekts faktiski nostrādās dienas kods: {1}", errstr, i); error_list.AddPersonError(idp, errs); } continue; } bool b1 = SomeDataDefs.IsSickDay(daycodefact) || SomeDataDefs.IsDayVacation(daycodefact) || daycodefact == EDayFactId.V; bool b2 = SomeDataDefs.IsSickDay(daycodefact2) || SomeDataDefs.IsDayVacation(daycodefact2) || daycodefact2 == EDayFactId.V; if (b1 != b2) { var errs = string.Format("{0} nesakrīt darba laika dati dažādiem amatiem dienai: {1}", errstr, i); error_list.AddPersonError(idp, errs); } } } return(error_list); }