public ConfidentialMembers_Borrowinfo() { InitializeComponent(); InitTable(); TableToBorrow.DataTableSelect(SQL, "更新"); TableToBorrow.dataGrid.SelectionChanged += TableToBorrow_SelectionChanged; BorrowTotal.Content = TableToBorrow.dt.Rows.Count; }
public void InitTable() { TableToBorrow.InitTableHeightWidth(480, 880); TableToBorrow.SetCanUserAddRows(false); TableToBorrow.AddColumns("Id", "借阅号", 80); TableToBorrow.AddColumns("DataNo", "资料编号", 80); TableToBorrow.AddColumns("LendDate", "借阅日期", 240); TableToBorrow.AddColumns("RyId", "借阅人编号", 120); TableToBorrow.AddColumns("LendCount", "借阅数量", 120); TableToBorrow.AddColumns("Ryname", "审批人", 120); TableToBorrow.AddColumns("Flag", "借阅状态", 120); Inittthlbm(); }
private void CommitChanges_Click(object sender, RoutedEventArgs e) { string Str = FlagString(); string SQL1 = "update DataLend set Flag = '" + Str + "' where Id ='" + SelectId + "'"; try { SqlCommand CMD_1 = new SqlCommand(SQL1, Temp.GetConn()); CMD_1.ExecuteNonQuery(); } catch (Exception ex) { MessageBox.Show("错误:\n\n" + ex); return; } TableToBorrow.DataTableSelect(SQL, "更新"); MessageBox.Show("修改成功!"); }
public void Inittthlbm() { string Str = "无操作"; TableToBorrow.dgMenu.Items.Add(TableToBorrow.AddMenuItem(Str)); }
private void ExportTwo_Click(object sender, RoutedEventArgs e) { string[] Str = { "借阅号", "借阅资料编号", "借阅日期", "借阅人编号", "借阅数量", "借阅人名字", "借阅标记" }; TableToBorrow.ExportExcel(SQL, Str, "借阅表.xlsx"); }