예제 #1
0
        private void ClientsObjects_Click(object sender, RoutedEventArgs e)
        {
            var objs = Helpers.LogicHelper.ObjecteLogic.Find(DateControl_Class.SelectMonth).ToArray();

            foreach (var objecte in objs)
            {
                objecte.InitializeColumns();
            }

            SG = new SearchGrid_Window(objs
                                       , new C_SettingSearchDataGrid(ThisDelegate: MouseDoubleClick
                                                                     , ColorConditions: new ColorCondition(column.DateClose
                                                                                                           , (text) => text.TryParseInt() > 0 && text.TryParseInt() <= DateControl_Class.SelectMonth
                                                                                                           , Brushes.Red)
                                                                     , DopText: $"Последний номер папки: {G.Objecte.QUERRY().GET.C(C.Objecte.NumberFolder).Max(C.Objecte.NumberFolder).By(C.Objecte.NumberFolder).DO()[0].Value}"));

            {
                var MiAdd = new MenuItem();
                MiAdd.Header = "Добавить";
                MiAdd.Click += (senderAdd, eAdd) =>
                {
                    G.Client.QUERRY().SHOW.WHERE.AC(C.Client.INN).EQUI.BV("000").DO();
                    uint clientID;

                    if (G.Client.Rows.Count == 0)
                    {
                        clientID = MyTools.AddRowFromTable(G.Client, new KeyValuePair <int, object>(C.Client.INN, "000"), new KeyValuePair <int, object>(C.Client.YMFrom, DateControl_Class.SelectMonth - 1));
                    }
                    else
                    {
                        clientID = G.Client.Rows.GetID(0);
                    }

                    SG.SelectWindowSearth(new Client_Window(clientID));

                    SG.ReSet(Helpers.LogicHelper.ClientsLogic.Find(DateControl_Class.SelectMonth).ToArray());
                };
                SG.ThisMenu.Items.Add(MiAdd);
            }

            {
                var btShowAll = new Button {
                    Content = "Показать все"
                };
                btShowAll.Click += (senderS, eS) =>
                {
                    SG.ReSet(Helpers.LogicHelper.ClientsLogic.Find(DateControl_Class.SelectMonth).ToArray());
                    btShowAll.IsEnabled = false;
                };
                SG.ThisMenu.Items.Add(btShowAll);
            }

            this.SelectWindowSearth(SG);
        }
예제 #2
0
        private void ClientsObjects_Click(object sender, RoutedEventArgs e)
        {
            var objs = AllClients.GetClients(AllClients.GetObjects(false).ToList(), false);

            SG = new SearchGrid_Window(objs, new C_SettingSearchDataGrid
                                           (ThisDelegate: MouseDoubleClick,
                                           ColorConditions: new ColorCondition
                                               (column.DateClose,
                                               ((text) => { return(text.TryParseInt() > 0 && text.TryParseInt() <= DateControl_Class.SelectMonth); }),
                                               Brushes.Red)
                                           , DopText: $"Последний номер папки: {objs.Max(x=>x.NumberFolder)}"));
            MenuItem MiAdd = new MenuItem();

            MiAdd.Header = "Добавить";
            MiAdd.Click += (senderAdd, eAdd) =>
            {
                try
                { SG.SelectID = MyTools.AddRowFromTable(G.Client, new KeyValuePair <int, object>(C.Client.INN, "000"), new KeyValuePair <int, object>(C.Client.YMFrom, DateControl_Class.SelectMonth - 1)); }
                catch
                {
                    MessageBox.Show("В базе существует пустой клиент с ИНН \"000\"");
                    return;
                }
                MouseDoubleClick(null, null);
                SG.ReSet(AllClients.GetClients(AllClients.GetObjects(true).ToList(), true));
            };
            SG.ThisMenu.Items.Add(MiAdd);
            Button btShowAll = new Button {
                Content = "Показать все"
            };

            btShowAll.Click += (senderS, eS) =>
            {
                SG.ReSet(AllClients.GetClients(AllClients.GetObjects(true).ToList(), true));
                btShowAll.IsEnabled = false;
            };
            SG.ThisMenu.Items.Add(btShowAll);
            this.SelectWindowSearth(SG);
        }