private void UpdateAction() { if (CreateOrEdit == null) { return; } if (CreateOrEdit.Existing == null) { Debugger.Break(); SubmitAction(); return; } if (!CreateOrEdit.Update()) { return; } var command = CreateOrEdit.Existing; command.Update(Manager); CreateOrEdit = null; Options.Save(Config); }
public async Task CreateOrEditAsync(CreateOrEdit cat) { cat.Spec.TenantId = AbpSession.TenantId ?? 0; Guid id = Guid.Empty; if (cat.Spec.Id != Guid.Empty || cat.Spec.Id.ToString() == "") { id = cat.Spec.Id; await _Repository.UpdateAsync(cat.Spec); } else { id = await _Repository.InsertAndGetIdAsync(cat.Spec); } if (cat.ValueList.Count > 0) { // await _valueRepository.DeleteAsync(c => c.SpecId == id); foreach (var item in cat.ValueList) { item.SpecId = id; if (item.Id == Guid.Empty) { await _valueRepository.InsertAsync(item); } else { var q = _valueRepository.Get(item.Id); q.Text = item.Text; await _valueRepository.UpdateAsync(q); } } } }
public async Task <CreateOrEdit> GetByIdAsync(Guid Id) { CreateOrEdit s = new CreateOrEdit(); s.Spec = await _Repository.FirstOrDefaultAsync(c => c.Id == Id); s.ValueList = await _valueRepository.GetAllListAsync(c => c.SpecId == Id); return(s); }
private void SubmitAction() { if (CreateOrEdit == null) { return; } var command = CreateOrEdit.ToManipulationCommand(); Config.Add(command); Options.Save(Config); var vm = new CommandViewModel(command, EditCommand, DeleteCommand); Commands.Add(vm); CreateOrEdit = null; }
public BookmarkDetails(CreateOrEdit action) { InitializeComponent(); this.action = action; }
public BookmarkDetails(CreateOrEdit action) { InitializeComponent(); this.action = action; }