Example #1
0
        private void listStatus_DoubleClick(object sender, EventArgs e)
        {
            int            indexShow = int.Parse(listStatus.SelectedItems[0].SubItems[0].Text) - 1;
            frmSellService frm       = listfrm[indexShow];

            frm.firstTime = false;
            try
            {
                listfrm[indexShow].ShowDialog();
            }
            catch (Exception) { }

            if (frm.complete)
            {
                try
                {
                    if (frm.ok)
                    {
                        listStatus.Items.RemoveAt(indexShow);
                        listfrm.RemoveAt(indexShow);
                    }
                }
                catch (Exception) { }
            }
            else
            {
                try
                {
                    listStatus.SelectedItems[0].SubItems[1].Text = frm.txttotal.Text;
                }
                catch (Exception) { }
            }
        }
Example #2
0
        public void btncheck_Click(object sender, EventArgs e)
        {
            index++;
            frmSellService frm = new frmSellService();

            frm.GuestCode = "G" + index;
            frm.firstTime = true;
            frm.ShowDialog();

            if (frm.ok)
            {
                if (!frm.complete)
                {
                    listfrm.Add(frm);
                    string[] items = { index + "", frm.txttotal.Text, "Waiting" };
                    listStatus.Items.Add(new ListViewItem(items));
                }
                else
                {
                    listfrm.Add(frm);
                }
            }
        }