示例#1
0
        public AssignViewModelBuilder GetViewModelItemBuilder(string siv)
        {
            var totalRecords = 0;

            if (!string.IsNullOrEmpty(siv))
            {
                var itemDetailList = this.contextSub.V3_GetAssignedStockBySIV(siv).ToList();
                totalRecords = itemDetailList.Count();

                var viewModelBuilder = new AssignViewModelBuilder
                {
                    Stores   = new SelectList(this.contextSub.V3_GetStoreDDL(), "Id", "sName"),
                    Projects = new SelectList(this.contextSub.V3_GetProjectDDL(), "Id", "vProjectName"),
                    AssignedStockBySivResults = itemDetailList,
                    TotalRecords = totalRecords,
                    Siv          = siv
                };
                return(viewModelBuilder);
            }
            else
            {
                var viewModelBuilder = new AssignViewModelBuilder
                {
                    AssignStock  = new WAMS_ASSIGNNING_STOCKS(),
                    Stores       = new SelectList(this.contextSub.V3_GetStoreDDL(), "Id", "sName"),
                    Projects     = new SelectList(this.contextSub.V3_GetProjectDDL(), "Id", "vProjectName"),
                    TotalRecords = totalRecords,
                    Siv          = string.Empty
                };
                return(viewModelBuilder);
            }
        }
示例#2
0
        public AssignViewModelBuilder GetViewModelIndex()
        {
            var viewModelBuilder = new AssignViewModelBuilder
            {
                Stores     = new SelectList(contextSub.V3_GetStoreDDL(), "Id", "sName"),
                Projects   = new SelectList(contextSub.V3_GetProjectDDL(), "Id", "vProjectName"),
                StockTypes = new SelectList(contextSub.V3_GetStockTypeDDL(), "Id", "vTypeName")
            };

            return(viewModelBuilder);
        }
示例#3
0
        public AssignViewModelBuilder GetViewModelAssignList(int page, int size, int store, int pro, int stype, string stock, string siv, string fd, string td)
        {
            var output = new ObjectParameter("ItemCount", typeof(int));
            var data   = contextSub.V3_AssignStock_GetList(page, size, store, pro, stype, stock, siv, string.Empty, 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 AssignViewModelBuilder
            {
                V3AssignStockGetListResults = data,
                TotalRecords = Convert.ToInt32(totalRecord),
                TotalPages   = totalPages,
                CurrentPage  = page,
                PageSize     = size
            };

            return(viewModel);
        }