示例#1
0
        public AsotentryAddOTAddonFieldLeaveResponseAPI AddOTAddonFieldLeave(AsotentryAddOTAddonFieldLeaveRequestAPI AsotentryAddOTAddonFieldLeaveRequestAPI)
        {
            var result = new AsotentryAddOTAddonFieldLeaveResponseAPI();

            var pdsaddotaddon = new pdsaddotaddonDataSet();

            var pdsotaddons = new pdsotaddonsDataSet();

            string cErrorMessage   = string.Empty;
            string cWarningMessage = string.Empty;

            DataRow ttbladdotaddoncriteriaRow = pdsaddotaddon.ttbladdotaddoncriteria.NewttbladdotaddoncriteriaRow();

            Addotaddoncriteria.UpdateRowFromAddotaddoncriteria(ref ttbladdotaddoncriteriaRow, AsotentryAddOTAddonFieldLeaveRequestAPI.addotaddoncriteria);
            pdsaddotaddon.ttbladdotaddoncriteria.AddttbladdotaddoncriteriaRow((pdsaddotaddonDataSet.ttbladdotaddoncriteriaRow)ttbladdotaddoncriteriaRow);

            foreach (var obj in AsotentryAddOTAddonFieldLeaveRequestAPI.otaddons)
            {
                DataRow ttblotaddonsRow = pdsotaddons.ttblotaddons.NewttblotaddonsRow();
                Otaddons.UpdateRowFromOtaddons(ref ttblotaddonsRow, obj);
                pdsotaddons.ttblotaddons.AddttblotaddonsRow((pdsotaddonsDataSet.ttblotaddonsRow)ttblotaddonsRow);
            }

            var pvFieldname = AsotentryAddOTAddonFieldLeaveRequestAPI.pvFieldname;


            NLogLoggerP.Trace("AddOTAddonFieldLeave - Asotentry - Before Call");
            StopwatchUtil.Time(
                () =>
            {
                using (var poAsotentryproxy = this.proxyAppObject.CreatePO_asotentryproxy())
                {
                    this.SetRequiredContextParameters();
                    poAsotentryproxy.AddOTAddonFieldLeave(ref pdsContext, pvFieldname, ref pdsaddotaddon, pdsotaddons, out cErrorMessage, out cWarningMessage);
                }
            });
            NLogLoggerP.Info("AddOTAddonFieldLeave - Asotentry - After Call");


            this.ReportErrors(cErrorMessage);
            this.ReportErrors(this.pdsContext);
            this.ReportErrors(pdsaddotaddon);

            if (pdsaddotaddon.ttbladdotaddoncriteria.Count > 0)
            {
                result.addotaddoncriteria = Addotaddoncriteria.BuildAddotaddoncriteriaFromRow(pdsaddotaddon.ttbladdotaddoncriteria[0]);
            }

            result.cWarningMessage = cWarningMessage;

            return(result);
        }
示例#2
0
        public IEnumerable <Otaddons> AddOTAddon(AsotentryAddOTAddonRequestAPI AsotentryAddOTAddonRequestAPI)
        {
            var results = new List <Otaddons>();

            var pdsaddotaddon = new pdsaddotaddonDataSet();

            var pdsotaddons = new pdsotaddonsDataSet();

            string cErrorMessage = string.Empty;

            DataRow ttbladdotaddoncriteriaRow = pdsaddotaddon.ttbladdotaddoncriteria.NewttbladdotaddoncriteriaRow();

            Addotaddoncriteria.UpdateRowFromAddotaddoncriteria(ref ttbladdotaddoncriteriaRow, AsotentryAddOTAddonRequestAPI.addotaddoncriteria);
            pdsaddotaddon.ttbladdotaddoncriteria.AddttbladdotaddoncriteriaRow((pdsaddotaddonDataSet.ttbladdotaddoncriteriaRow)ttbladdotaddoncriteriaRow);

            foreach (var obj in AsotentryAddOTAddonRequestAPI.otaddons)
            {
                DataRow ttblotaddonsRow = pdsotaddons.ttblotaddons.NewttblotaddonsRow();
                Otaddons.UpdateRowFromOtaddons(ref ttblotaddonsRow, obj);
                pdsotaddons.ttblotaddons.AddttblotaddonsRow((pdsotaddonsDataSet.ttblotaddonsRow)ttblotaddonsRow);
            }


            NLogLoggerP.Trace("AddOTAddon - Asotentry - Before Call");
            StopwatchUtil.Time(
                () =>
            {
                using (var poAsotentryproxy = this.proxyAppObject.CreatePO_asotentryproxy())
                {
                    this.SetRequiredContextParameters();
                    poAsotentryproxy.AddOTAddon(ref pdsContext, pdsaddotaddon, ref pdsotaddons, out cErrorMessage);
                }
            });
            NLogLoggerP.Info("AddOTAddon - Asotentry - After Call");


            this.ReportErrors(cErrorMessage);
            this.ReportErrors(this.pdsContext);
            this.ReportErrors(pdsaddotaddon);

            foreach (DataRow row in pdsotaddons.ttblotaddons)
            {
                results.Add(Otaddons.BuildOtaddonsFromRow(row));
            }
            return(results);
        }