//---------------------------------------------------------------- //HAM PHU public void addParameter(SqlCommand cmd, ET_TheLoai eT_TheLoai, String[] strNameParametor) { ArrayList list = eT_TheLoai.getAllProperties(); foreach (string item in strNameParametor) { SqlParameter pt = new SqlParameter(item, list[Array.IndexOf(strNameParametor, item)]); cmd.Parameters.Add(pt); } }
//---------------------------------------------------------------- //THEM, XOA, SUA public bool themTheLoai(ET_TheLoai eT_TheLoai) { try { openDB(); SqlCommand cmd = HandleCMD.proc("sp_ThemTheLoai", _con); addParameter(cmd, eT_TheLoai, strNameParametor); if (this.cmdExecuted(cmd)) { return(true); } } catch (Exception ex) { Console.WriteLine("ERROR: " + ex.Message); return(false); } finally { closeDB(); } return(false); }
public bool suaChiTietHD(ET_TheLoai eT_TheLoai) { return(dal_theLoai.suaTheLoai(eT_TheLoai)); }
public bool themChiTietHD(ET_TheLoai eT_TheLoai) { return(dal_theLoai.themTheLoai(eT_TheLoai)); }