public bool Crear(Models.LibroModel objnew) { string sqlstm = "INSERT INTO titles(title_id, title, type, pub_id, price, advance, royalty, ytd_sales, notes, pubdate)"; sqlstm += "VALUES('" + objnew.Titleid + "'"; sqlstm += ",'" + objnew.Name + "'"; sqlstm += ",'" + objnew.Type + "'"; sqlstm += ",'" + objnew.EditorID + "'"; sqlstm += "," + objnew.Price.ToString(); sqlstm += "," + objnew.Avance.ToString(); sqlstm += "," + objnew.Royal.ToString(); sqlstm += "," + objnew.YearSales.ToString(); sqlstm += ",'" + objnew.Notas + "'"; sqlstm += ",'" + objnew.FechaPublicado + "');"; return(Cambiar(sqlstm)); }
public bool Update(Models.LibroModel objupdate) { string sqlstm = "UPDATE titles"; sqlstm += "\n SET title ='" + objupdate.Name + "'"; sqlstm += ", type = '" + objupdate.Type + "'"; sqlstm += ",pub_id = '" + objupdate.EditorID + "'"; sqlstm += ",price = " + objupdate.Price.ToString(); sqlstm += ",advance =" + objupdate.Avance.ToString(); sqlstm += ", royalty =" + objupdate.Royal.ToString(); sqlstm += ",ytd_sales =" + objupdate.YearSales.ToString(); sqlstm += ",notes ='" + objupdate.Notas + "'"; sqlstm += ",pubdate = '" + objupdate.FechaPublicado + "'"; sqlstm += " \n WHERE title_id = '" + objupdate.Titleid + "';"; /*PK mandatorio para update */ return(Cambiar(sqlstm)); }
public bool Delete(Models.LibroModel objdel) { throw new NotImplementedException(); }
public bool Update(Models.LibroModel objupdate) { throw new NotImplementedException(); }
public bool Crear(Models.LibroModel objnew) { throw new NotImplementedException(); }