Exemplo n.º 1
0
        public void AddType(string Name, bool isRemote)
        {
            DictionaryConferenceType current = new DictionaryConferenceType();

            current.DictionaryConferenceTypeName = Name;
            current.IsRemote = isRemote;
            this._dbContext.DictionaryConferenceType.Add(current);
            this._dbContext.SaveChanges();
        }
Exemplo n.º 2
0
        public void insertType(ConferenceTypeModel conferenceType)
        {
            var result = _electriccastleContext.DictionaryConferenceType.ToList();
            var conferenceTypeModel = new DictionaryConferenceType {
                DictionaryConferenceTypeId = _electriccastleContext.DictionaryConferenceType.Max(x => x.DictionaryConferenceTypeId) + 1, DictionaryConferenceTypeName = conferenceType.ConferenceTypeName, ConferenceTypeCode = conferenceType.ConferenceTypeCode
            };

            _electriccastleContext.DictionaryConferenceType.Add(conferenceTypeModel);
            _electriccastleContext.SaveChanges();
        }
Exemplo n.º 3
0
        public TypeModel GetTypeById(int id)
        {
            DictionaryConferenceType type = _untoldContext.DictionaryConferenceType.Where(t => t.DictionaryConferenceTypeId == id).FirstOrDefault();
            TypeModel typeModel           = new TypeModel
            {
                TypeId   = type.DictionaryConferenceTypeId,
                TypeName = type.ConferenceTypeName,
            };

            return(typeModel);
        }
Exemplo n.º 4
0
        public void InsertType(TypeModel typeModel)
        {
            DictionaryConferenceType type = new DictionaryConferenceType()
            {
                DictionaryConferenceTypeId = typeModel.TypeId,
                ConferenceTypeName         = typeModel.TypeName
            };

            _untoldContext.DictionaryConferenceType.Add(type);
            _untoldContext.SaveChanges();
        }
Exemplo n.º 5
0
        public void DeleteType(int id)
        {
            //string commandText = "delete from DictionaryConferenceType where DictionaryConferenceTypeId = @Id";
            DictionaryConferenceType type = _untoldContext.DictionaryConferenceType.FirstOrDefault(t => t.DictionaryConferenceTypeId == id);

            if (type == null)
            {
                return;
            }
            _untoldContext.DictionaryConferenceType.Remove(type);
            _untoldContext.SaveChanges();
        }
Exemplo n.º 6
0
        public void UpdateType(TypeModel typeModel)
        {
            DictionaryConferenceType type = _untoldContext
                                            .DictionaryConferenceType
                                            .FirstOrDefault(t => t.DictionaryConferenceTypeId == typeModel.TypeId);

            if (type == null)
            {
                return;
            }
            type.ConferenceTypeName = typeModel.TypeName;
            _untoldContext.SaveChanges();
        }