Ejemplo n.º 1
0
        public void OnPostCreateAsync(Entities.kipon_datepoc target, Entities.IUnitOfWork uow)
        {
            if (target.kipon_wastest == true)
            {
                var sb = new StringBuilder();
                sb.AppendLine(target.kipon_name);
                sb.AppendLine($"timezonefreedateonly      : {target.kipon_timezonefreedateonly?.ToString("yyyy-MM-dd HH:mm:ss")}");
                sb.AppendLine($"kipon_timezonefreedatetime: {target.kipon_timezonefreedatetime?.ToString("yyyy-MM-dd HH:mm:ss")}");
                sb.AppendLine($"kipon_dateonly            : {target.kipon_dateonly?.ToString("yyyy-MM-dd HH:mm:ss")}");
                sb.AppendLine($"kipon_localdateonly       : {target.kipon_localdateonly?.ToString("yyyy-MM-dd HH:mm:ss")}");
                sb.AppendLine($"kipon_localdatetime       : {target.kipon_localdatetime?.ToString("yyyy-MM-dd HH:mm:ss")}");
                sb.AppendLine($"CreatedOn                 : {target.CreatedOn?.ToString("yyyy-MM-dd HH:mm:ss")}");
                sb.AppendLine($"======================================= Fetch below =========================================");
                var me = (from q in uow.Datepocs.GetQuery()
                          where q.kipon_datepocId == target.Id
                          select q).Single();

                sb.AppendLine($"timezonefreedateonly      : {me.kipon_timezonefreedateonly?.ToString("yyyy-MM-dd HH:mm:ss")}");
                sb.AppendLine($"kipon_timezonefreedatetime: {me.kipon_timezonefreedatetime?.ToString("yyyy-MM-dd HH:mm:ss")}");
                sb.AppendLine($"kipon_dateonly            : {me.kipon_dateonly?.ToString("yyyy-MM-dd HH:mm:ss")}");
                sb.AppendLine($"kipon_localdateonly       : {me.kipon_localdateonly?.ToString("yyyy-MM-dd HH:mm:ss")}");
                sb.AppendLine($"kipon_localdatetime       : {me.kipon_localdatetime?.ToString("yyyy-MM-dd HH:mm:ss")}");
                sb.AppendLine($"CreatedOn                 : {me.CreatedOn?.ToString("yyyy-MM-dd HH:mm:ss")}");

                var clean = new Entities.kipon_datepoc
                {
                    kipon_datepocId  = target.Id,
                    kipon_testresult = sb.ToString(),
                    kipon_wastest    = false
                };
                uow.Update(clean);
            }
        }
        private void Update(Models.Plugin plugin, Models.Step step, Entities.SdkMessageProcessingStep crmStep)
        {
            var updated = false;
            var clean   = new Entities.SdkMessageProcessingStep
            {
                SdkMessageProcessingStepId = crmStep.SdkMessageProcessingStepId
            };

            if (crmStep.FilteringAttributes != null && step.FilteringAttributesString == null)
            {
                clean.FilteringAttributes = null;
                updated = true;
            }

            if (step.FilteringAttributesString != null && step.FilteringAttributesString != crmStep.FilteringAttributes)
            {
                clean.FilteringAttributes = step.FilteringAttributesString;
                updated = true;
            }

            if (updated)
            {
                uow.Update(clean);
                this.messageService.Inform($"Updated step {crmStep.Name} on {crmStep.LogicalName}.");
            }

            this.UpdateImage(crmStep, 1, step.Stage, step.IsAsync, step.Message, step.PreImage);
            this.UpdateImage(crmStep, 2, step.Stage, step.IsAsync, step.Message, step.PostImage);
        }
 public void UploadAssembly()
 {
     if (!isNew)
     {
         var clean = new Entities.PluginAssembly {
             PluginAssemblyId = this.pluginAssembly.PluginAssemblyId
         };
         clean.Content = System.Convert.ToBase64String(code);
         uow.Update(clean);
         this.messageService.Inform("Assembly code updated");
     }
 }