Beispiel #1
0
        private void LoadGroups(int id)
        {
            ArrayList al = DBLayer.ProductGroup.GetList();

            for (int i = 0; i < al.Count; i++)
            {
                DBLayer.ProductGroup.Details det = (DBLayer.ProductGroup.Details)al[i];

                Lib.ServiceFunctions.ListItem li = new FitnessProject.Lib.ServiceFunctions.ListItem();

                li.ID   = det.Id;
                li.Name = det.Name;

                cbGroup.Items.Add(li);
            }

            if (cbGroup.Items.Count > 0)
            {
                for (int i = 0; i < cbGroup.Items.Count; i++)
                {
                    Lib.ServiceFunctions.ListItem li = (Lib.ServiceFunctions.ListItem)cbGroup.Items[i];

                    if (li.ID == id)
                    {
                        cbGroup.SelectedIndex = i;
                        break;
                    }
                }
            }
        }
        private void LoadCoaches(int id)
        {
            cbCoach.Items.Clear();

            ArrayList al = DBLayer.Coaches.GetList();

            for (int i = 0; i < al.Count; i++)
            {
                DBLayer.Coaches.Details det = (DBLayer.Coaches.Details)al[i];

                Lib.ServiceFunctions.ListItem li = new FitnessProject.Lib.ServiceFunctions.ListItem();

                li.ID   = det.Id;
                li.Name = det.Name;

                cbCoach.Items.Add(li);
            }

            for (int i = 0; i < cbCoach.Items.Count; i++)
            {
                Lib.ServiceFunctions.ListItem li = (Lib.ServiceFunctions.ListItem)cbCoach.Items[i];

                if (li.ID == id)
                {
                    cbCoach.SelectedIndex = i;
                    break;
                }
            }
        }
Beispiel #3
0
        public void LoadCoaches()
        {
            Lib.ServiceFunctions.ListItem li0 = new FitnessProject.Lib.ServiceFunctions.ListItem();

            li0.ID   = 0;
            li0.Name = "Не указан";

            cbCoaches.Items.Add(li0);

            ArrayList al = DBLayer.Coaches.GetList();

            for (int i = 0; i < al.Count; i++)
            {
                DBLayer.Coaches.Details det = (DBLayer.Coaches.Details)al[i];

                Lib.ServiceFunctions.ListItem li = new FitnessProject.Lib.ServiceFunctions.ListItem();

                li.ID   = det.Id;
                li.Name = det.Name;

                cbCoaches.Items.Add(li);
            }

            if (cbCoaches.Items.Count > 0)
            {
                cbCoaches.SelectedIndex = 0;
            }
        }
        private void LoadServices()
        {
            ArrayList al = DBLayer.Services.GetList();

            for (int i = 0; i < al.Count; i++)
            {
                DBLayer.Services.Services_WideDetails det = (DBLayer.Services.Services_WideDetails)al[i];

                Lib.ServiceFunctions.ListItem liP = new FitnessProject.Lib.ServiceFunctions.ListItem();

                liP.ID   = det.Id;
                liP.Name = det.Name;

                cbProduct.Items.Add(liP);
            }
        }
Beispiel #5
0
        private void LoadGroups()
        {
            ArrayList al = DBLayer.ProductGroup.GetList();

            cbProductGroup.Items.Clear();

            for (int i = 0; i < al.Count; i++)
            {
                DBLayer.ProductGroup.Details det = (DBLayer.ProductGroup.Details)al[i];

                Lib.ServiceFunctions.ListItem li = new FitnessProject.Lib.ServiceFunctions.ListItem();

                li.ID   = det.Id;
                li.Name = det.Name;

                cbProductGroup.Items.Add(li);
            }
        }
Beispiel #6
0
        private void LoadList()
        {
            DBLayer.Users.Details detU = (DBLayer.Users.Details)AppDomain.CurrentDomain.GetData("User");

            ArrayList al = DBLayer.Administrators.GetList();

            for (int i = 0; i < al.Count; i++)
            {
                DBLayer.Administrators.Details det = (DBLayer.Administrators.Details)al[i];

                Lib.ServiceFunctions.ListItem li = new FitnessProject.Lib.ServiceFunctions.ListItem();

                li.ID   = det.Id;
                li.Name = det.FIO;

                ddlAdministrators.Items.Add(li);
            }
        }
Beispiel #7
0
        private void LoadAbonements(int id)
        {
            cbAbonement.Items.Clear();

            ArrayList al = DBLayer.Abonements.GetList();

            for (int i = 0; i < al.Count; i++)
            {
                DBLayer.Abonements.WideDetails det = (DBLayer.Abonements.WideDetails)al[i];

                Lib.ServiceFunctions.ListItem li = new FitnessProject.Lib.ServiceFunctions.ListItem();

                li.ID   = det.Id;
                li.Name = det.Name;

                if (rbFitness.Checked)
                {
                    if (det.AbonementGroup == 0)
                    {
                        cbAbonement.Items.Add(li);
                    }
                }
                else
                {
                    if (det.AbonementGroup == 1)
                    {
                        cbAbonement.Items.Add(li);
                    }
                }
            }

            for (int i = 0; i < cbAbonement.Items.Count; i++)
            {
                Lib.ServiceFunctions.ListItem li = (Lib.ServiceFunctions.ListItem)cbAbonement.Items[i];

                if (li.ID == id)
                {
                    cbAbonement.SelectedIndex = i;
                    break;
                }
            }
        }
Beispiel #8
0
        private void LoadSuppliers(int id)
        {
            ArrayList al = DBLayer.Suppliers.GetList();

            cbSuppliers.Items.Clear();

            for (int i = 0; i < al.Count; i++)
            {
                DBLayer.Suppliers.Details det = (DBLayer.Suppliers.Details)al[i];

                Lib.ServiceFunctions.ListItem li = new FitnessProject.Lib.ServiceFunctions.ListItem();

                li.ID   = det.Id;
                li.Name = det.Name;

                cbSuppliers.Items.Add(li);
            }

            if (cbSuppliers.Items.Count > 0)
            {
                if (id == 0)
                {
                    cbSuppliers.SelectedIndex = 0;
                }
                else
                {
                    for (int i = 0; i < cbSuppliers.Items.Count; i++)
                    {
                        Lib.ServiceFunctions.ListItem li = (Lib.ServiceFunctions.ListItem)cbSuppliers.Items[i];

                        if (li.ID == id)
                        {
                            cbSuppliers.SelectedIndex = i;
                            break;
                        }
                    }
                }
            }
        }
Beispiel #9
0
        private void cbProductGroup_SelectedIndexChanged(object sender, EventArgs e)
        {
            Lib.ServiceFunctions.ListItem li = (Lib.ServiceFunctions.ListItem)cbProductGroup.SelectedItem;

            if (cbProduct.Items.Count > 0)
            {
                cbProduct.Items.Clear();
            }

            ArrayList al = DBLayer.Products.GetList(li.ID);

            for (int i = 0; i < al.Count; i++)
            {
                DBLayer.Products.Products_WideDetails det = (DBLayer.Products.Products_WideDetails)al[i];

                Lib.ServiceFunctions.ListItem liP = new FitnessProject.Lib.ServiceFunctions.ListItem();

                liP.ID   = det.Id;
                liP.Name = det.Name;

                cbProduct.Items.Add(liP);
            }
        }