private void cb_user_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (cb_user.SelectedIndex == 1) { UserShow us = new UserShow(borrowuser); us.ShowDialog(); } if (cb_user.SelectedIndex == 2) { WrenchBorrowHistory wbh = new WrenchBorrowHistory(); List <BorrowHistory> bhl = wbh.GetByUser(Borrow.SelectByUser(SystData.userInfo.user.guid)); UserBorrow ub = new UserBorrow(bhl); ub.ShowDialog(); } this.cb_user.SelectedIndex = 0; }
private void cb_wrench_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (cb_wrench.SelectedIndex == 1) { if (!string.IsNullOrEmpty(this.wrenchbarcode.Text.Trim())) { GetWrenchInfo gwi = new GetWrenchInfo(); wrenchinfo wi = gwi.GetWrenchinfo(this.wrenchbarcode.Text.Trim()); if (wi == null) { MessageAlert.Alert("没有任何详细信息!"); } else { WrenchShow us = new WrenchShow(wi); us.ShowDialog(); } } } if (cb_wrench.SelectedIndex == 2) { if (string.IsNullOrEmpty(this.wrenchbarcode.Text.Trim())) { return; } WrenchBorrowHistory wbh = new WrenchBorrowHistory(); wrench w = Wrench.selectByBarcode(this.wrenchbarcode.Text.Trim()); if (w == null) { return; } List <BorrowHistory> bhl = wbh.GetByUser(Borrow.SelectByWrench(w.guid)); UserBorrow ub = new UserBorrow(bhl); ub.ShowDialog(); } this.cb_wrench.SelectedIndex = 0; }