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

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

            switch (setupParam.ConstructorCue)
            {
            case 0:
                setup = new FChoice.Toolkits.Clarify.DepotRepair.CreateEcoHeaderSetup(setupParam.StartDate, setupParam.EndDate);
                break;

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

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

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

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

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

            if (Global.IsPropertyDirty(16, setupParam.DirtyFieldFlags))
            {
                setup.StartDate = setupParam.StartDate;
            }

            if (Global.IsPropertyDirty(32, setupParam.DirtyFieldFlags))
            {
                setup.EndDate = setupParam.EndDate;
            }

            if (Global.IsPropertyDirty(64, setupParam.DirtyFieldFlags))
            {
                setup.Status = setupParam.Status;
            }

            if (Global.IsPropertyDirty(128, setupParam.DirtyFieldFlags))
            {
                setup.Description = setupParam.Description;
            }


            return(new Protocols.ToolkitResultProtocol(toolkit.CreateEcoHeader(setup)));
        }
        public Protocols.ToolkitResultProtocol CreateEcoHeader(System.DateTime startDate, System.DateTime endDate)
        {
            ClarifySession session = Global.GetSession(AuthHeader);

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

            return(new Protocols.ToolkitResultProtocol(toolkit.CreateEcoHeader(startDate, endDate)));
        }
        public Protocols.ToolkitResultProtocol CreateEcoHeader(Protocols.DepotRepair.CreateEcoHeaderSetupProtocol setupParam)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.DepotRepair.DepotRepairToolkit toolkit = new FChoice.Toolkits.Clarify.DepotRepair.DepotRepairToolkit( session );
            FChoice.Toolkits.Clarify.DepotRepair.CreateEcoHeaderSetup setup;

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

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

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

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

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

            if( Global.IsPropertyDirty(16, setupParam.DirtyFieldFlags) )
            {
                setup.StartDate = setupParam.StartDate;
            }

            if( Global.IsPropertyDirty(32, setupParam.DirtyFieldFlags) )
            {
                setup.EndDate = setupParam.EndDate;
            }

            if( Global.IsPropertyDirty(64, setupParam.DirtyFieldFlags) )
            {
                setup.Status = setupParam.Status;
            }

            if( Global.IsPropertyDirty(128, setupParam.DirtyFieldFlags) )
            {
                setup.Description = setupParam.Description;
            }

            return new Protocols.ToolkitResultProtocol( toolkit.CreateEcoHeader(setup) );
        }
        public Protocols.ToolkitResultProtocol CreateEcoHeader(System.DateTime startDate, System.DateTime endDate)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.DepotRepair.DepotRepairToolkit toolkit = new FChoice.Toolkits.Clarify.DepotRepair.DepotRepairToolkit( session );

            return new Protocols.ToolkitResultProtocol( toolkit.CreateEcoHeader(startDate, endDate) );
        }