本文整理汇总了C#中Profile.IssueBook方法的典型用法代码示例。如果您正苦于以下问题:C# Profile.IssueBook方法的具体用法?C# Profile.IssueBook怎么用?C# Profile.IssueBook使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profile
的用法示例。
在下文中一共展示了Profile.IssueBook方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnIssue_Click
protected void btnIssue_Click(object sender, EventArgs e)
{
lblEMsg.Visible = false;
string[] iBook;
try
{
SqlDataReader sdr;
Profile pro = new Profile();
int aQty = Convert.ToInt32(txtQuantity.Text.ToString());
if (aQty == 0)
{
lblEMsg.Visible = true;
lblEMsg.Text = "This book is Out of stock, please select a different book.";
return;
}
string sql = "SELECT Count(1) FROM Book_Transaction WHERE Book_ID = '" + LstBook.SelectedItem.Text + "' And Member_ID = '" + DropDownList1.SelectedItem.Text + "' And Actual_Return_Date Is Null";
sdr = pro.ReturnMDetails(sql);
sdr.Read();
int iB = (int)sdr[0];
if (iB > 0)
{
lblEMsg.Visible = true;
lblEMsg.Text = "This book is already issued, please select a different book.";
return;
}
sdr.Close();
//Insert the data.
iBook = new string[4];
iBook[0] = LstBook.SelectedItem.Text;
iBook[1] = DropDownList1.SelectedItem.Text;
iBook[2] = txtIDate.Text;
iBook[3] = txtRDate.Text;
bool status;
status = pro.IssueBook(iBook);
if (status == false)
{
lblEMsg.Visible = true;
lblEMsg.Text = "Book Issuing Failed";
}
lblEMsg.Visible = true;
lblEMsg.Text = "Book Issued.";
DropDownList1.Text = "";
LstBook.Text = "";
txtBTitle.Text = "";
txtAuthor.Text = "";
txtPub.Text = "";
txtCat.Text = "";
txtSup.Text = "";
txtQuantity.Text = "";
txtPrice.Text = "";
txtRDate.Text = "";
Label9.Text = "";
return;
}
catch (Exception ex)
{
lblEMsg.Visible = true;
lblEMsg.Text = ex.Message;
}
}