Exemple #1
0
        public static Jet updateJet(Jet jet)
        {
            string sql = @"update dbo.Jets
                            set SerialNumber = @serialNumber,
                                ModelName = @modelName
                                where Id = @id;";

            SqlAccess.SaveData(sql, jet);
            return(jet);
        }
Exemple #2
0
        public static List <Jet> CreateJet(string modelName, int serialNumber)
        {
            Jet jet = new Jet
            {
                modelName    = modelName,
                serialNumber = serialNumber
            };
            string sql = @"insert into dbo.Jets (ModelName, SerialNumber)    
                             values(@modelName, @serialNumber);";

            SqlAccess.SaveData(sql, jet);
            string returnSql = @"select * from dbo.Jets where SerialNumber = " + serialNumber + ";";

            return(SqlAccess.LoadData <Jet>(returnSql));
        }