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(); }
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(); }
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); }
public void InsertType(TypeModel typeModel) { DictionaryConferenceType type = new DictionaryConferenceType() { DictionaryConferenceTypeId = typeModel.TypeId, ConferenceTypeName = typeModel.TypeName }; _untoldContext.DictionaryConferenceType.Add(type); _untoldContext.SaveChanges(); }
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(); }
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(); }