public void Update(GroupSupport_Model model) { var data = Connect_Enttity.GroupSupports.FirstOrDefault(x => x.Id == model.Id); if (data != null) { data.Name = model.Name; data.Ord = (int)(model.Ord); data.Active = (int)(model.Active); data.Lang = model.Lang; data.NameEn = model.NameEn; Connect_Enttity.SaveChanges(); Dispose(); } }
public IList <GroupSupport_Model> GetId(GroupSupport_Model model) { IList <GroupSupport_Model> result = new List <GroupSupport_Model>(); result = Connect_Enttity.GroupSupports.Where(x => x.Id == model.Id).Select(x => new GroupSupport_Model { Id = x.Id, Name = x.Name, Ord = (int)(x.Ord), Active = (int)(x.Active), Lang = x.Lang, NameEn = x.NameEn }).ToList(); return(result); }
public void Create(GroupSupport_Model model) { var data = Connect_Enttity.GroupSupports.FirstOrDefault(x => x.Id == model.Id); if (data == null) { var entity = new GroupSupport(); entity.Name = model.Name; entity.Ord = (int)(model.Ord); entity.Active = (int)(model.Active); entity.Lang = model.Lang; entity.NameEn = model.NameEn; Connect_Enttity.GroupSupports.Add(entity); Connect_Enttity.SaveChanges(); Dispose(); } }
public IEnumerable <GroupSupport_Model> ReadID(GroupSupport_Model model) { return(GetId(model)); }