コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }