コード例 #1
0
 public static void SaveHokm(HokmModel p)
 {
     using (IDbConnection cnn = new SQLiteConnection(LoadConectionString()))
     {
         cnn.Execute("insert into Hokm (Name,Price,PersonID) values (@Name,@Price,@PersonID)", p);
     }
 }
コード例 #2
0
 public static void DeleteHokm(HokmModel p)
 {
     using (IDbConnection cnn = new SQLiteConnection(LoadConectionString()))
     {
         cnn.Execute("delete from Hokm where ID=@ID ", p);
     }
 }
コード例 #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            HokmModel h = new HokmModel();

            h.ID = Convert.ToInt32(dgvhokm.CurrentRow.Cells[0].Value.ToString());

            SqlliteDataAccess.DeleteHokm(h);
            FMessageBox.Show("با موفقیت حذف شد", "پیام", FMessageBoxButtons.OK, FMessageBoxIcons.Information);

            InitializeBinding();
        }
コード例 #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            HokmModel h = new HokmModel();

            h.Name     = txtname.Text;
            h.Price    = Convert.ToInt32(txtprice.Text);
            h.PersonID = p.ID;

            SqlliteDataAccess.SaveHokm(h);
            InitializeBinding();
        }