public int StuAdd(XueShengBiao xs) { MBanJiBiaoDAL bj = new MBanJiBiaoDAL(); if (bj.UpdateNum(xs, 2) == 0) { return(0); } context.XueShengBiao.Add(xs); return(context.SaveChanges()); }
public int Delete(XueShengBiao st) { MBanJiBiaoDAL bj = new MBanJiBiaoDAL(); if (bj.UpdateNum(st, 1) == 0) { return(0); } context.Set <XueShengBiao>().Attach(st); context.Set <XueShengBiao>().Remove(st); return(context.SaveChanges()); }