public PartialViewResult _Batch(string pipelineDuns) { var identity = (ClaimsPrincipal)Thread.CurrentPrincipal; string shipperDuns = identity.Claims.Where(c => c.Type == "ShipperDuns") .Select(c => c.Value).SingleOrDefault(); var UserKey = new Guid(identity.Claims.Where(c => c.Type == "UserId") .Select(c => c.Value).SingleOrDefault()); BatchNomCollection batchListModel = new BatchNomCollection(); batchListModel.BatchList = new List <BatchDTO>(); batchListModel.pipelineDuns = pipelineDuns; batchListModel.showMine = Session["showMinebatch"] == null? true : (bool)Session["showMinebatch"]; DateTime todayDate = DateTime.Now.Date; var currentmonth = todayDate.Month; batchListModel.StartDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); batchListModel.EndDate = batchListModel.StartDate.AddMonths(2); batchListModel.StatusId = -1; List <BatchDTO> batchList = pntNominationService.GetBatches("", pipelineDuns, batchListModel.StatusId, todayDate.AddDays(-15), todayDate.AddDays(15), 1, 1000, batchListModel.showMine ? UserKey : Guid.Empty, shipperDuns).ToList(); batchListModel.BatchList = batchList.OrderByDescending(a => a.CreatedDate).ToList(); var Status = metadataFileStatusService.GetNomStatus(); ViewBag.StatusID = Status; var notifier = _notifierEntityService.GetNotifierEntityForNoms(UserKey.ToString());//.GetNotifierEntityofBatchTable(); ViewBag.NotifierEntity = notifier; return(PartialView(batchListModel)); // return this.View(batchListModel); }
public PartialViewResult _Batch(BatchNomCollection batchListModel, string Search) { Session["showMinebatch"] = batchListModel.showMine; if (Search == null) { return(null); } else { var identity = (ClaimsPrincipal)Thread.CurrentPrincipal; string shipperDuns = identity.Claims.Where(c => c.Type == "ShipperDuns") .Select(c => c.Value).SingleOrDefault(); var UserKey = Guid.Parse(identity.Claims.Where(c => c.Type == "UserId") .Select(c => c.Value).SingleOrDefault()); batchListModel.BatchList = new List <BatchDTO>(); List <BatchDTO> batchList = pntNominationService.GetBatches("", batchListModel.pipelineDuns, batchListModel.StatusId, batchListModel.StartDate, batchListModel.EndDate, 1, 1000, batchListModel.showMine? UserKey:Guid.Empty, shipperDuns).ToList(); batchListModel.BatchList = batchList.OrderByDescending(a => a.CreatedDate).ToList(); var Status = metadataFileStatusService.GetNomStatus(); ViewBag.StatusID = Status; var notifier = _notifierEntityService.GetNotifierEntityForNoms(UserKey.ToString());//GetNotifierEntityofBatchTable(); ViewBag.NotifierEntity = notifier; return(PartialView("_Batch", batchListModel)); //return this.View(batchListModel); } }