コード例 #1
0
        public static bool Insert(SQLiteConnection conn, Inspection i, out string error)
        {
            if (i.InspectionDate >= i.ValidTo)
            {
                error = "Chybně vyplněné datum platnosti STK.";
                return(false);
            }

            if (i.Price < 0)
            {
                error = "Chybně vyplněná cena STK.";
                return(false);
            }

            int result = InspectionDbMapper.Insert(conn, i);

            if (result != 0)
            {
                error = "Prohlídku se nepodařilo uložit do DB.";
            }

            error = "";
            return(true);
        }