Exemplo n.º 1
0
        public override string InitClass(DataSet DS, DataAccess Conn)
        {
            int fasefine     = CfgFn.GetNoNullInt32(DS.Tables["expense"].Rows[0]["nphase"]);
            int fasespesamax = CfgFn.GetNoNullInt32(Conn.GetSys("maxexpensephase"));

            ga = new GestioneAutomatismi(null, Conn, Disp, DS, fasefine, fasespesamax, "expense", false);
            bool res = ga.GeneraAutomatismiAfterPost(true);

            if (!res)
            {
                return("NoSave");
            }
            DataSet DSP = ga.DSP;

            MetaData metaSpesa = Disp.Get("expense");

            metaSpesa.ComputeRowsAs(DSP.Tables["expense"], "posting");

            MetaData metaEntrata = Disp.Get("income");

            metaEntrata.ComputeRowsAs(DSP.Tables["income"], "posting");

            MetaData metaVarSpesa = Disp.Get("expensevar");

            metaVarSpesa.ComputeRowsAs(DSP.Tables["expensevar"], "posting");

            return(base.InitClass(DSP, Conn));
        }
Exemplo n.º 2
0
        public override string InitClass(DataSet DS, DataAccess Conn)
        {
            if (DS.Tables["expense"].Rows.Count == 0)
            {
                return(base.InitClass(DS, Conn));
            }
            DataSet PreDSP = DS.Copy();

            dsSource = DS;

            foreach (DataTable T in DS.Tables)
            {
                RowChange.CopyAutoIncrementProperties(T, PreDSP.Tables[T.TableName]);
            }
            fasemissione      = CfgFn.GetNoNullInt32(Conn.GetSys("itinerationphase"));
            fasecedolino      = CfgFn.GetNoNullInt32(Conn.GetSys("itinerationphase"));
            faseoccasionale   = CfgFn.GetNoNullInt32(Conn.GetSys("itinerationphase"));
            faseprofessionale = CfgFn.GetNoNullInt32(Conn.GetSys("itinerationphase"));
            fasedipendente    = CfgFn.GetNoNullInt32(Conn.GetSys("itinerationphase"));
            faseordine        = CfgFn.GetNoNullInt32(Conn.GetSys("mandatephase"));
            faseiva           = CfgFn.GetNoNullInt32(Conn.GetSys("invoiceexpensephase"));

            PreDSP.EnforceConstraints = false;
            //Aggiunge la relazione padre/figlio per la tabella spesa
            PreDSP.Relations.Add("expenseexpense",
                                 PreDSP.Tables["expense"].Columns["idexp"],
                                 PreDSP.Tables["expense"].Columns["parentidexp"], false);
            SplitRowInPhases(PreDSP, Conn);
            DataSet DSP = aggiornaDSP(PreDSP, Conn);

            if (DSP == null)
            {
                return("NoSave");
            }

            MetaData metaSpesa = Disp.Get("expense");

            metaSpesa.ComputeRowsAs(DSP.Tables["expense"], "posting");

            MetaData metaEntrata = Disp.Get("income");

            metaEntrata.ComputeRowsAs(DSP.Tables["income"], "posting");

            MetaData metaVarSpesa = Disp.Get("expensevar");

            metaVarSpesa.ComputeRowsAs(DSP.Tables["expensevar"], "posting");

            DS.ExtendedProperties["DSPData"] = DSP;
            return(base.InitClass(DSP, Conn));
        }