// Used By GetReqInfoList ActionMethod public ActionResult GetReqInfoParitalList(string reqCode, long?warehouseId, string status, long?line, string fromDate, string toDate) { IEnumerable <RequsitionInfoDTO> requsitionInfoDTO = _requsitionInfoBusiness.GetAllReqInfoByOrgId(OrgId).Where(req => req.StateStatus != "Pending" && (reqCode == null || reqCode.Trim() == "" || req.ReqInfoCode.Contains(reqCode)) && (warehouseId == null || warehouseId <= 0 || req.WarehouseId == warehouseId) && (status == null || status.Trim() == "" || req.StateStatus == status.Trim()) && (line == null || line <= 0 || req.LineId == line) && ( (fromDate == null && toDate == null) || (fromDate == "" && toDate == "") || (fromDate.Trim() != "" && toDate.Trim() != "" && req.EntryDate.Value.Date >= Convert.ToDateTime(fromDate).Date&& req.EntryDate.Value.Date <= Convert.ToDateTime(toDate).Date) || (fromDate.Trim() != "" && req.EntryDate.Value.Date == Convert.ToDateTime(fromDate).Date) || (toDate.Trim() != "" && req.EntryDate.Value.Date == Convert.ToDateTime(toDate).Date) ) ).Select(info => new RequsitionInfoDTO { ReqInfoId = info.ReqInfoId, ReqInfoCode = info.ReqInfoCode, LineId = info.LineId, LineNumber = (_productionLineBusiness.GetProductionLineOneByOrgId(info.LineId, OrgId).LineNumber), StateStatus = info.StateStatus, Remarks = info.Remarks, OrganizationId = info.OrganizationId, EntryDate = info.EntryDate, WarehouseId = info.WarehouseId, WarehouseName = (_warehouseBusiness.GetWarehouseOneByOrgId(info.WarehouseId, OrgId).WarehouseName), Qty = _requsitionDetailBusiness.GetRequsitionDetailByReqId(info.ReqInfoId, OrgId).Select(s => s.ItemId).Distinct().Count(), }).ToList(); List <RequsitionInfoViewModel> requsitionInfoViewModels = new List <RequsitionInfoViewModel>(); AutoMapper.Mapper.Map(requsitionInfoDTO, requsitionInfoViewModels); return(PartialView(requsitionInfoViewModels)); }
public ActionResult GetItemTypeList() { ViewBag.ddlWarehouse = _warehouseBusiness.GetAllWarehouseByOrgId(OrgId).Select(ware => new SelectListItem { Text = ware.WarehouseName, Value = ware.Id.ToString() }).ToList(); IEnumerable <ItemTypeDTO> itemTypesDomains = _itemTypeBusiness.GetAllItemTypeByOrgId(OrgId).Select(item => new ItemTypeDTO { ItemId = item.ItemId, WarehouseId = item.WarehouseId, ItemName = item.ItemName, Remarks = item.Remarks, StateStatus = (item.IsActive == true ? "Active" : "Inactive"), OrganizationId = item.OrganizationId, WarehouseName = (_warehouseBusiness.GetWarehouseOneByOrgId(item.WarehouseId, OrgId).WarehouseName) }).ToList(); List <ItemTypeViewModel> itemTypeViewModels = new List <ItemTypeViewModel>(); AutoMapper.Mapper.Map(itemTypesDomains, itemTypeViewModels); return(View(itemTypeViewModels)); }