public void UpdateProduct(WardenServiceModel obj) { var index = WardenServiceData.IndexOf(obj); WardenServiceData.Remove(obj); WardenServiceData.Insert(index, obj); }
public void Hideorshowbutton(WardenServiceModel obj) { if (_OldDisciplinaryData == obj) { obj.Isbuttonvisible = !obj.Isbuttonvisible; UpdateProduct(obj); } else { if (_OldDisciplinaryData != null) { foreach (var items in WardenServiceData) { if (_OldDisciplinaryData.name == items.name) { _OldDisciplinaryData.Isbuttonvisible = false; UpdateProduct(_OldDisciplinaryData); break; } } } obj.Isbuttonvisible = true; UpdateProduct(obj); } _OldDisciplinaryData = obj; }
public async void OnDeleteCommand(WardenServiceModel obj) { web.DeleteServiceCategory(obj.id.ToString()); }
public async void OnTapCommand(WardenServiceModel obj) { Hideorshowbutton(obj); }
public async void OnEditCommand(WardenServiceModel obj) { await App.Current.MainPage.Navigation.PushModalAsync(new EditServiceCategory(obj.id.ToString(), obj.name, App.userid)); }