public async Task delUserServiceOrder(int member_counter, string actionName, string serviceName) { NotifyContext db = this._dbconn; var q1 = (from p in db.hnNotifyItem where p.name == serviceName select p).AsEnumerable().FirstOrDefault(); var q = (from p in db.hnNotify where p.member_counter == member_counter && p.hnNotifyItem_counter == q1.counter select p) .AsEnumerable().FirstOrDefault(); var a = db.hnNotify.Find(q.counter); db.hnNotify.Attach(a); if (actionName == "Line") { a.Line = 0; } if (actionName == "Mail") { a.Mail = 0; } if (actionName == "Message") { a.Message = 0; } await db.SaveChangesAsync(); }
public async Task addLineToken(int counter, string Token) { NotifyContext db = this._dbconn; var _member = db.Members.Find(counter); db.Members.Attach(_member); _member.LineToken = Token; await db.SaveChangesAsync(); }
public async Task updateMember(hnNotify _hnNotify) { NotifyContext db = this._dbconn; var _member = db.hnNotify.Find(_hnNotify.counter); db.hnNotify.Attach(_member); // _member = _hnNotify; _member.Line = _hnNotify.Line; _member.Mail = _hnNotify.Mail; _member.Message = _hnNotify.Message; await db.SaveChangesAsync(); }