public bool ThemNgonNgu(NgonNguSachDb nn) { try { String sql = "INSERT INTO [NgonNguSach]([TenNgonNguSach]) " + " VALUES(@TenNgonNguSach)"; dt = dpro.GetRecordSet(sql, new DatabaseParamCls[] { new DatabaseParamCls("TenNgonNguSach", nn.TenNgonNguSach), }); return(true); } catch (Exception e) { throw e; } return(false); }
public bool SuaNgonNgu(NgonNguSachDb nn) { try { String sql = "UPDATE [NgonNguSach] " + " SET [TenNgonNguSach] = @TenNgonNguSach " + " WHERE TheLoai.ID = @ID"; dt = dpro.GetRecordSet(sql, new DatabaseParamCls[] { new DatabaseParamCls("TenNgonNguSach", nn.TenNgonNguSach), new DatabaseParamCls("ID", nn.ID) }); return(true); } catch (Exception e) { throw e; } return(false); }
public NgonNguSachDb getNgonNguById(int ID) { try { String sql = "Select * from NgonNguSach nn where nn.id = @ID "; dt = dpro.GetRecordSet(sql, new DatabaseParamCls[] { new DatabaseParamCls("ID", ID) }); if (dt.Rows.Count >= 0) { var item = dt.Rows[0]; NgonNguSachDb nn = new NgonNguSachDb(); nn.ID = Convert.ToInt16(item["id"].ToString()); nn.TenNgonNguSach = item["TenNgonNguSach"].ToString(); return(nn); } } catch (Exception e) { Console.WriteLine(e.Message); } return(null); }
public bool SuaNgonNgu(NgonNguSachDb nn) { return(ngonnguDAL.SuaNgonNgu(nn)); }
public bool ThemNgonNgu(NgonNguSachDb nn) { return(ngonnguDAL.ThemNgonNgu(nn)); }