Пример #1
0
        public void AddCustomType(CustomReportTypeViewModel model)
        {
            CustomReportType custom = new CustomReportType
            {
                Description = model.Description,
                IsActive    = true
            };

            ContextPerRequest.CurrentData.CustomReportTypes.Add(custom);
            ContextPerRequest.CurrentData.SaveChanges();

            SaveRoles(custom.CustomReportTypeID, model.SelectedRoles);
        }
Пример #2
0
        public void EditParamType(CustomReportTypeViewModel model)
        {
            var data = (from custom in ContextPerRequest.CurrentData.CustomReportTypes
                        where custom.CustomReportTypeID == model.CustomReportTypeID
                        select custom).FirstOrDefault();

            if (data != null)
            {
                data.Description = model.Description;

                ContextPerRequest.CurrentData.SaveChanges();

                SaveRoles(model.CustomReportTypeID, model.SelectedRoles);
            }
        }