コード例 #1
0
        private void UpdateListViewProducts()
        {
            listViewProducts.Items.Clear();
            for (int i = 0; i < listProduct.Count; i++)
            {
                if (cBoxUserOptions.Checked)
                {
                    FPersonalAreaUser u = new FPersonalAreaUser();
                    u.SetClient(client);
                    int size = u.CalculateTheSize();

                    if (listProduct[i].size == size)
                    {
                        listViewProducts.Items.Add(new ListViewItem(listProduct[i].title.ToString() + "\n" +
                                                                    listProduct[i].price.ToString(), i));
                    }
                }
                else if (cListBoxCategories
                         .GetItemChecked(cListBoxCategories.Items.IndexOf(listProduct[i].category)) &&
                         cListBoxColors
                         .GetItemChecked(cListBoxColors.Items.IndexOf(listProduct[i].color)) &&
                         cListBoxSize
                         .GetItemChecked(cListBoxSize.Items.IndexOf(listProduct[i].size.ToString())))
                {
                    listViewProducts.Items.Add(new ListViewItem(listProduct[i].title.ToString() + "\n" +
                                                                listProduct[i].price.ToString(), i));
                }
            }
        }
コード例 #2
0
 private void lblClientLogin_LinkClicked(object sender, EventArgs e)
 {
     try
     {
         List <CLIENT> client = clientControl.SearchClientByLogin(lblClientLogin.Text);
         if (client == null)
         {
             MessageBox.Show("Ошибка", "Такого клиента не существует", MessageBoxButtons.OK, MessageBoxIcon.Error);
             Close();
         }
         if (client[0].access_level == 1)
         {
             FPersonalAreaAdmin f = new FPersonalAreaAdmin();
             f.ShowDialog();
         }
         else
         {
             FPersonalAreaUser f = new FPersonalAreaUser();
             f.SetClient(client[0]);
             f.ClearSelectedProducts();
             f.SetSelectedProducts(listSelectedProduct);
             f.ShowDialog();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }