private void bt_search_Click(object sender, RoutedEventArgs e) { //if (string.IsNullOrEmpty(this.contion.Text.Trim())) //{ // MessageAlert.Alert("请填写查询条件!"); // return; //} bool?isreturn = null; if (this.cb_isreturn.SelectedIndex == 1) { isreturn = true; } if (this.cb_isreturn.SelectedIndex == 2) { isreturn = false; } List <borrow> bl = Getborrowlist(this.starttime.ToString(), Convert.ToDateTime(this.endtime.SelectedDate).AddDays(1).AddSeconds(-1).ToString(), GetContion(this.contion.Text.Trim()), isreturn); List <BorrowHistory> bhl = null; if (bl != null && bl.Count > 0) { WrenchBorrowHistory wbh = new WrenchBorrowHistory(); bhl = wbh.GetByUser(bl); } DgBind(bhl); }
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; }