本文整理汇总了C#中Profile.ReturnBook方法的典型用法代码示例。如果您正苦于以下问题:C# Profile.ReturnBook方法的具体用法?C# Profile.ReturnBook怎么用?C# Profile.ReturnBook使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profile
的用法示例。
在下文中一共展示了Profile.ReturnBook方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnReturn_Click
protected void btnReturn_Click(object sender, EventArgs e)
{
lblEMsg.Visible = false;
string[] iBook;
try
{
SqlDataReader sdr;
Profile pro = new Profile();
//Check if any book is issued for this member.
string sql = "SELECT Count(1) FROM Book_Transaction WHERE Member_ID = '" + lstMember.SelectedItem.ToString() + "' And Book_ID = '" + LstBook.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 = "No Book is issued for this member, please select the correct member";
return;
}
sdr.Close();
//Insert the data.
iBook = new string[4];
iBook[0] = LstBook.SelectedItem.Text;
iBook[1] = lstMember.SelectedItem.Text;
iBook[2] = txtARDate.Text;
iBook[3] = txtLFee.Text;
bool status;
status = pro.ReturnBook(iBook);
if (status == false)
{
lblEMsg.Visible = true;
lblEMsg.Text = "Book Returning Failed";
}
lblEMsg.Visible = true;
lblEMsg.Text = "Book Returned.";
lstMember.Text = "";
LstBook.Text = "";
txtBTitle.Text = "";
txtAuthor.Text = "";
txtPub.Text = "";
txtCat.Text = "";
txtSup.Text = "";
txtRDate.Text = "";
txtIDate.Text = "";
lblName.Text = "";
txtLFee.Text = "";
return;
}
catch (Exception ex)
{
lblEMsg.Visible = true;
lblEMsg.Text = ex.Message;
}
}