Пример #1
0
        public void LoadFromEntry()
        {
            var lTeenList = GetTeenListForUpdate(txtFirstName.Text, txtLastName.Text);

            if (lTeenList == null)
            {
                isNew   = true;
                isClear = false;
            }
            else if (lTeenList.Count <= 1)
            {
                isNew   = true;
                isClear = false;
            }
            else
            {
                frmTeenList dlg = new frmTeenList();
                dlg.lArray = lTeenList;
                dlg.ShowDialog();
                if (dlg.DialogResult != DialogResult.OK)
                {
                    txtFirstName.Text = "";
                    txtLastName.Text  = "";
                    return;
                }

                isClear = false;
                if (dlg.lbTeenList.SelectedIndex <= 0)
                {
                    isNew   = true;
                    isClear = false;
                }

                ListItem li = (ListItem)dlg.lbTeenList.Items[dlg.lbTeenList.SelectedIndex];

                if (li.idx < 0)
                {
                    isNew   = true;
                    isClear = false;
                }
                else
                {
                    if (LoadRecord(li.idx) == false)
                    {
                        ClearForm();
                        return;
                    }
                    isNew   = false;
                    isClear = false;
                }
            }
        }
Пример #2
0
        public void LoadFromEntry()
        {
            var lTeenList = GetTeenListForUpdate(txtFirstName.Text, txtLastName.Text);

            if (lTeenList == null)
            {
                isNew = true;
                isClear = false;
            }
            else if (lTeenList.Count <= 1)
            {
                isNew = true;
                isClear = false;
            }
            else
            {
                frmTeenList dlg = new frmTeenList();
                dlg.lArray = lTeenList;
                dlg.ShowDialog();
                if (dlg.DialogResult != DialogResult.OK)
                {
                    txtFirstName.Text = "";
                    txtLastName.Text = "";
                    return;
                }

                isClear = false;
                if (dlg.lbTeenList.SelectedIndex <= 0)
                {
                    isNew = true;
                    isClear = false;
                }

                ListItem li = (ListItem)dlg.lbTeenList.Items[dlg.lbTeenList.SelectedIndex];

                if (li.idx < 0)
                {
                    isNew = true;
                    isClear = false;
                }
                else
                {
                    if (LoadRecord(li.idx) == false)
                    {
                        ClearForm();
                        return;
                    }
                    isNew = false;
                    isClear = false;

                }
            }
        }