コード例 #1
0
        public void Create(Component value)
        {
            var command = new SqlCommand("INSERT INTO Component VALUES (" +
                                         "@name," +
                                         "@price," +
                                         "@perfomance," +
                                         "@TypePart," +
                                         "@TypeFormat," +
                                         "@TypeMemory," +
                                         "@Socket," +
                                         "@HasIntegratedVideo," +
                                         "@Channels," +
                                         "@VideoLevel," +
                                         "@FanLevel," +
                                         "@NeedHighFrecuency," +
                                         "@Capacity," +
                                         "@FanSize," +
                                         "@MaxFrecuency," +
                                         "@Stock," +
                                         "@Watts," +
                                         "@Stock_Limit)");

            PopulateComponent.Command(value, command);
            connection.Execute(command);
        }
コード例 #2
0
        public void Update(Component value)
        {
            var command = new SqlCommand("UPDATE Component SET " +
                                         "Name = @name, " +
                                         "Price = @price, " +
                                         "perfomance = @perfomance, " +
                                         "TypePart = @TypePart, " +
                                         "TypeFormat = @TypeFormat, " +
                                         "TypeMemory = @TypeMemory, " +
                                         "Socket = @Socket, " +
                                         "HasIntegratedVideo = @HasIntegratedVideo, " +
                                         "Channels = @Channels, " +
                                         "VideoLevel = @VideoLevel, " +
                                         "FanLevel = @FanLevel," +
                                         "NeedHighFrecuency = @NeedHighFrecuency," +
                                         "Capacity = @Capacity," +
                                         "FanSize = @FanSize," +
                                         "MaxFrecuency = @MaxFrecuency," +
                                         "Stock = @Stock," +
                                         "Watts = @Watts," +
                                         "Stock_Limit = @Stock_Limit WHERE ID = @id");

            PopulateComponent.Command(value, command);
            connection.Execute(command);
        }