Beispiel #1
0
            public static string ClearArticleTemplate(gOfficeInfo office, gArticleModel template, gPatientOfficeInfo patient, string familyList)
            {
                StringBuilder sb = new StringBuilder(template.ContentWithDefaultStyle);

                sb.Replace("&OfficeName&", office?.ClinicName);
                sb.Replace("&Subscriber&", patient.Email);
                sb.Replace("&PatientName&", patient.FirstName);
                sb.Replace("&PatientSalutation&", patient.Salutation);
                sb.Replace("&PatientFirstName&", patient.FirstName);
                sb.Replace("&PatientLastName&", patient.LastName);
                sb.Replace("&AppointDate&", patient.AppointmentDate);
                sb.Replace("&AppointTime&", patient.AppointmentTime);
                sb.Replace("&ProviderName&", patient.Provider);
                sb.Replace("&Date&", DateTime.Now.Date.ToString());
                sb.Replace("&subjecttext&", template.Title);
                sb.Replace("&OfficeEmail&", office?.OfficeEmailAddress);
                sb.Replace("&OfficeStreet&", office?.AddressLine1);
                sb.Replace("&OfficeStreet2&", office?.AddressLine2);
                sb.Replace("&OfficeStreet3&", office?.AddressLine3);
                sb.Replace("&OfficeProvince&", office?.Province);
                sb.Replace("&City&", office?.City);
                sb.Replace("&Country&", office?.Country);
                sb.Replace("&PostalCode&", office?.PostalCode);
                sb.Replace("&OfficePhone&", office?.Phone);
                sb.Replace("&OfficeWebAddress&", office?.WebSite);
                sb.Replace("&Fax&", office?.Fax);
                sb.Replace("&FamilyList&", familyList);
                return(sb.ToString());
            }
Beispiel #2
0
 public static void CopyArticle(int TemplateID, int ArticleId, string name, int Office_Sequence, string Content, byte[] ContentImage)
 {
     using (var db = new Database(DbConfiguration.LtcNewsletter))
     {
         var           categoryId = 1;
         gArticleModel art        = db.Fetch <gArticleModel>($"select * from system_articles where ArticleID={ArticleId}").FirstOrDefault();
         if (art != null)
         {
             categoryId = art.CategoryID;
         }
         gSavePredefinedTemplate found = db.Fetch <gSavePredefinedTemplate>($"select * from templates where TemplateID={TemplateID}").FirstOrDefault();
         if (found != null)
         {
             gSaveUserTemplate obj = new gSaveUserTemplate();
             obj.TemplateTitle        = name;
             obj.Office_Sequence      = Office_Sequence;
             obj.EmbeddedNewsletter   = string.Empty;
             obj.MainBodymarkup       = Content;
             obj.TemplateSourceMarkup = found.TemplateSourceMarkup;
             obj.TypeID           = 8;
             obj.ThumbnailPath    = found.ThumbnailPath;
             obj.ContentImage     = ContentImage;
             obj.ModificationDate = DateTime.Now.ToUniversalTime();
             obj.CategoryID       = categoryId;
             db.Save(obj);
         }
     }
 }
Beispiel #3
0
        public static void SaveArticle(gArticleModel model)
        {
            using (var db = new Database(DbConfiguration.LtcNewsletter))
            {
                gArticleModel found = db
                                      .Fetch <gArticleModel>($"select * from system_articles where ArticleID={model.ArticleID}")
                                      .FirstOrDefault();

                if (found != null)
                {
                    db.Update(model, model.ArticleID);
                }
                //else
                // db.Save(model);
            }
        }
Beispiel #4
0
        public static void UpdateArticle(gArticleModelTest model)
        {
            using (var db = new Database(DbConfiguration.LtcNewsletter))
            {
                gArticleModel found = db
                                      .Fetch <gArticleModel>($"select * from system_articles where ArticleID={model.ArticleID}")
                                      .FirstOrDefault();
                byte[] byteArray = Convert.FromBase64String(model.ContentImage);

                found.ContentImage = byteArray;
                if (found != null)
                {
                    db.Update(found, model.ArticleID);
                }
                //else
                // db.Save(model);
            }
        }