예제 #1
0
        private void Initialize()
        {
            cheCheckSet      = new ChemicalMainDataSet(AppRes.DB.Connect, null, null);
            cheMainSet       = new ChemicalMainDataSet(AppRes.DB.Connect, null, null);
            cheJoinSet       = new ChemicalItemJoinDataSet(AppRes.DB.Connect, null, null);
            cheImageSet      = new ChemicalImageDataSet(AppRes.DB.Connect, null, null);
            cheP2Set         = new ChemicalP2DataSet(AppRes.DB.Connect, null, null);
            cheP2ExtendSet   = new ChemicalP2ExtendDataSet(AppRes.DB.Connect, null, null);
            cheReportSet     = new ChemicalReportDataSet(AppRes.DB.Connect, null, null);
            profJobSet       = new ProfJobDataSet(AppRes.DB.Connect, null, null);
            profJobSchemeSet = new ProfJobSchemeDataSet(AppRes.DB.Connect, null, null);

            ctrlUs             = new CtrlEditChemicalUs();
            ctrlUs.MainSet     = cheMainSet;
            ctrlUs.P2Set       = cheP2Set;
            ctrlUs.P2ExtendSet = cheP2ExtendSet;
            ctrlUs.ImageSet    = cheImageSet;

            ctrlEu          = new CtrlEditChemicalEu();
            ctrlEu.MainSet  = cheMainSet;
            ctrlEu.P2Set    = cheP2Set;
            ctrlEu.ImageSet = cheImageSet;

            cheQuery                  = new ChemicalQuery();
            cheQuery.MainSet          = cheMainSet;
            cheQuery.ImageSet         = cheImageSet;
            cheQuery.JoinSet          = cheJoinSet;
            cheQuery.P2Set            = cheP2Set;
            cheQuery.P2ExtendSet      = cheP2ExtendSet;
            cheQuery.ProfJobSet       = profJobSet;
            cheQuery.ProfJobSchemeSet = profJobSchemeSet;
            cheQuery.CtrlUs           = ctrlUs;
            cheQuery.CtrlEu           = ctrlEu;

            bookmark = new GridBookmark(chemicalGridView);
            AppHelper.SetGridEvenRow(chemicalGridView);

            chemicalAreaColumn.DisplayFormat.FormatType = FormatType.Custom;
            chemicalAreaColumn.DisplayFormat.Format     = new ReportAreaFormat();

            chemicalRegTimeColumn.DisplayFormat.FormatType = FormatType.Custom;
            chemicalRegTimeColumn.DisplayFormat.Format     = new ReportDateTimeFormat();

            approvalCombo.DataSource    = EnumHelper.GetNameValues <EReportApproval>();
            approvalCombo.DisplayMember = "Name";
            approvalCombo.ValueMember   = "Value";

            areaCombo.DataSource    = EnumHelper.GetNameValues <EReportArea>();
            areaCombo.DisplayMember = "Name";
            areaCombo.ValueMember   = "Value";

            SetControl(null);
        }
        public ChemicalQuery(bool local = false)
        {
            this.local = local;

            if (local == true)
            {
                MainSet          = new ChemicalMainDataSet(AppRes.DB.Connect, null, null);
                ImageSet         = new ChemicalImageDataSet(AppRes.DB.Connect, null, null);
                JoinSet          = new ChemicalItemJoinDataSet(AppRes.DB.Connect, null, null);
                P2Set            = new ChemicalP2DataSet(AppRes.DB.Connect, null, null);
                P2ExtendSet      = new ChemicalP2ExtendDataSet(AppRes.DB.Connect, null, null);
                ProfJobSet       = new ProfJobDataSet(AppRes.DB.Connect, null, null);
                ProfJobSchemeSet = new ProfJobSchemeDataSet(AppRes.DB.Connect, null, null);
                CtrlUs           = null;
                CtrlEu           = null;
            }

            productSet = new ProductDataSet(AppRes.DB.Connect, null, null);
            partSet    = new PartDataSet(AppRes.DB.Connect, null, null);
            staffSet   = new StaffDataSet(AppRes.DB.Connect, null, null);
        }