public List <ActionLogProxy> TranslateToActionLog()
        {
            List <ActionLogProxy>    actionLogProxyList = new List <ActionLogProxy>();
            List <CRMLinkErrorProxy> crmLinkErrorProxy  = GetCRMLinkErrorProxies().ToList();

            foreach (CRMLinkErrorProxy crmLinkError in GetCRMLinkErrorProxies().ToList())
            {
                ActionLogProxy actionLogProxy = new ActionLogProxy();
                actionLogProxy.ModifierID  = (int)SystemUser.CRM;
                actionLogProxy.CreatorID   = (int)SystemUser.CRM;
                actionLogProxy.Description = string.Format("{0}{1}",
                                                           crmLinkError.ErrorMessage,
                                                           crmLinkError.Orientation.ToLower() == "in" ? " (" + crmLinkError.ErrorCount + ")" : "");
                actionLogProxy.ActionLogType = crmLinkError.OperationType == "create" ? ActionLogType.Insert : ActionLogType.Update;

                actionLogProxy.OrganizationID = crmLinkError.OrganizationID;
                actionLogProxy.ActionLogID    = crmLinkError.CRMLinkErrorID;
                actionLogProxy.CreatorName    = crmLinkError.CRMType + " Integration";
                actionLogProxy.DateCreated    = DateTime.SpecifyKind(crmLinkError.DateCreated, DateTimeKind.Utc);
                actionLogProxy.DateModified   = DateTime.SpecifyKind(crmLinkError.DateModified, DateTimeKind.Utc);

                int  objectId = 0;
                bool isNumber = int.TryParse(crmLinkError.ObjectID, out objectId);
                actionLogProxy.RefID = objectId;

                actionLogProxyList.Add(actionLogProxy);
            }


            return(actionLogProxyList);
        }
Beispiel #2
0
        public ActionLogProxy GetProxy()
        {
            ActionLogProxy result = new ActionLogProxy();

            result.ModifierID     = this.ModifierID;
            result.CreatorID      = this.CreatorID;
            result.Description    = this.Description;
            result.ActionLogType  = this.ActionLogType;
            result.RefID          = this.RefID;
            result.RefType        = this.RefType;
            result.OrganizationID = this.OrganizationID;
            result.ActionLogID    = this.ActionLogID;

            result.DateCreated  = DateTime.SpecifyKind(this.DateCreatedUtc, DateTimeKind.Utc);
            result.DateModified = DateTime.SpecifyKind(this.DateModifiedUtc, DateTimeKind.Utc);


            return(result);
        }