Example #1
0
        //
        // GET: /Administration/ClaimTemplate/Details/5

        public ActionResult Details(int id = 0)
        {
            ViewBag.ClaimTemplateID = id;
            ClaimTemplate claimtemplate = _claimTemplateFactory.GetClaimTemplate(id);

            if (claimtemplate == null)
            {
                return(HttpNotFound());
            }
            return(View(claimtemplate));
        }
Example #2
0
        public ActionResult FieldsListCreateFromClaimTemplate(int claimTemplateId = 0)
        {
            ClaimTemplate claimTemplate = null;

            if (claimTemplateId > 0)
            {
                claimTemplate = _claimTemplateFactory.GetClaimTemplate(claimTemplateId);
            }
            return(View(claimTemplate));
        }
Example #3
0
        public void CreateFieldsForClaimFromTemplate(Claim claim)
        {
            var mytemplate = new ClaimTemplate();

            if (claim.ClaimTemplateID != null)
            {
                mytemplate = _claimTemplateFactory.GetClaimTemplate(claim.ClaimTemplateID.Value);
            }

            foreach (var claimFieldGroupTemplate in mytemplate.ClaimFieldGroupTemplates)
            {
                var claimFieldGroup =
                    new ClaimFieldGroup
                {
                    Name        = claimFieldGroupTemplate.Name,
                    Description = claimFieldGroupTemplate.Description,
                    ItemOrder   = claimFieldGroupTemplate.ItemOrder
                };

                foreach (var claimFieldTemplate in claimFieldGroupTemplate.ClaimFieldTemplates)
                {
                    var claimField =
                        new ClaimField
                    {
                        Name = claimFieldTemplate.Name,
                        Code = claimFieldTemplate.Code,
                        ClaimFieldTemplateID = claimFieldTemplate.ClaimFieldTemplateID,
                        ClaimFieldGroupID    = claimFieldGroupTemplate.ClaimFieldGroupTemplateID,
                        TemplateBName        = claimFieldTemplate.FieldType.TemplateName
                    };

                    claimFieldGroup.ClaimFields.Add(claimField);
                }
                claim.ClaimFieldGroups.Add(claimFieldGroup);
            }
            _db.SaveChanges();
            _db.Dispose();
        }