Exemplo n.º 1
0
        private void orderdata_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            PackageSeq txt = new PackageSeq();

            if (e.ColumnIndex == 0)
            {
                if (orderdata.RowCount > 0)
                {
                    bool obj = (bool)this.orderdata.CurrentRow.Cells[0].EditedFormattedValue;
                    txt.synseqNO  = Convert.ToInt32(this.orderdata.CurrentRow.Cells[1].Value.ToString());
                    txt.packageNO = Convert.ToInt32(this.orderdata.CurrentRow.Cells[2].Value.ToString());
                    if (list.Count == 0)
                    {
                        list.Add(txt);
                    }
                    else
                    {
                        for (int i = 0; i <= list.Count; i++)
                        {
                            if (i == list.Count)
                            {
                                list.Add(txt);
                                break;
                            }
                            if (list[i].packageNO == txt.packageNO && list[i].synseqNO == txt.synseqNO)
                            {
                                //list.Remove(txt);
                                list.RemoveAt(i);
                                break;
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void button_all_Click(object sender, EventArgs e)
        {
            list.Clear();
            for (int i = 0; i < this.orderdata.RowCount; i++)
            {
                PackageSeq txt = new PackageSeq();
                orderdata.Rows[i].Cells[0].Value = "true";

                txt.synseqNO  = Convert.ToInt32(orderdata.Rows[i].Cells[1].Value.ToString());
                txt.packageNO = Convert.ToInt32(orderdata.Rows[i].Cells[2].Value.ToString());
                list.Add(txt);
            }
        }