Exemple #1
0
 private void MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (SG.SelectID != 0)
     {
         SG.SelectWindowSearth(new Client_Window(SG.SelectID));
     }
 }
        private void MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (SG.SelectID != 0)
            {
                var clientID = T.Objecte.Rows.Get_UnShow <uint>(SG.SelectID, C.Objecte.Client);

                SG.SelectWindowSearth(new Client_Window(clientID));
            }
        }
        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);
        }