コード例 #1
0
ファイル: TestDAL.cs プロジェクト: faisalharoon/HMS
        public int AddTestAttribute(tblTestAttribute obj)
        {
            //obj.ID = 18;

            db.tblTestAttributes.Add(obj);
            db.SaveChanges();
            return(obj.ID);
        }
コード例 #2
0
ファイル: TestDAL.cs プロジェクト: faisalharoon/HMS
        public void UpdateTestAttribute(tblTestAttribute obj)
        {
            db.tblTestAttributes.Attach(obj);
            var update = db.Entry(obj);

            update.Property(x => x.AttributeName).IsModified = true;

            update.Property(x => x.NormalRange).IsModified = true;
            update.Property(x => x.TestID).IsModified      = true;
            db.SaveChanges();
        }