Example #1
0
        public void  重複添加(單點 other)

        {
            int number = 1;

            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                if (row.Cells[0].Value != null)
                {
                    if (row.Cells[0].Value.ToString() == other.GetName())
                    {
                        number = (int)row.Cells[2].Value + 1;
                        dataGridView1.Rows.Remove(row);
                    }
                }
            }

            dataGridView1.Rows.Add(other.GetName(), other.GetPrice(), number, number * other.GetPrice());

            B總價_Click(sender, e);
        }
Example #2
0
 public override string GetName()
 {
     return(單點.GetName() + "加大");
 }