private async void Delete() { if (!Global.HasRight("0303")) { MessageAlert.Alert("权限不足!"); return; } if (SelectedDept == null) { MessageAlert.Alert("请选择要删除的记录!"); return; } var confirm = await MessageAlert.Confirm("确定删除此记录?"); if (!confirm) { return; } DeptDao dao = new DeptDao(); var rlt = dao.DeleteDepartment(SelectedDept.Id); if (rlt.HasError) { MessageAlert.Alert(rlt.Msg); } RefreshList(null); }
public SelectUserViewModel() { DeptDao deptDao = new DeptDao(); var deptrlt = deptDao.GetDepartments(); if (deptrlt.HasError) { MessageAlert.Alert(deptrlt.Msg); return; } Department deptAll = new Department() { Id = 0, Name = "全部" }; deptrlt.Entities.Insert(0, deptAll); Departments = deptrlt.Entities; Search(); }
public UserListViewModel() { MessengerInstance.Register <object>(this, MsgToken.RefreshUserList, RefreshList); RefreshList(null); DeptDao deptDao = new DeptDao(); var deptrlt = deptDao.GetDepartments(); if (deptrlt.HasError) { MessageAlert.Alert(deptrlt.Msg); } //RoleDao roleDao = new RoleDao(); //var rolerlt = roleDao.GetRoles(); //if (rolerlt.HasError) //{ // MessageAlert.Alert(rolerlt.Msg); //} //DutyDao dutyDao = new DutyDao(); //var dutyrlt = dutyDao.GetDuties(); //if (dutyrlt.HasError) //{ // MessageAlert.Alert(dutyrlt.Msg); //} Department deptAll = new Department() { Id = 0, Name = "全部" }; deptrlt.Entities.Insert(0, deptAll); Departments = deptrlt.Entities; //Roles = rolerlt.Entities; //Duties = dutyrlt.Entities; if (App.ICCardReader.IsOpen()) { App.ICCardReader.HandDataBack += ICCardReader_HandDataBack; } }
public IList <Dept> GetAllDepts() { return(DeptDao.GetAll()); }
public Dept GetDept(int deptNo) { return(DeptDao.Get(deptNo)); }
public void DeleteDept(int deptNo) { DeptDao.Delete(deptNo); }
// // Dept // public Dept SaveDept(Dept dept) { return(DeptDao.Save(dept)); }