public void Update(Product instance) { if (instance == null) { throw new ArgumentNullException("instance"); } else { Db.Entry(instance).State = EntityState.Modified; this.SaveChanges(); } }
/// <summary> /// 直播主派彩返還 /// </summary> /// <param name="pdList"></param> /// <returns></returns> public bool AddLiveAssetsPayByRollback(int topicsn) { List <AssetsRecord> arm = new List <AssetsRecord>(); var ar = db.AssetsRecord.Where(x => x.topicSn == topicsn).ToList(); var arwin = ar.Where(x => x.type == 1).ToList(); foreach (var a in ar) { var tg = false; foreach (var aw in arwin) { if (aw.UserId == a.UserId && aw.choiceSn == a.choiceSn) { tg = true; } } if (!tg) { var aa = db.Assets.Where(x => x.UserId == a.UserId && x.unitSn == 1).FirstOrDefault(); aa.assets += Math.Abs(a.assets); db.Entry(aa).State = EntityState.Modified; a.type = 5; db.AssetsRecord.Add(a); db.SaveChanges(); } } return(true); }
public ActionResult Edit([Bind(Include = "sn,GameSn,VedioRecordSn,valid,inpdate")] GamePosts gamePosts) { if (ModelState.IsValid) { db.Entry(gamePosts).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(gamePosts)); }
public ActionResult Edit([Bind(Include = "sn,cName,eName,shortName,gamelogo,valid")] cfgPlayGame cfgPlayGame) { if (ModelState.IsValid) { db.Entry(cfgPlayGame).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cfgPlayGame)); }
public ActionResult Edit([Bind(Include = "sn,UserId,unitSn,gameSn,assets,type,inpdate")] AssetsRecord assetsRecord) { if (ModelState.IsValid) { db.Entry(assetsRecord).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(assetsRecord)); }
//存入機台 public void SlotCashCreate(cfgSlotCash instance) { if (instance == null) { throw new ArgumentNullException("instance"); } else { Db.Entry(instance).State = EntityState.Modified; this.SaveChanges(); } }