Example #1
0
        public static AsMonitoringSession CreateFromASSession(DbManagerProxy manager, AsCampaign campaign, AsSession original)
        {
            AsMonitoringSession mssession = AsMonitoringSession.Accessor.Instance(null).CreateNewT(manager, campaign);


            string[] populateSession = new string[] {
                "idfMonitoringSession",
                "idfCampaign",
                "datStartDate",
                "datEndDate",
                "strMonitoringSessionID",
            };

            foreach (var prop in populateSession)
            {
                if (original.GetValue(prop) != null)
                {
                    mssession.SetValue(prop, original.GetValue(prop).ToString());
                }
            }

            mssession.strRegion     = original.Region == null ? String.Empty : original.Region.ToString();
            mssession.strRayon      = original.Rayon == null ? String.Empty : original.Rayon.ToString();
            mssession.strSettlement = original.Settlement == null ? String.Empty : original.Settlement.ToString();
            mssession.strStatus     = original.MonitoringSessionStatus.ToString();
            //mssession.FullSession = original;

            return(mssession);
        }
Example #2
0
        public static void UpdateFromASSession(AsMonitoringSession mssession, AsSession original, long idfCampaign)
        {
            string[] populateSession = new string[] {
                "datStartDate",
                "datEndDate",
                "strMonitoringSessionID",
            };

            foreach (var prop in populateSession)
            {
                if (original.GetValue(prop) != null)
                {
                    mssession.SetValue(prop, original.GetValue(prop).ToString());
                }
            }

            mssession.idfCampaign   = idfCampaign;
            mssession.strRegion     = original.Region.ToString();
            mssession.strRayon      = original.Rayon == null ? String.Empty : original.Rayon.ToString();
            mssession.strSettlement = original.Settlement == null ? String.Empty : original.Settlement.ToString();
            mssession.strStatus     = original.MonitoringSessionStatus.ToString();
            //mssession.FullSession = original;
        }