Beispiel #1
0
 public static void DeleteType(TypeSalaryModel t)
 {
     using (IDbConnection cnn = new SQLiteConnection(LoadConectionString()))
     {
         cnn.Execute("delete from TypeSalary where ID=@ID", t);
     }
 }
Beispiel #2
0
 public static void SaveType(TypeSalaryModel t)
 {
     using (IDbConnection cnn = new SQLiteConnection(LoadConectionString()))
     {
         cnn.Execute("insert into TypeSalary (Name) values (@Name)", t);
     }
 }
Beispiel #3
0
        private void metroButton2_Click(object sender, EventArgs e)
        {
            FrmType ft = new FrmType();

            ft.ShowDialog();
            txtname.Text = ft.ts.Name;
            t            = ft.ts;
        }
Beispiel #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            TypeSalaryModel t = new TypeSalaryModel();

            t.Name = txtname.Text;
            SqlliteDataAccess.SaveType(t);
            FMessageBox.Show("با موفقیت ذخیره شد", "پیام");
            InitializeBinding();
        }
Beispiel #5
0
        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();
        }