/// <summary> /// Get the list of CollectionMissed by department Id and status /// </summary> /// <param name="department"></param> /// <param name="status"></param> /// <returns> /// List of CollectionMissed /// </returns> public List <CollectionMissed> GetAllCollectionMissed(Department department, Constants.VISIBILITY_STATUS status) { try { //get the collectionMissed List by checking department Id of collecion Missed Table and check the Visibility Status collectionMissedList = inventory.CollectionMisseds.Where(c => c.Department.Id == department.Id || status.Equals("SHOW")).ToList(); } catch (Exception e) { collectionMissedList = null; } return(collectionMissedList); }
public List <Discrepancy> GetAllDiscrepancy(Constants.VISIBILITY_STATUS visibilityStatus) { try { int status = Converter.objToInt(visibilityStatus); discrepancyListObj = inventory.Discrepancies.Where(x => x.Status == status).ToList <Discrepancy>(); } catch (Exception e) { discrepancyListObj = null; } return(discrepancyListObj); }
/// <summary> /// Change List to DataTable /// Created By:Zin Mar Thwin /// Created Date:28-01-2012 /// Modified By: /// Modified Date: /// Modification Reason: /// Modified By: /// Modified Date: /// Modification Reason: /// </summary> /// <param name="itemDescription"></param> /// <returns>The return value of this method is resultItem.</returns> private void ListToDataTable(List <Department> deptList, Constants.VISIBILITY_STATUS collectionMissedStatus) { foreach (Department dep in deptList) { dr = dt.NewRow(); dr[columnName[0]] = dep.Name; List <CollectionMissed> missedTime = collectionMissedBroker.GetAllCollectionMissed(dep); List <CollectionMissed> newList = new List <CollectionMissed>(); foreach (CollectionMissed temp in missedTime) { if (temp.Status != Converter.objToInt(Constants.VISIBILITY_STATUS.HIDDEN)) { newList.Add(temp); } } int count = newList.Count; //if (missedTime != null) //{ // foreach (CollectionMissed times in missedTime) // { // count++; // } //} string black = null; Constants.DEPARTMENT_STATUS departmentStatus = Converter.objToDepartmentStatus(dep.Status); if (departmentStatus == Constants.DEPARTMENT_STATUS.SHOW || departmentStatus == Constants.DEPARTMENT_STATUS.UNBLACKLIST) { black = Converter.GetDepartmentStatusText(Constants.DEPARTMENT_STATUS.BLACKLIST); } else if (Converter.objToDepartmentStatus(dep.Status) == Constants.DEPARTMENT_STATUS.BLACKLIST) { black = Converter.GetDepartmentStatusText(Constants.DEPARTMENT_STATUS.UNBLACKLIST); } dr[columnName[1]] = count; dr[columnName[2]] = Converter.GetDepartmentStatusText(Converter.objToDepartmentStatus(dep.Status)); dr[columnName[3]] = black; dr[columnName[4]] = dep.Id; dt.Rows.Add(dr); } // return dt; }