public WrapperEmailTemplate CreateSingleEmailTemplate(EmailTemplateENT UserProfile)
        {
            WrapperEmailTemplate data = new WrapperEmailTemplate();

            data.EmailTemplate = new EmailTemplateCRUD().CreateSingle(UserProfile);
            return(data);
        }
Exemple #2
0
        public string EmailSubjectReplacements(EmailTemplateENT template, ProjectENT projectDetail, ContactENT customer, ContactENT contactPerson, BuildingSupplierENT buildingSupplier, Users user)
        {
            string content = "";

            template.Title = template.Title.Replace("#CustomerName#", customer.Name);
            template.Title = template.Title.Replace("#Description#", projectDetail.Description);
            template.Title = template.Title.Replace("#Name#", user.FullName);
            template.Title = template.Title.Replace("#PhoneNumber#", user.ContactNo);
            template.Title = template.Title.Replace("#Email#", user.Email);
            template.Title = template.Title.Replace("#Designation#", user.Designation);
            if (contactPerson != null)
            {
                template.Title = template.Title.Replace("#ansvarlig#", contactPerson.Name);
            }
            else
            {
                template.Title = template.Title.Replace("#ansvarlig#", "");
            }
            template.Title = template.Title.Replace("#Address#", projectDetail.Address);
            template.Title = template.Title.Replace("#ProjectTitle#", projectDetail.Title);
            template.Title = template.Title.Replace("#CustomerPhone#", customer.ContactNo);
            template.Title = template.Title.Replace("#BuildingSupplier#", buildingSupplier.Title);
            content        = template.Title;

            return(content);
        }
Exemple #3
0
        public EmailTemplateENT SelectSingle(int Id)
        {
            NbkDbEntities    dbcontext = new NbkDbEntities();
            EmailTemplate    Obj       = dbcontext.EmailTemplate.Where(x => x.Id == Id).FirstOrDefault();
            EmailTemplateENT Data      = new EmailTemplateENT()
            {
                Id       = Obj.Id,
                Title    = Obj.Title,
                Template = Obj.Template
            };

            return(Data);
        }
Exemple #4
0
        public EmailTemplateENT CreateSingle(EmailTemplateENT Obj)
        {
            NbkDbEntities dbcontext = new NbkDbEntities();
            EmailTemplate Data      = new EmailTemplate()
            {
                Title    = Obj.Title,
                Template = Obj.Template
            };

            dbcontext.EmailTemplate.Add(Data);
            dbcontext.SaveChanges();

            Obj.Id = Data.Id;

            return(Obj);
        }
Exemple #5
0
        public EmailTemplateENT UpdateSelectSingle(EmailTemplateENT Obj)
        {
            NbkDbEntities dbcontext = new NbkDbEntities();
            EmailTemplate Data      = new EmailTemplate()
            {
                Id       = Obj.Id,
                Title    = Obj.Title,
                Template = Obj.Template
            };

            dbcontext.EmailTemplate.Attach(Data);
            var update = dbcontext.Entry(Data);

            update.Property(x => x.Title).IsModified    = true;
            update.Property(x => x.Template).IsModified = true;

            dbcontext.SaveChanges();

            return(Obj);
        }