Beispiel #1
0
        private void chiamaFormClass(string filtro, Class_SelectionManager CSM)
        {
            MetaSorting.FilterLocked         = true;
            MetaSorting.SearchEnabled        = false;
            MetaSorting.MainSelectionEnabled = true;
            MetaSorting.StartFilter          = filtro;
            MetaSorting.ExtraParameter       = filtro;
            //if ((currfilter_upb == null) || (currfilter_upb == "")) return;
            string edittype = "tree";

            bool res = MetaSorting.Edit(this, edittype, true);

            if (!res)
            {
                return;
            }
            DataRow Selected = MetaSorting.LastSelectedRow;

            CSM.SelectRow(Selected);
        }
Beispiel #2
0
        private void btnCodice_Click(Class_SelectionManager CSM)
        {
            string filterAll = QHS.CmpEq("idsorkind", CSM.idsorkind);

            chiamaFormClass(filterAll, CSM);
        }
Beispiel #3
0
        public FrmSelectDetailsFromStock(MetaData Meta, string filtersql, DataSet DS)
        {
            InitializeComponent();
            this.Meta      = Meta;
            this.Conn      = Meta.Conn;
            this.Disp      = Meta.Dispatcher;
            this.filtersql = filtersql;
            this.DS        = DS;

            QHC = new CQueryHelper();
            QHS = Meta.Conn.GetQueryHelper();

            // Magazzino
            DataTable store = Conn.CreateTableByName("store", "*", false);

            D = new DataSet();
            D.Tables.Add(store);
            Conn.RUN_SELECT_INTO_TABLE(store, "description", filtersql, null, true);
            cmbMagazzino.DataSource    = store;
            cmbMagazzino.ValueMember   = "idstore";
            cmbMagazzino.DisplayMember = "description";
            HelpForm.SetComboBoxValue(cmbMagazzino, store.Rows[0]["idstore"]);
            cmbMagazzino.Enabled = false;

            // Responsabile
            DataTable manager = Conn.CreateTableByName("manager", "*", false);

            D.Tables.Add(manager);
            GetData.MarkToAddBlankRow(manager);
            GetData.Add_Blank_Row(manager);
            Conn.RUN_SELECT_INTO_TABLE(manager, "title", null, null, true);
            cmbResponsabile.DataSource    = manager;
            cmbResponsabile.ValueMember   = "idman";
            cmbResponsabile.DisplayMember = "title";

            Conn.DeleteAllUnselectable(manager);

            MetaSorting = Disp.Get("sorting");

            FormInit();
            DD                 = new DataSet("a");
            Sorting1           = Conn.CreateTableByName("sorting", "*");
            Sorting1.TableName = "sorting1";
            Sorting2           = Conn.CreateTableByName("sorting", "*");
            Sorting2.TableName = "sorting2";
            Sorting3           = Conn.CreateTableByName("sorting", "*");
            Sorting3.TableName = "sorting3";
            DD.Tables.Add(Sorting1);
            DD.Tables.Add(Sorting2);
            DD.Tables.Add(Sorting3);
            DD.EnforceConstraints = false;

            DataAccess.SetTableForReading(Sorting1, "sorting");
            DataAccess.SetTableForReading(Sorting2, "sorting");
            DataAccess.SetTableForReading(Sorting3, "sorting");

            string    filter    = "(ayear=" + QueryCreator.quotedstrvalue(Meta.GetSys("esercizio"), true) + ")";
            DataTable tExpSetup = Meta.Conn.RUN_SELECT("config", "*", null,
                                                       filter, null, null, true);

            if ((tExpSetup != null) && (tExpSetup.Rows.Count > 0))
            {
                DataRow R          = tExpSetup.Rows[0];
                string  idsorkind1 = R["idsortingkind1"].ToString();
                string  idsorkind2 = R["idsortingkind2"].ToString();
                string  idsorkind3 = R["idsortingkind3"].ToString();
                SetGBoxClass(1, idsorkind1);
                SetGBoxClass(2, idsorkind2);
                SetGBoxClass(3, idsorkind3);

                if (idsorkind3 == "")
                {
                    grpAnalitico.Size = new System.Drawing.Size(366, 200);
                }
                if (idsorkind2 + idsorkind3 == "")
                {
                    grpAnalitico.Size = new System.Drawing.Size(366, 100);
                }
                if (idsorkind1 + idsorkind2 + idsorkind3 == "")
                {
                    grpAnalitico.Visible = false;
                }
                if (idsorkind1 != "")
                {
                    CSM1 = new Class_SelectionManager(Meta, txtCodice1, txtDenom1, R["idsortingkind1"]);
                }
                if (idsorkind2 != "")
                {
                    CSM2 = new Class_SelectionManager(Meta, txtCodice2, txtDenom2, R["idsortingkind2"]);
                }
                if (idsorkind3 != "")
                {
                    CSM3 = new Class_SelectionManager(Meta, txtCodice3, txtDenom3, R["idsortingkind3"]);
                }
            }
        }