Kadr.Data.TimeSheet.GetNotInsertedStaff C# (CSharp) Method

GetNotInsertedStaff() public method

Возвращает список имеющихся в табеле штатных единиц, которые должны там быть
public GetNotInsertedStaff ( IEnumerable staff ) : IEnumerable
staff IEnumerable Общий список штатных единиц
return IEnumerable
        public IEnumerable<GetFactStaffForTimeSheetResult> GetNotInsertedStaff(IEnumerable<GetFactStaffForTimeSheetResult> staff)
        {
            IEnumerable<GetFactStaffForTimeSheetResult> NotInsertedStaff = staff.Except(GetInsertedStaff(staff)).Distinct().ToArray();

            return NotInsertedStaff;
        }

Usage Example

Esempio n. 1
0
        private void cbTimeSheet_SelectedIndexChanged(object sender, EventArgs e)
        {
            CurrentTimeSheet = cbTimeSheet.SelectedItem as TimeSheet;
            //получаем список сотрyдников отдела за период
            IEnumerable<GetFactStaffForTimeSheetResult> staff = CurrentTimeSheet.GetStaffByPeriod().ToArray();

            IEnumerable<GetFactStaffForTimeSheetResult> NotCreatedFactStaff = CurrentTimeSheet.GetNotInsertedStaff(staff).ToArray();
            timeSheetFSWorkingDaysBindingSource.DataSource =
                ((from st in NotCreatedFactStaff
                 join fcSt in KadrController.Instance.Model.FactStaffs
                   on (int)st.idFactStaff
                   equals (int)fcSt.id
                 select new
                 {
                     TSRecord = st,
                     FactSt = fcSt
                 }).Select(depSt =>
                        new TimeSheetRecord(depSt.FactSt, CurrentTimeSheet, depSt.TSRecord.StaffCount, Convert.ToInt32(depSt.TSRecord.daysCount))).Union(CurrentTimeSheet.TimeSheetFSWorkingDays.Where(tsRecord =>
                        (tsRecord.IsClosed != true)).Select(tsRecord => new TimeSheetRecord(tsRecord)))).OrderBy(tsRecord =>
                            tsRecord.FactStaff.Employee.LastName).ThenBy(tsRecord =>
                                tsRecord.FactStaff.Employee.FirstName).ThenBy(tsRecord => tsRecord.FactStaff.Employee.Otch);
        }