public ReturnViewModelBuilder GetViewModelItemBuilder(string srv) { var totalRecords = 0; if (!string.IsNullOrEmpty(srv)) { var itemDetailList = this.contextSub.V3_GetReturnedStockBySRV(srv).ToList(); totalRecords = itemDetailList.Count(); var viewModelBuilder = new ReturnViewModelBuilder { Stores = new SelectList(this.contextSub.V3_GetStoreDDL(), "Id", "sName"), Projects = new SelectList(this.contextSub.V3_GetProjectDDL(), "Id", "vProjectName"), ReturnedStockBySrvResults = itemDetailList, TotalRecords = totalRecords, Srv = srv }; return(viewModelBuilder); } else { var viewModelBuilder = new ReturnViewModelBuilder { ReturnStock = new WAMS_RETURN_LIST(), Stores = new SelectList(this.contextSub.V3_GetStoreDDL(), "Id", "sName"), Projects = new SelectList(this.contextSub.V3_GetProjectDDL(), "Id", "vProjectName"), TotalRecords = totalRecords, Srv = string.Empty }; return(viewModelBuilder); } }
public ReturnViewModelBuilder GetViewModelIndex() { var viewModelBuilder = new ReturnViewModelBuilder { Stores = new SelectList(this.contextSub.V3_GetStoreDDL(), "Id", "sName"), Projects = new SelectList(this.contextSub.V3_GetProjectDDL(), "Id", "vProjectName"), StockTypes = new SelectList(this.contextSub.V3_GetStockTypeDDL(), "Id", "vTypeName") }; return(viewModelBuilder); }
public ReturnViewModelBuilder GetViewModelAssignList(int page, int size, int store, int pro, int stype, string stock, string srv, string acc, string fd, string td) { var output = new ObjectParameter("ItemCount", typeof(int)); var data = this.contextSub.V3_ReturnStock_GetList(page, size, store, pro, stype, stock, srv, acc, fd, td, output).ToList(); var totalRecord = output.Value; var totalTemp = Convert.ToDecimal(totalRecord) / Convert.ToDecimal(size); var totalPages = Convert.ToInt32(Math.Ceiling(totalTemp)); var viewModel = new ReturnViewModelBuilder { V3ReturnStockGetListResults = data, TotalRecords = Convert.ToInt32(totalRecord), TotalPages = totalPages, CurrentPage = page, PageSize = size }; return(viewModel); }