private void Tap_Tapped(object sender, EventArgs e) { if (BackCommand?.CanExecute(BackCommandParameter) ?? false) { BackCommand.Execute(BackCommandParameter); } }
/// <summary> /// 저장작업 /// </summary> /// <param name="obj"></param> private void OnSave(object obj) { // 필수체크 (Tag에 필수체크 표시한 EditBox, ComboBox 대상으로 수행) if (!BizUtil.ValidReq(blk03AddView)) { return; } if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes) { return; } try { BizUtil.Update2(Dtl, "updateBlk03Dtl"); } catch (Exception ex) { Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다." + ex.Message); return; } Messages.ShowOkMsgBox(); BackCommand.Execute(null); //닫기 }
private BethesdaNetLoginVM() { Instructions = "Login to Bethesda.NET in-game..."; LoginViaSkyrimSE = ReactiveCommand.CreateFromTask(async() => { LoggingIn.OnNext(true); Instructions = "Starting Skyrim Special Edition..."; await BethesdaNetDownloader.Login(Game.SkyrimSpecialEdition); LoggingIn.OnNext(false); await BackCommand.Execute(); }, Game.SkyrimSpecialEdition.MetaData().IsInstalled ? LoggingIn.Select(e => !e).StartWith(true) : Observable.Return(false)); LoginViaFallout4 = ReactiveCommand.CreateFromTask(async() => { LoggingIn.OnNext(true); Instructions = "Starting Fallout 4..."; await BethesdaNetDownloader.Login(Game.Fallout4); LoggingIn.OnNext(false); await BackCommand.Execute(); }, Game.Fallout4.MetaData().IsInstalled ? LoggingIn.Select(e => !e).StartWith(true) : Observable.Return(false)); }
private void ExecuteSave() { _appSettingsService.Save(AppSettings); _projectSettingsService.Save(ProjectSettings); BackCommand.Execute(null); }
/// <summary> /// 삭제처리 /// </summary> /// <param name="obj"></param> private void OnDelete(object obj) { //0.삭제전 체크 Hashtable param = new Hashtable(); param.Add("sqlId", "SelectFileMapList"); param.Add("sqlId2", "SelectFileMapList"); param.Add("CNT_NUM", Dtl.CNT_NUM); Hashtable result = BizUtil.SelectLists(param); DataTable dt = new DataTable(); DataTable dt2 = new DataTable(); /* * try * { * dt = result["dt"] as DataTable; * if (dt.Rows.Count > 0) * { * Messages.ShowErrMsgBox("사진첨부내역이 존재합니다."); * return; * } * } * catch (Exception) { } * try * { * dt2 = result["dt2"] as DataTable; * if (dt2.Rows.Count > 0) * { * Messages.ShowInfoMsgBox("파일첨부내역이 존재합니다."); * return; * } * } * catch (Exception) { } */ // 1.삭제처리 if (Messages.ShowYesNoMsgBox("급수전대장을 삭제하시겠습니까?") != MessageBoxResult.Yes) { return; } try { BizUtil.Update2(Dtl, "deleteSplyDtl"); } catch (Exception) { Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다."); return; } Messages.ShowOkMsgBox(); BackCommand.Execute(null); }
protected override bool OnBackButtonPressed() { if (ActiveParentId != 1) { BackCommand.Execute(null); return(true); } base.OnBackButtonPressed(); return(false); }
public override void Init(object initData) { base.Init(initData); MessagingCenter.Subscribe <MyAccountEditViewModel>(this, "ShowPasswordMessage", async(obj) => { BackCommand.Execute(null); await Task.Delay(800); await ToastService.Show("Votre nouveau mot de passe à bien été enregistré"); }); }
private void BackButtonClickHandler(object sender, RoutedEventArgs args) { RoutedEventArgs backArgs = new RoutedEventArgs(BackEvent, this); RaiseEvent(backArgs); if (BackCommand != null && BackCommand.CanExecute(null)) { BackCommand.Execute(null); } }
public ContactPageViewModel() { _repository = new ContactRepository(); SaveCommand = new RelayCommand(o => { var contact = new Contact { Name = Name, Email = Email, Message = Message }; _repository.Create(contact); BackCommand?.Execute(null); }); }
/// <summary> /// 삭제처리 /// </summary> /// <param name="obj"></param> private void OnDelete(object obj) { //0.삭제전 체크 Hashtable param = new Hashtable(); param.Add("sqlId", "SelectFileMapList"); param.Add("FTR_CDE", Dtl.FTR_CDE); param.Add("FTR_IDN", Dtl.FTR_IDN); param.Add("BIZ_ID", string.Concat(Dtl.FTR_CDE, Dtl.FTR_IDN)); Hashtable result = BizUtil.SelectLists(param); DataTable dt = new DataTable(); //try //{ // dt = result["dt"] as DataTable; // if (dt.Rows.Count > 0) // { // Messages.ShowInfoMsgBox("파일첨부내역이 존재합니다."); // return; // } //} //catch (Exception) { } // 1.삭제처리 if (Messages.ShowYesNoMsgBox("블록을 삭제하시겠습니까?") != MessageBoxResult.Yes) { return; } try { BizUtil.Update2(Dtl, "deleteBlk01Dtl"); } catch (Exception e) { Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다." + e.Message); return; } Messages.ShowOkMsgBox(); BackCommand.Execute(null); }
public override void ViewAppeared() { try { var myCartdata = Mvx.IoCProvider.Resolve <IPersistData>().GetCartData(); if (string.IsNullOrEmpty(myCartdata) || myCartdata == "null") { UserDialogs.Instance.Alert(new AlertConfig { Message = "Sorry, Cart is empty.", OkText = AppResources.Lbl_OK, OnAction = () => { BackCommand?.Execute(this); } }); } else { CartList = JsonConvert.DeserializeObject <ObservableCollection <ProductData> >(myCartdata); if (CartList.Count > 0) { foreach (var item in CartList) { item.RemoveItemSelectedCommand = RemoveItemCommand; } } else { UserDialogs.Instance.Alert(new AlertConfig { Message = "Sorry, Cart is empty.", OkText = AppResources.Lbl_OK, OnAction = () => { BackCommand?.Execute(this); } }); } } } catch (Exception ex) { Mvx.IoCProvider.Resolve <IAppLogger>().DebugLog(nameof(CartViewModel), ex); } }
public SearchNavigationBar() { InitializeComponent(); gridNav.Margin = new Thickness(0, App.HeightStatusBar, 0, 0); this.HeightRequest = App.HeightNavigationIOS; gridNav.HeightRequest = App.HeightNavigationIOS; // var gestureRecognizer = new TapGestureRecognizer(); gestureRecognizer.Tapped += (sender, e) => FilterCommand?.Execute(sender); filter.GestureRecognizers.Add(gestureRecognizer); // var backGR = new TapGestureRecognizer(); backGR.Tapped += (sender, e) => BackCommand?.Execute(sender); back.GestureRecognizers.Add(backGR); // var searchGR = new TapGestureRecognizer(); searchBar.GestureRecognizers.Add(searchGR); searchBar.BindingContext = this; }
/// <summary> /// add to cart item /// </summary> private void ProcessAddToCartCommand() { try { BaseResponse result = ValidateRequest(SelectedProduct); if (result.Code == 200) { SelectedProduct.CartProductCount = CartProductCount; UpdateDataInCart(SelectedProduct); UserDialogs.Instance.Alert(new AlertConfig { Message = "Product added in cart successfully.", OkText = AppResources.Lbl_OK, OnAction = () => { BackCommand?.Execute(this); } }); } else { UserDialogs.Instance.Alert(new AlertConfig { Message = result.Message, OkText = AppResources.Lbl_OK, OnAction = () => { } }); } } catch (Exception ex) { Mvx.IoCProvider.Resolve <IAppLoader>().StopIndicator(); Mvx.IoCProvider.Resolve <IAppLogger>().DebugLog(nameof(ProductDetailsViewModel), ex); } }
private async void AnalysePhotoAsync() { Guid busyKey = Guid.NewGuid(); SetBusy(busyKey, true); PickedImage targetImage = null; ResetCancellationTokenSource(ref _analysePhotoCancellationTokenSource); CancellationTokenSource cancellationTokenSource = _analysePhotoCancellationTokenSource; try { using (var file = await _pickMediaService.TakePhotoAsync()) { if (file != null) { List <string> results = await _visionService.AnalyzeImageForText(file); if (results != null && results.Any()) { List <string> parsedResult = results.ParseVisionResult(); targetImage = await _pickMediaService.BuildPickedImageAsync(file); if (targetImage != null) { FormDataContent formDataContent = new FormDataContent { Content = parsedResult, MediaContent = targetImage }; List <DriveAuto> driveAutoDetails = await _driveAutoService.SearchDriveAutoByCognitiveAsync(formDataContent, cancellationTokenSource.Token); if (driveAutoDetails != null) { DriveAutoDetails = driveAutoDetails.ToObservableCollection(); HasResult = true; } else { HasResult = false; ErrorMessage = string.Empty; } } } else { HasResult = false; ErrorMessage = ResourceLoader.GetString(nameof(AppStrings.TryMore)).Value; } file.Dispose(); } } } catch (Exception ex) { Debug.WriteLine($"ERROR: -{ex.Message}"); Debugger.Break(); try { HttpRequestExceptionResult httpRequestExceptionResult = JsonConvert.DeserializeObject <HttpRequestExceptionResult>(ex.Message); HasResult = false; ErrorMessage = httpRequestExceptionResult.Message; } catch (Exception exc) { Debug.WriteLine($"ERROR: -{exc.Message}"); Debugger.Break(); BackCommand.Execute(null); } } SetBusy(busyKey, false); if (targetImage == null) { BackCommand.Execute(null); } }
/// <summary> /// 삭제처리 /// </summary> /// <param name="obj"></param> private void OnDelete(object obj) { //0.삭제전 체크 Hashtable param = new Hashtable(); param.Add("sqlId", "selectChscResSubList"); param.Add("sqlId2", "SelectFileMapList"); param.Add("FTR_CDE", Dtl.FTR_CDE); param.Add("FTR_IDN", Dtl.FTR_IDN); param.Add("BIZ_ID", string.Concat(Dtl.FTR_CDE, Dtl.FTR_IDN)); Hashtable result = BizUtil.SelectLists(param); DataTable dt = new DataTable(); DataTable dt2 = new DataTable(); try { dt = result["dt"] as DataTable; if (dt.Rows.Count > 0) { Messages.ShowInfoMsgBox("유지보수내역이 존재합니다."); return; } } catch (Exception) { } // 1.삭제처리 if (Messages.ShowYesNoMsgBox("변류시설를 삭제하시겠습니까?") != MessageBoxResult.Yes) { return; } try { dt2 = result["dt2"] as DataTable; if (dt2.Rows.Count > 0) { //Messages.ShowInfoMsgBox("파일첨부내역이 존재합니다."); //return; //첨부파일삭제 foreach (DataRow row in dt2.Rows) { //a.FIL_SEQ 첨부파일삭제 BizUtil.DelFileSeq(row["FIL_SEQ"]); //b.FILE_MAP 업무파일매핑삭제 param = new Hashtable(); param.Add("sqlId", "DeleteFileMap"); param.Add("BIZ_ID", Dtl.FTR_CDE + Dtl.FTR_IDN); param.Add("FIL_SEQ", row["FIL_SEQ"]); BizUtil.Update(param); } } } catch (Exception) { } try { BizUtil.Update2(Dtl, "deleteValvFacDtl"); } catch (Exception) { Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다."); return; } Messages.ShowOkMsgBox(); BackCommand.Execute(null); }
/// <summary> /// 삭제처리 /// </summary> /// <param name="obj"></param> private void OnDelete(object obj) { //0.삭제전 체크 Hashtable param = new Hashtable(); param.Add("sqlId", "SelectWttCostDtList"); //공사비지급내역 param.Add("sqlId2", "SelectWttChngDtList"); //설계변경내역 param.Add("sqlId3", "SelectWttSubcDtList"); //공사하도급내역 param.Add("sqlId4", "SelectWttFlawDtList"); //하자보수목록 param.Add("sqlId5", "SelectFileMapList"); //첨부파일사진목록 param.Add("CNT_NUM", Dtl.CNT_NUM); param.Add("BIZ_ID", Dtl.CNT_NUM); Hashtable result = BizUtil.SelectLists(param); DataTable dt = new DataTable(); DataTable dt2 = new DataTable(); DataTable dt3 = new DataTable(); DataTable dt4 = new DataTable(); DataTable dt5 = new DataTable(); /* * try * { * dt = result["dt"] as DataTable; * if (dt.Rows.Count > 0) * { * Messages.ShowErrMsgBox("공사비지급내역이 존재합니다."); * //return; * } * } * catch (Exception) { } * try * { * dt2 = result["dt2"] as DataTable; * if (dt2.Rows.Count > 0) * { * Messages.ShowErrMsgBox("설계변경내역이 존재합니다."); * //return; * } * } * catch (Exception) { } * try * { * dt3 = result["dt3"] as DataTable; * if (dt3.Rows.Count > 0) * { * Messages.ShowErrMsgBox("공사하도급내역이 존재합니다."); * //return; * } * } * catch (Exception) { } * try * { * dt4 = result["dt4"] as DataTable; * if (dt3.Rows.Count > 0) * { * Messages.ShowErrMsgBox("하자보수내역이 존재합니다."); * //return; * } * } * catch (Exception) { } * try * { * dt5 = result["dt5"] as DataTable; * if (dt5.Rows.Count > 0) * { * Messages.ShowErrMsgBox("첨부파일/사진 내역이 존재합니다."); * //return; * } * } * catch (Exception) { } */ // 1.삭제처리 if (Messages.ShowYesNoMsgBox("공사대장을 삭제하시겠습니까?") != MessageBoxResult.Yes) { return; } try { //1.공사비지급내역 삭제 param = new Hashtable(); param.Add("sqlId", "DeleteWttCostDt"); param.Add("CNT_NUM", Dtl.CNT_NUM); BizUtil.Update(param); //2.설계변경내역 삭제 param = new Hashtable(); param.Add("sqlId", "DeleteWttChngDt"); param.Add("CNT_NUM", Dtl.CNT_NUM); BizUtil.Update(param); //3.공사하도급내역 삭제 param = new Hashtable(); param.Add("sqlId", "DeleteWttSubcDt"); param.Add("CNT_NUM", Dtl.CNT_NUM); BizUtil.Update(param); //4.하자보수내역 삭제 param = new Hashtable(); param.Add("sqlId", "DeleteWttFlawDt"); param.Add("CNT_NUM", Dtl.CNT_NUM); BizUtil.Update(param); //5.첨부파일,사진삭제 foreach (DataRow row in dt5.Rows) { //a.FIL_SEQ 첨부파일삭제 BizUtil.DelFileSeq(row["FIL_SEQ"]); //b.FILE_MAP 업무파일매핑삭제 param = new Hashtable(); param.Add("sqlId", "DeleteFileMap"); param.Add("BIZ_ID", Dtl.CNT_NUM); param.Add("FIL_SEQ", row["FIL_SEQ"]); BizUtil.Update(param); } //마스터삭제 BizUtil.Update2(Dtl, "deleteCnstMngDtl"); } catch (Exception) { Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다."); return; } Messages.ShowOkMsgBox(); BackCommand.Execute(null); }