예제 #1
0
        public void Load(int id)
        {
            DataTable table         = new DataTable();
            string    selectcommand = $"SELECT * FROM Products where id_product = {id}";

            table = con.GetData(selectcommand);

            Id          = int.Parse(table.Rows[0]["id_product"].ToString());
            Description = table.Rows[0]["Product_Description"].ToString();
            Cost        = decimal.Parse(table.Rows[0]["Cost"].ToString());
            Price       = decimal.Parse(table.Rows[0]["Price"].ToString());
            Quantity    = Int32.Parse(table.Rows[0]["Stock_Quantity"].ToString());
        }
예제 #2
0
        public List <Loss> GetLossesFromAProductList(int prodid)
        {
            string selectcommand = $"SELECT * FROM Losses where ID_Product = {prodid}";

            return(GetListFromTable(con.GetData(selectcommand)));
        }