public async Task <UpdateMany> GetUpdateManyModel(UpdateMany m) { m.AddrLow = Addr.Low; m.AddrHigh = Addr.High; m.OldAddress = (ushort)m.Address; m.Colors = await _colorRep.GetAllAsync(); return(m); }
public async Task UpdateManyAsync(UpdateMany m) { m.DefaultNumber = GetDefaultNumber(m.Address); bool isAddressPartChanged = IsAddressPartChanged(m.Address, m.OldAddress); foreach (string id in m.Id.Where(x => x != null)) { await _rep.UpdateManyAsync(id, m.Address, m.DefaultNumber, m.ColorId, isAddressPartChanged); m.DefaultNumber++; } }
public async Task <IActionResult> UpdateMany(UpdateMany m) { try { await _service.UpdateManyAsync(m); return(RedirectToAction("Many")); } catch { return(View("CU_Failed")); } }
public static DataContracts.UpdateResult UpdateMany <T>(string collectionName, FilterDefinition <T> filter, UpdateDefinition <T> update, UpdateOptions updateOptions, string schemaId = "", Notification notification = null) { var request = new UpdateMany { CollectionName = collectionName, OutputMode = JsonOutputMode.Strict, Filter = filter.ToJson(), Notification = notification, Update = update.ToBsonDocument().ToJson(), UpdateOptions = updateOptions, SchemaId = schemaId, CultureCode = CultureInfo.CurrentCulture.Name }; var response = Send <UpdateOneResponse>("entities/" + collectionName + "/bulk", request, "PUT"); return(response.Result); }
public async Task <IActionResult> ShowUpdateMany(UpdateMany m) { m = await _service.GetUpdateManyModel(m); return(View("ShowUpdateMany", m)); }