Exemplo n.º 1
0
        public Odgovor BuyItem(string IDi, string IDs, string cena, string IDkupil)
        {
            Odgovor ret = new Odgovor {
                vrednost = false
            };
            string        sql  = "update \"ShoppingListItem\" set Price = @cena, BoughtBy_ID = @idkupu where ID = @id AND Sho_ID = @ids";
            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["LoftApp2ConnectionString"].ConnectionString);

            conn.Open();
            SqlCommand comm = new SqlCommand(sql, conn);

            comm.Parameters.AddWithValue("@cena", cena);
            comm.Parameters.AddWithValue("@idkupu", IDkupil);
            comm.Parameters.AddWithValue("@id", IDi);
            comm.Parameters.AddWithValue("@ids", IDs);
            comm.ExecuteNonQuery();
            conn.Close();
            ret.vrednost = true;
            return(ret);
        }