Ejemplo n.º 1
0
        private void button5_Click(object sender, EventArgs e)
        {
            using (var ctx = new testEntities_acd())
            {
                {
                    try
                    {
                        var users = from ex in ctx.crm_aspect_monitor_acd2 select ex;
                        foreach (var c in users)
                        {
                            acd    acdaspect = utils.TransToAcd(c);
                            string jsonkey   = string.Format("acd_{0}", c.serviceId);
                            string jsonvalue = JsonConvert.SerializeObject(acdaspect);
                            Console.WriteLine(jsonvalue);

                            if (mc.Get(jsonkey) != null)
                            {
                                bool b = mc.Store(StoreMode.Replace, jsonkey, jsonvalue);

                                Console.WriteLine(string.Format("replace key {0}============{1}", jsonkey, b));
                            }
                            else
                            {
                                bool b = mc.Store(StoreMode.Add, jsonkey, jsonvalue);

                                Console.WriteLine(string.Format("add key {0}============{1}", jsonkey, b));
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public static acd TransToAcd(object t)
        {
            acd acdaspect             = new acd();
            crm_aspect_monitor_acd2 c = (crm_aspect_monitor_acd2)t;

            acdaspect.serviceId                 = c.serviceId;
            acdaspect.service                   = c.service;
            acdaspect.status                    = c.status;
            acdaspect.agentsInAccept            = c.agentsInAccept;
            acdaspect.agentsInActive            = c.agentsInActive;
            acdaspect.agentsInConnect           = c.agentsInConnect;
            acdaspect.agentsInHold              = c.agentsInHold;
            acdaspect.agentsInIdle              = c.agentsInIdle;
            acdaspect.agentsInInternal          = c.agentsInInternal;
            acdaspect.agentsInManual            = c.agentsInManual;
            acdaspect.agentsInMultil            = c.agentsInMultil;
            acdaspect.agentsInNotReady          = c.agentsInNotReady;
            acdaspect.agentsInOther             = c.agentsInOther;
            acdaspect.agentsInPark              = c.agentsInPark;
            acdaspect.agentsInPreview           = c.agentsInPreview;
            acdaspect.agentsInWrap              = c.agentsInWrap;
            acdaspect.agentsLoggedIn            = c.agentsLoggedIn;
            acdaspect.application               = c.application;
            acdaspect.applicationId             = c.applicationId;
            acdaspect.avgAgentActiveTime        = c.avgAgentActiveTime;
            acdaspect.avgAgentIdleTime          = c.avgAgentIdleTime;
            acdaspect.avgAgentWrapTime          = c.avgAgentWrapTime;
            acdaspect.avgSpeedOfAnswer          = c.avgSpeedOfAnswer;
            acdaspect.avgTimeInQueue            = c.avgTimeInQueue;
            acdaspect.avgTimeToAbandon          = c.avgTimeToAbandon;
            acdaspect.avgWaitTime               = c.avgWaitTime;
            acdaspect.callsAbandonedBeforeQueue = c.callsAbandonedBeforeQueue;
            acdaspect.callsAbandonedBeforeServiceLevelInterval      = c.callsAbandonedBeforeServiceLevelInterval;
            acdaspect.callsAbandonedBeforeServiceLevelIntervalDaily = c.callsAbandonedBeforeServiceLevelIntervalDaily;
            acdaspect.callsAbandonedBeforeShortCallInterval         = c.callsAbandonedBeforeShortCallInterval;
            acdaspect.callsAbandonedBeforeShortCallIntervalDaily    = c.callsAbandonedBeforeShortCallIntervalDaily;
            acdaspect.callsAbandonedInQueue                = c.callsAbandonedInQueue;
            acdaspect.callsAbandonedTotal                  = c.callsAbandonedTotal;
            acdaspect.callsAbandonedTotalDaily             = c.callsAbandonedTotalDaily;
            acdaspect.callsAnswered                        = c.callsAnswered;
            acdaspect.callsInProgress                      = c.callsInProgress;
            acdaspect.callsInQueue                         = c.callsInQueue;
            acdaspect.callsInVoiceMail                     = c.callsInVoiceMail;
            acdaspect.callsOffered                         = c.callsOffered;
            acdaspect.callsOfferedServiceLevelInterval     = c.callsOfferedServiceLevelInterval;
            acdaspect.callsOverflowed                      = c.callsOverflowed;
            acdaspect.callsRejected                        = c.callsRejected;
            acdaspect.callsRerouted                        = c.callsRerouted;
            acdaspect.callsServicedWithinServiceLevel      = c.callsServicedWithinServiceLevel;
            acdaspect.callsServicedWithinServiceLevelDaily = c.callsServicedWithinServiceLevelDaily;
            acdaspect.callsTransferredToAgent              = c.callsTransferredToAgent;
            acdaspect.callsTransferredToExternal           = c.callsTransferredToExternal;
            acdaspect.callsTransferredToService            = c.callsTransferredToService;
            acdaspect.currentLongestQueueWaitSeconds       = c.currentLongestQueueWaitSeconds;
            acdaspect.durActiveTime                        = c.durActiveTime;
            acdaspect.durWrapTime     = c.durWrapTime;
            acdaspect.maxCallsInQueue = c.maxCallsInQueue;
            acdaspect.maxWaitInQueue  = c.maxWaitInQueue;
            acdaspect.occupancy       = c.occupancy;
            acdaspect.percentServiceWithinServiceLevel = c.percentServiceWithinServiceLevel;
            acdaspect.serviceLevelCalculationMethod    = c.serviceLevelCalculationMethod;
            acdaspect.serviceType        = c.serviceType;
            acdaspect.serviceTypeId      = c.serviceTypeId;
            acdaspect.startTimeMilitary  = c.startTimeMilitary;
            acdaspect.statusId           = c.statusId;
            acdaspect.stopTimeMilitary   = c.stopTimeMilitary;
            acdaspect.timezoneIdentifier = c.timezoneIdentifier;
            acdaspect.totalQueuedTime    = c.totalQueuedTime;
            acdaspect.totalRoutedToUser  = c.totalRoutedToUser;
            acdaspect.totalTimeToService = c.totalTimeToService;
            acdaspect.utcStartTime       = c.utcStartTime;
            acdaspect.utcStopTime        = c.utcStopTime;
            return(acdaspect);
        }