public static List <PendingRequestModel> getPendingRequest(string EmployeeCode) { using (var context = new SalesReturndbEntities()) { List <PendingRequestModel> dataList = null; var PendingRequestList = context.SP_GetPendingRequest(EmployeeCode).ToList(); if (PendingRequestList != null) { dataList = PendingRequestList.Select(x => new PendingRequestModel() { BatchNo = x.BatchNo, DealerAddress = x.DealerAddress, DealerCode = x.DealerCode, DealerName = x.DealerName, DepotName = x.DepotName, DepotAddress = x.DepotAddress, DepotCode = x.DepotCode, FutureStatus = x.FutureStatus, RequestHeaderId = x.RequestHeaderId, FutureStatus_Id = x.FutureStatus_Id, CurrentStatus_Id = x.CurrentStatus_Id, SKUCode = x.SKUCode, SKUName = x.SKUName, CreatedBy_EMP_CODE = x.CreatedBy, CreatedBy = context.SP_LFGDetails(x.CreatedBy).FirstOrDefault().Emp_First_name, CreatedDate = x.CreatedDate, TotalSRV = context.tblRequestDtls.Where(o => o.RequestHeaderId == x.RequestHeaderId && o.IsActive == true).Sum(p => p.SRVValue).Value, RequestTypeOption = x.SKUCode,// for access data behalf on skucode }).ToList(); return(dataList); } return(dataList); } }
public static int GetPendingRequestCount(string empCode) { using (var context = new SalesReturndbEntities()) { int Count = context.SP_GetPendingRequest(empCode).Count(); return(Count); } }