Example #1
0
        public SelectToolViewModel()
        {
            ToolCategoryDao deptDao = new ToolCategoryDao();
            var             deptrlt = deptDao.GetToolCategorys();

            if (deptrlt.HasError)
            {
                MessageAlert.Alert(deptrlt.Msg);
                return;
            }
            ToolCategory ctgAll = new ToolCategory()
            {
                Id   = 0,
                Name = "全部"
            };

            deptrlt.Entities.Insert(0, ctgAll);
            Categorys = deptrlt.Entities;
            Search();
        }
Example #2
0
        public ToolListViewModel()
        {
            MessengerInstance.Register <object>(this, MsgToken.RefreshToolList, RefreshList);
            RefreshList(null);

            ToolStateDao stateDao = new ToolStateDao();
            var          deptrlt  = stateDao.GetToolStates();

            if (deptrlt.HasError)
            {
                MessageAlert.Alert(deptrlt.Msg);
            }
            ToolCategoryDao toolCategoryDao = new ToolCategoryDao();
            var             categoryrlt     = toolCategoryDao.GetToolCategorys();

            if (categoryrlt.HasError)
            {
                MessageAlert.Alert(categoryrlt.Msg);
            }
            ToolCategory categoryAll = new ToolCategory()
            {
                Id   = 0,
                Name = "全部"
            };

            categoryrlt.Entities.Insert(0, categoryAll);
            Categorys = categoryrlt.Entities;

            ToolState deptAll = new ToolState()
            {
                Id   = 0,
                Name = "全部"
            };

            deptrlt.Entities.Insert(0, deptAll);
            States = deptrlt.Entities;
        }