public void UpdateManagerStatus(int StoreManagerID, string Status) { StoreManagerService.UpdateManagerStatus(StoreManagerID, Status); var GroupList = LineBindingService.GetGroupList(StoreManagerID); foreach (var item in GroupList) { BotService.LeaveGroup(item.LineGroupID); } LineBindingService.UpdateManagerAllGroupStatus(StoreManagerID, Status); }
public ActionResult LineBinding(string code) { string accessToken = LineRequestService.CodeToAccessToken(code); var lineProfile = LineRequestService.UseTokenToGetProfile(accessToken); var userId = StoreManagerService.SearchLineID(lineProfile.userId); if (userId == 0) { LineBindingService.InsertStoreManager(lineProfile); } else { StoreManagerService.UpdateManagerStatus(userId, "True"); } return(View()); }