1. C# / Говнокод #6632

    +116

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    IList<Hashtable> records = crit.List<Hashtable>();
    Guid[] personsId = records.Select(item => (Guid)item["PersonID"]).Distinct().ToArray();
    List<EmployeeData> empDatas = new List<EmployeeData>();
    
    foreach(Guid personId in personsId) {
    	IEnumerable<Hashtable> employeeRecords = records.Where(item => (Guid)item["PersonID"] == personId);
    	Hashtable employeeRecord = employeeRecords.FirstOrDefault(item => !(bool)item["IsLoad"] || (DateTime)item["EventDate"] == employeeRecords.Max(unit => (DateTime)unit["EventDate"]));
    
    	Hashtable employeeRecordAddition = new GenericNHibernateDao<BaseDocument>().CreateCriteria()
    		.CreateAlias("Department", "department")
    		.CreateAlias("Employee", "employee")
    		.CreateAlias("WorkDescription.Schedule", "schedule", JoinType.LeftOuterJoin)
    		.CreateAlias("WorkDescription.EmployeeApperance", "employeeApperance", JoinType.LeftOuterJoin)
    		.Add(Restrictions.Eq("EmployeeStamp.TabNo", employeeRecord["TabNo"]))
    		.Add(Restrictions.Eq("IsHalf", false))
    	...
    }

    No comments %)

    Запостил: Guid, 12 Мая 2011

    Комментарии (5) RSS

    Добавить комментарий