Ejemplo n.º 1
0
        public void AddParamType(CustomParamTypeViewModel model)
        {
            CustomParamType custom = new CustomParamType
            {
                Description = model.Description,
                IsActive    = true
            };

            ContextPerRequest.CurrentData.CustomParamTypes.Add(custom);
            ContextPerRequest.CurrentData.SaveChanges();
        }
Ejemplo n.º 2
0
        public void EditParamType(CustomParamTypeViewModel model)
        {
            var data = (from param in ContextPerRequest.CurrentData.CustomParamTypes
                        where param.CustomParamTypeID == model.CustomParamTypeID
                        select param).FirstOrDefault();

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

                ContextPerRequest.CurrentData.SaveChanges();
            }
        }