コード例 #1
0
ファイル: Form2.cs プロジェクト: sherefashraf/datastruc
        private void AddRiceBtn(object sender, EventArgs e)
        {
            //add rice//

            r.minize();
            if (r.Count() < 0)
            {
                MessageBox.Show("out of stock");
            }

            t += r.price();
            l.add(r.name(), r.price());
            //to show num of product after get the total cost of order//
            numofrice.Text = Convert.ToString(r.Count()) + "in stock";
        }
コード例 #2
0
 private void AddRiceBtn(object sender, EventArgs e)
 {
     //add rice//
     if (r.Count() == 0)
     {
         numofrice.Text = Convert.ToString(r.Count()) + "in stock";
         MessageBox.Show("out of stock");
     }
     else if (r.Count() > 0)
     {
         r.minize();
         t += r.price();
         l.add(r.name(), r.price());//add product in linked list//
         //to show num of product after press Add//
         numofrice.Text = Convert.ToString(r.Count()) + "in stock";
     }
 }