public ActionResult ChangeGroup(SettlementUser body) { var entity = context.SettlementUsers.Where(x => x.Id == body.Id).FirstOrDefault(); entity.GroupId = body.GroupId; context.SaveChanges(); return(Ok()); }
private void AddTransaction(decimal amount, SettlementUser from, SettlementUser to) { _solutionTransactions.Add(new SolutionTransaction { Amount = amount, From = _reversedMode ? to : from, To = _reversedMode ? from : to }); }
public ActionResult <SettlementUser> AddUserWithoutAccountToSettlement(SettlementUser body) { var settlementUser = context.SettlementUsers; context.Add(new SettlementUser { SettlementId = body.SettlementId, DisplayName = body.DisplayName, UserId = null, RoleId = SettlementUser.Role.Watcher }); context.SaveChanges(); return(Ok(settlementUser)); }
public ActionResult <SettlementUser> AddUserToSettlement(SettlementUser body) { var user = context.Users.Where(a => a.Login == body.UserId).FirstOrDefault(); var id = GetSettlementUserId(); var settlementUser = context.SettlementUsers; context.Add(new SettlementUser { SettlementId = body.SettlementId, UserId = user.Id, DisplayName = user.Name, RoleId = SettlementUser.Role.Watcher }); context.SaveChanges(); return(Ok(settlementUser)); }