/// <summary> /// 查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click_27(object sender, RoutedEventArgs e) { Dictionary <string, string> d = new Dictionary <string, string>(); d.Add("guid", "f1e06654-dc4d-4d13-a549-837850b3a480"); IBorrow Borrow = new MySqlBorrow(); List <borrow> bl = Borrow.SelectByCondition(d); MessageBox.Show(bl.Count.ToString()); }
/// <summary> /// 扳手归还 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click_26(object sender, RoutedEventArgs e) { Dictionary <string, string> d = new Dictionary <string, string>(); d.Add("guid", "f1e06654-dc4d-4d13-a549-837850b3a480"); IBorrow Borrow = new MySqlBorrow(); List <borrow> bl = Borrow.SelectByCondition(d); borrow b = bl.FirstOrDefault(); b.returnDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); b.returnOperator = "374b4fde-f46d-446a-aa62-331764bc5f57"; b.returnUser = "******"; MessageBox.Show(Borrow.Update(b).ToString()); }
/// <summary> /// 扳手借出 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click_25(object sender, RoutedEventArgs e) { IBorrow Borrow = new MySqlBorrow(); borrow b = new borrow() { WrenchID = "1", borrowDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), borrowOperator = "374b4fde-f46d-446a-aa62-331764bc5f57", borrowUser = "******", guid = Guid.NewGuid().ToString() }; MessageBox.Show(Borrow.add(b).ToString()); }