Пример #1
0
 public static ContractTemplate[] GetTemplates()
 {
     using (var db = new PricingPortalEntities())
     {
         return(db.ContractTemplates.ToArray());
     }
 }
 public static ContractTemplate[] GetTemplates()
 {
     using (var db = new PricingPortalEntities())
     {
         return db.ContractTemplates.ToArray();
     }
 }
Пример #3
0
        public static ContractTemplateType[] GetTemplateTypes()
        {
            using (var db = new PricingPortalEntities())
            {
                var query = from b in db.ContractTemplateTypes
                            select b;

                return(query.ToArray());
            }
        }
Пример #4
0
        public static ContractTemplate[] GetTemplatesByType(int typeId)
        {
            using (var db = new PricingPortalEntities())
            {
                var query = from b in db.ContractTemplates
                            where b.ContractTemplateTypeId == typeId
                            select b;

                return(query.ToArray());
            }
        }
Пример #5
0
        public static ContractTemplate GetTemplateByNameAndType(int typeId, string name)
        {
            using (var db = new PricingPortalEntities())
            {
                var query = from b in db.ContractTemplates
                            where b.ContractTemplateTypeId == typeId && b.TemplateName == name
                            select b;

                return(query.First());
            }
        }
Пример #6
0
        public static ContractTemplate GetTemplateById(int id)
        {
            using (var db = new PricingPortalEntities())
            {
                var query = from b in db.ContractTemplates
                            where b.ContractTemplateId == id
                            select b;

                return(query.First());
            }
        }
Пример #7
0
        public static void UpdateTemplate(int templateId, string templateHtml)
        {
            using (var db = new PricingPortalEntities())
            {
                ContractTemplate template = db.ContractTemplates.First(c => c.ContractTemplateId == templateId);

                template.HtmlContent = templateHtml;

                db.SaveChanges();
            }
        }
        public static ContractTemplate[] GetTemplatesByType(int typeId)
        {
            using (var db = new PricingPortalEntities())
            {
                var query = from b in db.ContractTemplates
                            where b.ContractTemplateTypeId == typeId
                            select b;

                return query.ToArray();
            }
        }
        public static ContractTemplate GetTemplateByNameAndType(int typeId, string name)
        {
            using (var db = new PricingPortalEntities())
            {
                var query = from b in db.ContractTemplates
                            where b.ContractTemplateTypeId == typeId && b.TemplateName == name
                            select b;

                return query.First();
            }
        }
Пример #10
0
        public static ContractTemplate GetTemplateById(int id)
        {
            using (var db = new PricingPortalEntities())
            {
                var query = from b in db.ContractTemplates
                            where b.ContractTemplateId == id
                            select b;

                return query.First();
            }
        }
Пример #11
0
        public static void CreateTemplatesType(string typeCode, string typeDesc)
        {
            using (var db = new PricingPortalEntities())
            {
                ContractTemplateType newType = new ContractTemplateType()
                {
                    TemplateTypeCode = typeCode,
                    Description      = typeDesc
                };

                db.ContractTemplateTypes.Add(newType);
                db.SaveChanges();
            }
        }
Пример #12
0
        public static void CreateTemplatesType(string typeCode, string typeDesc)
        {
            using (var db = new PricingPortalEntities())
            {
                ContractTemplateType newType = new ContractTemplateType()
                {
                    TemplateTypeCode = typeCode,
                    Description = typeDesc
                };

                db.ContractTemplateTypes.Add(newType);
                db.SaveChanges();
            }
        }
Пример #13
0
        public static void CreateTemplate(string templateName, string templateHtml, int templateTypeId)
        {
            using (var db = new PricingPortalEntities())
            {
                ContractTemplate newTemplate = new ContractTemplate()
                {
                    CreateDate             = DateTime.Now,
                    CreateUserId           = 16,
                    EffectiveDate          = DateTime.MinValue,
                    EndDate                = DateTime.MaxValue,
                    TemplateName           = templateName,
                    HtmlContent            = templateHtml,
                    ContractTemplateTypeId = templateTypeId
                };

                db.ContractTemplates.Add(newTemplate);
                db.SaveChanges();
            }
        }
Пример #14
0
        public static void CreateTemplate(string templateName, string templateHtml, int templateTypeId)
        {
            using (var db = new PricingPortalEntities())
            {
                ContractTemplate newTemplate = new ContractTemplate()
                {
                    CreateDate = DateTime.Now,
                    CreateUserId = 16,
                    EffectiveDate = DateTime.MinValue,
                    EndDate = DateTime.MaxValue,
                    TemplateName = templateName,
                    HtmlContent = templateHtml,
                    ContractTemplateTypeId = templateTypeId
                };

                db.ContractTemplates.Add(newTemplate);
                db.SaveChanges();
            }
        }
Пример #15
0
        public static ContractTemplateType[] GetTemplateTypes()
        {
            using (var db = new PricingPortalEntities())
            {
                var query = from b in db.ContractTemplateTypes
                            select b;

                return query.ToArray();
            }
        }
Пример #16
0
        public static void UpdateTemplate(int templateId, string templateHtml)
        {
            using (var db = new PricingPortalEntities())
            {
                ContractTemplate template = db.ContractTemplates.First(c => c.ContractTemplateId == templateId);

                template.HtmlContent = templateHtml;

                db.SaveChanges();
            }
        }