public DictionarySubObject DictionarySubObjEdit(DictionarySubObjEdit obj)
        {
            var Dic   = _context.DictionaryObjects.Where(m => m.DictionaryObjectName.Equals(obj.DictionaryObjID)).First();
            var model = _context.DictionarySubObjects.Where(m => m.DictionarySubObjectId == obj.DictionarySubObjID).FirstOrDefault();

            _context.Entry(model).Property(a => a.DictionaryObjectId).CurrentValue      = Dic.DictionaryObjectId;
            _context.Entry(model).Property(a => a.DictionarySubObjectName).CurrentValue = obj.Name;
            _context.SaveChanges();

            return(model);
        }
Ejemplo n.º 2
0
        public IActionResult DictionarySubObjEdit(int ID)
        {
            var obj     = _dictionaryService.GetDictionarySubObject(ID);
            var DictObj = _dictionaryService.GetDictionaryObject(obj.DictionaryObjectId);
            var Dic     = _dictionaryService.GetDictionary(DictObj.DictionaryId);
            var model   = new DictionarySubObjEdit()
            {
                DictionaryObjects = _dictionaryService.GetDictionaryObjectList(Dic.DictionaryName),
                Name = obj.DictionarySubObjectName,
                DictionarySubObjID = obj.DictionarySubObjectId
            };

            return(View(model));
        }
Ejemplo n.º 3
0
        public IActionResult DictionarySubObjEdit(DictionarySubObjEdit obj)
        {
            var dictSubObj = _dictionaryService.DictionarySubObjEdit(obj);
            var DictObj    = _dictionaryService.GetDictionaryObject(dictSubObj.DictionaryObjectId);
            var Dic        = _dictionaryService.GetDictionary(DictObj.DictionaryId);
            var model      = new DictionarySubObjEdit()
            {
                DictionaryObjects  = _dictionaryService.GetDictionaryObjectList(Dic.DictionaryName),
                DictionaryObjID    = dictSubObj.DictionaryObjectId.ToString(),
                DictionarySubObjID = dictSubObj.DictionarySubObjectId,
                Name = dictSubObj.DictionarySubObjectName
            };

            return(View(model));
        }