public bool Save() { con.Command.CommandText = "addProduct"; con.Command.CommandType = CommandType.StoredProcedure; con.Command.Parameters.Add("@ProductDescription", SqlDbType.VarChar, 300).Value = Description; con.Command.Parameters.Add("@Cost", SqlDbType.Decimal).Value = Cost; con.Command.Parameters.Add("@Price", SqlDbType.Decimal).Value = Price; return(con.ExecCommand()); }
public bool Save(Product p, int quantity) { con.Command.CommandText = "addLosse"; con.Command.CommandType = CommandType.StoredProcedure; con.Command.Parameters.Add("@idProduct", SqlDbType.Int).Value = p.Id; con.Command.Parameters.Add("@Cost", SqlDbType.Decimal).Value = p.Cost; con.Command.Parameters.Add("@LostUnits", SqlDbType.Int).Value = quantity; con.Command.Parameters.Add("@Total_Lost", SqlDbType.Decimal).Value = p.Cost * quantity; con.Command.Parameters.Add("@comment", SqlDbType.VarChar).Value = Comment; return(con.ExecCommand()); }