コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: Bil.cs プロジェクト: FrederikHKoch/GruppeProjekt
        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);
        }
コード例 #3
0
        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);
        }