예제 #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();
        }