Exemplo n.º 1
0
 public IActionResult Index()
 {
     ViewBag.Dept     = _deptServices.QueryableToList(c => c.IsDel == 1);
     ViewBag.Device   = _dictServices.Queryable().Where(c => c.IsDel == 1 && c.DictType == SqlFunc.ToString(Convert.ToInt32(PubDictType.device))).ToList();
     ViewBag.Property = _dictServices.Queryable().Where(c => c.IsDel == 1 && c.DictType == SqlFunc.ToString(Convert.ToInt32(PubDictType.property))).ToList();;
     return(View());
 }
Exemplo n.º 2
0
        public IActionResult Index()
        {
            var list          = _dictServices.Queryable().Where(c => c.IsDel == 1 && c.DictType == PubDictType.stockin.ToInt32().ToString()).ToList();
            var stockInStatus = EnumExt.ToKVListLinq <StockInStatus>();

            ViewBag.StockInType   = list;
            ViewBag.StockInStatus = stockInStatus;
            return(View());
        }
Exemplo n.º 3
0
        public async Task <IViewComponentResult> InvokeAsync(string type)
        {
            var d     = EnumExt.GetDescription <PubDictType>(type);
            var value = 0;
            var obj   = type.ToEnum <PubDictType>();

            switch (obj)
            {
            case PubDictType.unit:
                value             = Convert.ToInt32(PubDictType.unit);
                ViewData["field"] = "Unit";
                break;

            case PubDictType.material:
                value             = Convert.ToInt32(PubDictType.material);
                ViewData["field"] = "MaterialType";
                break;

            case PubDictType.stockin:
                value             = Convert.ToInt32(PubDictType.stockin);
                ViewData["field"] = "StockinType";
                break;

            case PubDictType.stockout:
                value             = Convert.ToInt32(PubDictType.stockout);
                ViewData["field"] = "StockoutType";
                break;

            case PubDictType.device:
                value             = Convert.ToInt32(PubDictType.device);
                ViewData["field"] = "DeviceType";
                break;

            case PubDictType.property:
                value             = Convert.ToInt32(PubDictType.property);
                ViewData["field"] = "PropertyType";
                break;

            default:
                break;
            }
            var list = await _dictServices.Queryable().Where(c => c.IsDel == 1 && c.DictType == SqlSugar.SqlFunc.ToString(value))
                       .ToListAsync();

            ViewData["type"] = d;
            return(View(list));
        }