本文整理汇总了C#中Project_Librari_Management.BLL.DBManager.SaveBookS方法的典型用法代码示例。如果您正苦于以下问题:C# DBManager.SaveBookS方法的具体用法?C# DBManager.SaveBookS怎么用?C# DBManager.SaveBookS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Project_Librari_Management.BLL.DBManager
的用法示例。
在下文中一共展示了DBManager.SaveBookS方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: saveButton_Click
private void saveButton_Click(object sender, EventArgs e)
{
try
{
SearchAndEdit Search = new SearchAndEdit();
DBManager manager = new DBManager();
Book aBook = new Book();
aBook.SerialNo = serialTextBox.Text;
aBook.BookName = nameTextBox.Text;
aBook.AuthorName = writernameTextBox.Text;
aBook.Edition = comboBox1.SelectedItem.ToString();
aBook.TypeOfBook = b_type;
aBook.Quantity = Convert.ToInt16(quantityTextBox.Text);
aBook.UnitPrice = Convert.ToDouble(uintPriceTextBox.Text);
aBook.PurchasesDate =dateTimePiker.Text;
string status =manager.SaveBookS(aBook);
MessageBox.Show(status,"Message",MessageBoxButtons.OK,MessageBoxIcon.Information);
ClearAllText();
serialTextBox.Text=LastAddedInvestlNo().ToString();
Search.GetALLBooks();
}
catch(FormatException)
{
MessageBox.Show("Please fill up every field properly","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
catch (Exception)
{
MessageBox.Show("Book id must be unique.","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
}
示例2: saveButton_Click
private void saveButton_Click(object sender, EventArgs e)
{
try
{
SearchAndEdit Search = new SearchAndEdit();
DBManager manager = new DBManager();
Book aBook = new Book();
aBook.SerialNo = serialTextBox.Text;
aBook.BookName = nameTextBox.Text;
aBook.AuthorName = writernameTextBox.Text;
aBook.Edition = textBox1.Text;
aBook.TypeOfBook = b_type;
aBook.BookPrint = book_print;
aBook.Quantity = Convert.ToInt16(quantityTextBox.Text);
aBook.UnitPrice = Convert.ToDouble(uintPriceTextBox.Text);
aBook.PurchasesDate =dateTimePiker.Text;
string status =manager.SaveBookS(aBook);
//if (status!=null)
//{
// reader.Dispose();
// reader=new SpeechSynthesizer();
// reader.SpeakAsync(" Saved");
MessageBox.Show(status, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
//}
ClearAllText();
serialTextBox.Text=LastAddedInvestlNo().ToString();
Search.GetALLBooks();
//28-02-2015
ShowAllBook();
ShowAllOldBook();
totalBooks();
nameTextBox.TabIndex = 0;
}
catch(FormatException)
{
MessageBox.Show("Please fill up every field properly","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
catch (Exception)
{
MessageBox.Show("Book Couldn't Save.","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
}