private void InitViewBag(StockTrackViewModel info) { ViewBag.CompanyKindList = new SelectList(CompanyType.GetAll(), "Value", "Text"); // 產品類別 ViewBag.ProductKindList = new SelectList(this._GlobalService.GetProductKindList(), "Value", "Text"); // 排列方式 HashSet <MyTextValue> sort = new HashSet <MyTextValue>(); sort.Add(new MyTextValue { Text = "銷售量", Value = "TotalQty", Disabled = false }); sort.Add(new MyTextValue { Text = "銷售總金額", Value = "TotalAmount", Disabled = false }); sort.Add(new MyTextValue { Text = "毛利率(%)", Value = "GrossProfitMargin", Disabled = false }); ViewBag.SortOrderList = new SelectList(sort, "Value", "Text", null); // 倉庫 ViewBag.WareHouseList = new SelectList(this._GlobalService.GetWarehouseList(), "Key", "Value"); }
private void InitViewBag(CompanyViewModel info) { ViewBag.CompanyKindList = new SelectList(CompanyType.GetAll(), "Value", "Text", info?.CompanyKindID); ViewBag.YseNoList = new SelectList(YesNo.GetAll(), "value", "Text", info?.Activate); }