public bool Update_TrongTai(TrongTai tt) { SqlParameter[] pa = new SqlParameter[3]; pa[0] = new SqlParameter("@matt", tt.Matt); pa[1] = new SqlParameter("@tentt", tt.Tentt); pa[2] = new SqlParameter("@ngaysinh", tt.Ngaysinh); return SQLProvider.Execute_NonQuery("Update_trongtai", pa); }
public bool Insert_TrongTai(TrongTai tt) { SqlParameter[] pa = new SqlParameter[3]; string ma = "TT"; int madb = 0; if (string.Compare(tt.Matt, "") != 0) { madb = int.Parse(tt.Matt.Replace("TT", "")); } madb++; if (madb < 10) { tt.Matt = ma + "0" + madb; } else { tt.Matt = ma + madb; } pa[0] = new SqlParameter("@matt", tt.Matt); pa[1] = new SqlParameter("@tentt", tt.Tentt); pa[2] = new SqlParameter("@ngaysinh", tt.Ngaysinh); return SQLProvider.Execute_NonQuery("insert_trongtai", pa); }
public bool Update_TrongTai(TrongTai tt) { TrongTaiAdapter a = TrongTaiAdapter.CreateTrongTaiAdapter(); return a.Update_TrongTai(tt); }
//Tab Trong tai public bool Insert_TrongTai(TrongTai tt) { TrongTaiAdapter a = TrongTaiAdapter.CreateTrongTaiAdapter(); return a.Insert_TrongTai(tt); }
public bool Delete_TrongTai(TrongTai tt) { SqlParameter[] pa = new SqlParameter[1]; pa[0] = new SqlParameter("@matt", tt.Matt); return SQLProvider.Execute_NonQuery("Delete_trongtai", pa); }