public void Apply() { if (Model.Type && string.IsNullOrEmpty(Model.Title)) { Helper.NotifyWarning("لطفا هنوان را وارد کنید"); } if (!Model.Type) { CreatePerson(); if (imageChanged) { SetImage(); } } var request = new IntroducerRequest { UserID = GlobalVar.User.ID, DTO = new IntroducerDTO { ID = Model.ID, PersonID = Model.Type ? null : (int?)Person.ID, Title = Model.Title, Type = Model.Type } }; var response = Helper.Call(s => s.IntroducerSet(request)); ServiceResponseHelper.CheckServiceResponse(response, "IntroducerSet", request); Helper.NotifySuccess($"ثبت معرف با موفقیت انجام شد", "ثبت معرف"); Listener?.OnIntroducerInputApply(true); }
private static void RefreshIntroducers() { var request = new IntroducerRequest { UserID = GlobalVar.User.ID, LoadPerson = true }; var list = Helper.Call(s => s.IntroducerGetList(request)); if (list?.Success ?? false) { Helper.InvokeMainThread(() => { Introducers.Clear(); Introducers.AddRange(list.ResultList.Select(i => new IntStringPair(i.ID, i.Title ?? $"{i.Person.FirstName} {i.Person.LastName}"))); }); } }
private void RefreshIntroducers() { int selectedId = SelectedModel?.ID ?? 0; var request = new IntroducerRequest { UserID = GlobalVar.User.ID, Filter = new IntroducerFilter(), LoadPerson = true }; var response = Helper.Call(s => s.IntroducerGetList(request)); ServiceResponseHelper.CheckServiceResponse(response, "IntroducerGetList"); var temp = response.ResultList.Select(i => Mapper.SmartMap(i, new IntroducerModel(), (dto, model) => model.Person = Mapper.Map(dto.Person, new PersonModel()))); Helper.InvokeMainThread(() => { Models.Clear(); Models.AddRange(temp); SelectedModel = Models.FirstOrDefault(i => i.ID == selectedId); }); }