Example #1
0
        private RevisedBudgetOtherCosts CreateInstanceWithSameFlag(YearMonth currentYearMonth)
        {
            //Get an instance of an object
            RevisedBudgetOtherCosts newOC = new RevisedBudgetOtherCosts(this.CurrentConnectionManager);

            //Create primary key
            newOC.IdProject         = this._IdProject;
            newOC.IdPhase           = this._IdPhase;
            newOC.IdWP              = this._IdWP;
            newOC.IdCostCenter      = this._IdCostCenter;
            newOC.IdAssociate       = this._IdAssociate;
            newOC.IdAssociateViewer = this._IdAssociateViewer;
            newOC.YearMonth         = currentYearMonth.Value;

            //Set state flag
            if (this.State == EntityState.New)
            {
                newOC.SetNew();
            }
            if (this.State == EntityState.Modified)
            {
                newOC.SetModified();
            }
            if (this.State == EntityState.Deleted)
            {
                newOC.SetDeleted();
            }

            //Return the object
            return(newOC);
        }