Exemplo n.º 1
0
 public override Boolean add(LogicAssets.Gift gift)
 {
     using (SQLiteCommand insert = new SQLiteCommand())
     {
         insert.CommandText = "INSERT INTO gift (name,gift_list,weight) Values (@name,@gift_list,@weight)";
         insert.Parameters.AddWithValue("name", gift.name);
         insert.Parameters.AddWithValue("gift_list", gift.giftList);
         insert.Parameters.AddWithValue("weight", gift.weight);
         return(this.db.addProcedure(insert));
     }
 }
Exemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     LogicAssets.Gift gift = new LogicAssets.Gift();
     gift.name     = this.giftName.Text;
     gift.giftList = Int32.Parse(this.giftLists.SelectedValue.ToString());
     gift.weight   = (int)Enum.Parse(typeof(Weight), frequency.SelectedValue.ToString());
     if (user.add(gift))
     {
         MessageBox.Show("Gift Was Added");
     }
     else
     {
         MessageBox.Show("Something is wrong");
     }
 }
Exemplo n.º 3
0
 public virtual Boolean add(LogicAssets.Gift gift)
 {
     return(false);
 }