public static void Delete() { Console.WriteLine("Vælg kunde du vil slette (Kundeid)"); int delAnswer = Convert.ToInt32(ErrorHandling.IsNumberValid(Console.ReadLine())); string fullSentence = "delete from customers where id = ('" + delAnswer + "')"; SQLCon.Delete(fullSentence); }
public static void Delete() { Console.WriteLine("Vælg kunde du vil slette bil (Regnr)"); string delAnswer = ErrorHandling.IsRegValid(Console.ReadLine()); string fullSentence = "delete from car where RegNr = ('" + delAnswer + "')"; SQLCon.Delete(fullSentence); }
public static void Delete() { Console.WriteLine("Vælg bil du vil slette(RegNr) fra værkstedet"); string delAnswer = ErrorHandling.IsRegValid(Console.ReadLine()); string insertSentence = "insert into CarLibary(RegNr, VisitDate, LeftDate) Values ((select RegNr from CarLog where RegNr = ('" + delAnswer + "')), (select VisitDate from CarLog where RegNr = ('" + delAnswer + "')), GETDATE())"; string fullSentence = "DELETE FROM CarLog WHERE RegNr = ('" + delAnswer + "')"; SQLCon.Insert(insertSentence); SQLCon.Delete(fullSentence); }