public static void DeleteType(TypeSalaryModel t) { using (IDbConnection cnn = new SQLiteConnection(LoadConectionString())) { cnn.Execute("delete from TypeSalary where ID=@ID", t); } }
public static void SaveType(TypeSalaryModel t) { using (IDbConnection cnn = new SQLiteConnection(LoadConectionString())) { cnn.Execute("insert into TypeSalary (Name) values (@Name)", t); } }
private void metroButton2_Click(object sender, EventArgs e) { FrmType ft = new FrmType(); ft.ShowDialog(); txtname.Text = ft.ts.Name; t = ft.ts; }
private void button1_Click(object sender, EventArgs e) { TypeSalaryModel t = new TypeSalaryModel(); t.Name = txtname.Text; SqlliteDataAccess.SaveType(t); FMessageBox.Show("با موفقیت ذخیره شد", "پیام"); InitializeBinding(); }
private void button2_Click(object sender, EventArgs e) { TypeSalaryModel t = new TypeSalaryModel(); t.ID = Convert.ToInt32(dgvhokm.CurrentRow.Cells[0].Value); SqlliteDataAccess.DeleteType(t); FMessageBox.Show("با موفقیت حذف شد", "پیام"); txtname.ResetText(); InitializeBinding(); }