public ToolReturnViewModel() { Borrower = new User() { Id = 0, Name = "", CardNo = "" }; ReturnOperator = Global.CurrUser; RealReturnTime = DateTime.Now; MessengerInstance.Register <User>(this, MsgToken.TransforUser, TransforUser); MessengerInstance.Register <string>(this, MsgToken.TransforImgPath, TransforImgPath); ToolStateDao dao = new ToolStateDao(); var rlt = dao.GetToolStates(); this.ToolStates = rlt.Entities; App.RFIDReader.HandDataBack += RFIDReader_HandDataBack;; App.ICCardReader.HandDataBack += ICCardReader_HandDataBack; }
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; }