Esempio n. 1
0
        public static Form GetEdit(DataBase.ISTable SubTable, int Width, bool Virtual)
        {
            var UEF = new Edit_Form(SubTable, Width, Virtual);

            var Enabled = T.User.Rows.Get_UnShow <uint>(data.UserID, C.User.UType) == (uint)data.UType.Admin;

            UEF.AddControl(new Edit_Form.Inputs_class(UEF, C.User.Login));
            UEF.AddControl(new Edit_Form.Inputs_class(UEF, C.User.Pass, true, null, true));
            UEF.AddControl(new Edit_Form.RelationCombo_class(UEF, C.User.UType, Enabled));
            UEF.AddControl(new Edit_Form.Inputs_class(UEF, C.User.Mail));
            UEF.AddControl(new Edit_Form.Inputs_class(UEF, C.User.Job));
            UEF.AddControl(new Edit_Form.Inputs_class(UEF, C.User.SureName));
            UEF.AddControl(new Edit_Form.Inputs_class(UEF, C.User.Name));
            UEF.AddControl(new Edit_Form.Inputs_class(UEF, C.User.Patronymic));

            if (Enabled)
            {
                UEF.AddControl(new Edit_Form.Inputs_class(UEF, C.User.PCName));
                UEF.AddControl(new Edit_Form.Inputs_class(UEF, C.User.PCUser));
            }

            UEF.AddControl(C.User.CPeriod);

            UEF.AddControl(new Edit_Form.Inputs_class(UEF, C.User.IsHere, Enabled));
            UEF.AddControl(new Edit_Form.Inputs_class(UEF, C.User.Enabled, Enabled));

            return(UEF);
        }
Esempio n. 2
0
        private void EditorSample()
        {
            EditNegotiationAssistant.SetRowFromGrid(MyTools.GL_Auto);
            Sample sample = Helpers.LogicHelper.SampleLogic.FirstModel(negotiationAssistant.SampleID);

            EditNegotiationAssistant.SetFromGrid(sample.GetEditor(new MyTools.C_SettingFromRowEdit(MyTools.EPosition.Vertical, Scope: true, Color: Brushes.LightSeaGreen),
                                                                  new MyTools.C_DefColumn(C.Sample.Representative, WH, font: font,
                                                                                          Click: (sender, e) =>
            {
                G.Representative.QUERRY().SHOW.WHERE.C(C.Representative.Client, negotiationAssistant.GetIDValue(C.NegotiationAssistant.Objecte, C.Objecte.Client)).DO();
                List <C_ColumnFromSearch> column = new List <C_ColumnFromSearch>();
                column.Add(new C_ColumnFromSearch(C.Representative.FIO));
                column.Add(new C_ColumnFromSearch(C.Representative.Post));
                SearchGrid_Window search = new SearchGrid_Window(G.Representative, null, column, new C_SettingSearchDataGrid(DefDeleg: true));
                MenuItem miAdd           = new MenuItem();
                miAdd.Header             = "Добавить представителя";
                miAdd.Click += (sender1, e1) =>
                {
                    var clientID = negotiationAssistant.Objecte.ClientID;

                    G.Client.QUERRY().SHOW.WHERE.ID(clientID).DO();

                    var addForm = new Edit_Form(G.Representative, 500, false);
                    addForm.LoadData();
                    addForm.controls[C.Representative.Client].Default     = clientID;
                    addForm.controls[C.Representative.Client].obj.Enabled = false;
                    addForm.ShowDialog();

                    search.SelectID = addForm.ID;
                    search.Close();
                };
                search.ThisMenu.Items.Add(miAdd);
                search.ShowDialog();

                if (search.SelectID > 0)
                {
                    sample.SetValue(C.Sample.Representative, search.SelectID);
                }
            })));
            G.SelectionWell.QUERRY().SHOW.WHERE.C(C.SelectionWell.Sample, negotiationAssistant.SampleID).DO();
            uint[] SelectionWells = new uint[G.SelectionWell.Rows.Count];
            for (int i = 0; i < SelectionWells.Length; i++)
            {
                SelectionWells[i] = G.SelectionWell.Rows.GetID(i);
            }
            foreach (var one in SelectionWells.Select(x => Helpers.LogicHelper.SelectionWellLogic.FirstModel(x)))
            {
                EditNegotiationAssistant.SetRowFromGrid(MyTools.GL_Auto);
                EditNegotiationAssistant.SetFromGrid(one.GetEditor(new MyTools.C_SettingFromRowEdit(MyTools.EPosition.Vertical, Scope: true, Color: Brushes.LightSkyBlue),
                                                                   new MyTools.C_DefColumn(C.SelectionWell.Well, WH, false, font: font),
                                                                   new MyTools.C_DefColumn(C.SelectionWell.Number, WH, data.User <bool>(C.User.CanRedact), font: font),
                                                                   new MyTools.C_DefColumn(C.SelectionWell.DateTime, WH, font: font)));
            }
        }