コード例 #1
0
        private void btnChooseGroup_Click(object sender, EventArgs e)
        {
            string      idGroup = btnChooseGroup.Tag.ToString();
            GroupPicker gp      = new GroupPicker(idGroup);

            if (gp.ShowDialog() == DialogResult.OK)
            {
                btnChooseGroup.Tag = gp.idGroup;
                if (gp.idGroup != String.Empty)
                {
                    btnChooseGroup.Text = Main.groups.Find(x => x.id == btnChooseGroup.Tag).name;
                }
                else
                {
                    btnChooseGroup.Text = "БЕЗ ГРУППЫ";
                }
            }
        }
コード例 #2
0
        private void btnSearchGroup_Click(object sender, EventArgs e)
        {
            string      idGroup = btnSearchGroup.Tag.ToString();
            GroupPicker gp      = new GroupPicker(idGroup);

            if (gp.ShowDialog() == DialogResult.OK)
            {
                if (gp.idGroup != String.Empty)
                {
                    btnSearchGroup.Text = groups.Where(x => (x.id == gp.idGroup)).First().name;
                    btnSearchGroup.Tag  = gp.idGroup;
                    groupSort           = gp.childGroups;
                }
                else
                {
                    btnSearchGroup.Text = "ВСЕ ТОВАРЫ";
                    btnSearchGroup.Tag  = String.Empty;
                    groupSort           = null;
                }
                UpdateSearch(tbSearch.Text);
            }
        }