public int DeleteSoftwareById(int Id) { SoftwaresDBEntities entities = new SoftwaresDBEntities(); Software software = new Software(); software.Id = Id; entities.Entry(software).State = EntityState.Deleted; int Retval = entities.SaveChanges(); return(Retval); }
public int AddSoftware(string Name, string Version, string LicenceType, int Rank) { SoftwaresDBEntities entities = new SoftwaresDBEntities(); List list = new List(); list.Name = Name; list.Rank = Rank; list.Version = Version; list.LicenceType = LicenceType; entities.Lists.Add(list); int Retval = entities.SaveChanges(); return(Retval); }
public int UpdateSoftware(int Id, string Name, string Version, string LicenceType, int Rank) { SoftwaresDBEntities entities = new SoftwaresDBEntities(); List software = new List(); software.Id = Id; software.Name = Name; software.Rank = Rank; software.Version = Version; software.LicenceType = LicenceType; entities.Entry(software).State = EntityState.Modified; int Retval = entities.SaveChanges(); return(Retval); }