public Protocols.ToolkitResultProtocol ApplyEco(Protocols.DepotRepair.ApplyEcoSetupProtocol setupParam)
        {
            ClarifySession session = Global.GetSession(AuthHeader);

            FChoice.Toolkits.Clarify.DepotRepair.DepotRepairToolkit toolkit = new FChoice.Toolkits.Clarify.DepotRepair.DepotRepairToolkit(session);
            FChoice.Toolkits.Clarify.DepotRepair.ApplyEcoSetup      setup;

            switch (setupParam.ConstructorCue)
            {
            case 0:
                setup = new FChoice.Toolkits.Clarify.DepotRepair.ApplyEcoSetup(setupParam.DemandDetailObjid, setupParam.EcoHeaderIDNum);
                break;

            default:
                throw new InvalidOperationException(string.Format("Constructor index '{0}' does not exist.", setupParam.ConstructorCue));
            }

            if (Global.IsPropertyDirty(1, setupParam.DirtyFieldFlags))
            {
                setup.DemandDetailObjid = setupParam.DemandDetailObjid;
            }

            if (Global.IsPropertyDirty(2, setupParam.DirtyFieldFlags))
            {
                setup.EcoHeaderIDNum = setupParam.EcoHeaderIDNum;
            }

            if (Global.IsPropertyDirty(4, setupParam.DirtyFieldFlags))
            {
                setup.UserName = setupParam.UserName;
            }

            if (Global.IsPropertyDirty(8, setupParam.DirtyFieldFlags))
            {
                setup.CreateDate = setupParam.CreateDate;
            }


            return(new Protocols.ToolkitResultProtocol(toolkit.ApplyEco(setup)));
        }
        public Protocols.ToolkitResultProtocol ApplyEco(Protocols.DepotRepair.ApplyEcoSetupProtocol setupParam)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.DepotRepair.DepotRepairToolkit toolkit = new FChoice.Toolkits.Clarify.DepotRepair.DepotRepairToolkit( session );
            FChoice.Toolkits.Clarify.DepotRepair.ApplyEcoSetup setup;

            switch( setupParam.ConstructorCue )
            {
                case 0:
                    setup = new FChoice.Toolkits.Clarify.DepotRepair.ApplyEcoSetup(setupParam.DemandDetailObjid, setupParam.EcoHeaderIDNum);
                    break;
                default:
                    throw new InvalidOperationException(string.Format("Constructor index '{0}' does not exist.", setupParam.ConstructorCue));
            }

            if( Global.IsPropertyDirty(1, setupParam.DirtyFieldFlags) )
            {
                setup.DemandDetailObjid = setupParam.DemandDetailObjid;
            }

            if( Global.IsPropertyDirty(2, setupParam.DirtyFieldFlags) )
            {
                setup.EcoHeaderIDNum = setupParam.EcoHeaderIDNum;
            }

            if( Global.IsPropertyDirty(4, setupParam.DirtyFieldFlags) )
            {
                setup.UserName = setupParam.UserName;
            }

            if( Global.IsPropertyDirty(8, setupParam.DirtyFieldFlags) )
            {
                setup.CreateDate = setupParam.CreateDate;
            }

            return new Protocols.ToolkitResultProtocol( toolkit.ApplyEco(setup) );
        }