当前位置: 首页>>代码示例>>C#>>正文


C# DBManager.SaveBookS方法代码示例

本文整理汇总了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);
            }
        }
开发者ID:salamcseiu21,项目名称:Library-Management-With-CSharp-Desktop-,代码行数:34,代码来源:Form1.cs

示例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);
            }
        }
开发者ID:salamcseiu21,项目名称:Library-Management-With-CSharp-Desktop-,代码行数:51,代码来源:Form1.cs


注:本文中的Project_Librari_Management.BLL.DBManager.SaveBookS方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。