using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
namespace Example_2
{
/// <summary>
/// frmIssueBooks 的摘要说明。
/// </summary>
public class frmIssueBooks : System.Windows.Forms.Form
{
private System.Windows.Forms.Button btnBorrowBook;
private System.Windows.Forms.GroupBox grpInsertDetails;
private System.Windows.Forms.TextBox txtAuthor;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtBookAccessCode;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtStdID;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtStdName;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnExit;
private System.Windows.Forms.GroupBox grpBookDetails;
private System.Windows.Forms.DataGrid dbgBooksDt;
private System.Windows.Forms.ComboBox cboBookName;
private System.Windows.Forms.TextBox txtIssueDate;
private System.Windows.Forms.Label label6;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
private SqlDataAdapter objSqlDataAdapter,objBkDtAdapt;
private SqlConnection objSqlConn;
private DataSet objDataSet,objBkDtDs;
private SqlParameter objParam;
public frmIssueBooks()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
///
private bool ValidateFields()
{
bool returnValue=true;
//检查图书访问码是否为空
if(this.txtBookAccessCode.Text.Trim()==string.Empty)
{
MessageBox.Show("提供完整的详细信息");
return false;
}
else
{
//检查学生姓名是否包含任何数字数