private void ShowYesNoDialog()
        {
            YesNoDialogViewModel dialog = new YesNoDialogViewModel("JaOfNeen", "Klik ja of neen");
            DialogResults        result = _dialogService.OpenDialog(dialog);

            Debug.WriteLine(result);
        }
Esempio n. 2
0
        void dowork()
        {
            string value = string.Empty;

            strtoken = string.Empty;


            Token.dotoken();

            if (DialogResults.InputBox(@"OTP", string.Format("Kindly enter the token to Authorize this transaction.", $"********{Program.Userphone.Substring(7)}"), ref value) == DialogResult.OK)
            {
                if (Token.tokenInsertValidation(Program.UserID, Program.ApplicationCode, value.ToString(), true, string.Format("{0}", this.groupControl1.Text.Trim())))
                //if (validatetoken(value.ToString()))
                {
                    Processwork();
                    sbnUpdate.Enabled = true;
                }
                else
                {
                    ////false
                    ////dowork();
                    sbnUpdate.Enabled = true;
                    //BtnToken_Click(null, null);
                }
            }
            //}
            //else
            //    dowork();
        }
        private void ShowAlert()
        {
            AlertDialogViewModel dialog = new AlertDialogViewModel("Opgelet", "Waarschuwing!");
            DialogResults        result = _dialogService.OpenDialog(dialog);

            Debug.WriteLine(result);
        }
Esempio n. 4
0
        private void SbnDisapprove_Click(object sender, EventArgs e)
        {
            string value = string.Empty;

            if (DialogResults.InputBox(@"Comments for Disapproving ", "Ministry Disapproval", ref value) == DialogResult.OK)
            {
                if (!string.IsNullOrWhiteSpace(value))
                {
                    for (int i = 0; i < selection.SelectedCount; i++)
                    {
                        tableTrans.Rows.Add(new object[] { (selection.GetSelectedRow(i) as DataRowView)["Period"], (selection.GetSelectedRow(i) as DataRowView)["Narriation"], Convert.ToInt32((selection.GetSelectedRow(i) as DataRowView)["BankAccountID"]), Convert.ToInt32((selection.GetSelectedRow(i) as DataRowView)["SummaryID"]), Convert.ToInt32((selection.GetSelectedRow(i) as DataRowView)["FinancialperiodID"]), (selection.GetSelectedRow(i) as DataRowView)["AgencyCode"], (selection.GetSelectedRow(i) as DataRowView)["RevenueCode"],
                                                           (selection.GetSelectedRow(i) as DataRowView)["Description"], (selection.GetSelectedRow(i) as DataRowView)["AgencyName"], Convert.ToDecimal((selection.GetSelectedRow(i) as DataRowView)["Amount"]) });
                    }

                    using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                    {
                        connect.Open();
                        _command = new SqlCommand("Reconciliation.DisapprovalMinistrySummary", connect)
                        {
                            CommandType = CommandType.StoredProcedure
                        };

                        _command.Parameters.Add(new SqlParameter("@pTransactiondb", SqlDbType.Structured)).Value = tableTrans;
                        _command.Parameters.Add(new SqlParameter("@Userid", SqlDbType.VarChar)).Value            = Program.UserID;
                        _command.Parameters.Add(new SqlParameter("@comment", SqlDbType.VarChar)).Value           = value;
                        _command.CommandTimeout = 0;

                        using (System.Data.DataSet ds = new System.Data.DataSet())
                        {
                            ds.Clear();
                            adp = new SqlDataAdapter(_command);
                            adp.Fill(ds);
                            connect.Close();

                            if (ds.Tables[0].Rows[0]["returnCode"].ToString() != "00")
                            {
                                Common.setMessageBox(ds.Tables[0].Rows[0]["returnMessage"].ToString(), Program.ApplicationName, 2);

                                return;
                            }
                            else
                            {
                                Common.setMessageBox(ds.Tables[0].Rows[0]["returnMessage"].ToString(), Program.ApplicationName, 2);

                                //FrmReportPosting report = new FrmReportPosting(ds.Tables[1], ds.Tables[2]);
                                //using (FrmReportPosting frmreport = new FrmReportPosting(ds))
                            }
                        }
                    }
                }
                else
                {
                    Common.setMessageBox("Disapproval Comment is Empty", "Ministry Disapproval", 3);

                    return;
                }
                setReload();
            }
        }
Esempio n. 5
0
        public void CloseDialogWithResult(IDialogWindow dialog, DialogResults result)
        {
            DialogResult = result;

            if (dialog != null)
            {
                dialog.DialogResult = true;     // Closes the Window if it was a WPF Window
            }
        }
Esempio n. 6
0
        public static void InitializeOkCancelDialog(RegionViewModel dialogViewModel, DialogResults buttonResult)
        {
            var dialogResult  = new NestedDialogResults <RegionViewModel>(dialogViewModel, buttonResult);
            var dialogService = Substitute.For <INestedViewDialog <RegionViewModel> >();

            dialogService.Show(Arg.Any <NestedViewModel <RegionViewModel> >()).Returns(dialogResult);

            CrudDialogProvider.AddDialog <RegionViewModel>(dialogService);
        }
 private void CancelCommandBinding_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     try
     {
         this._DialogResult = DialogResults.Cancel;
         this.Close();
     }
     catch { }
 }
 private void YesCommandBinding_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     try
     {
         this._DialogResult = DialogResults.Yes;
         this.DialogResult  = true;
     }
     catch { }
 }
 private void NoCommandBinding_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     try
     {
         this._DialogResult = DialogResults.No;
         this.DialogResult  = false;
     }
     catch { }
 }
Esempio n. 10
0
        /// <summary>
        /// Gets the result of the <see cref="Dialog"/> async.
        /// </summary>
        /// <returns>A <see cref="Task{DialogResults}"/> containing the result of the <see cref="Dialog"/>.</returns>
        public virtual async Task <DialogResults> Result()
        {
            _Result = DialogResults.DialogNone;

            while (_Result == DialogResults.DialogNone)
            {
                await Task.Delay(DIALOG_TASK_DELAY);
            }

            return(_Result);
        }
Esempio n. 11
0
        public static void InitializeYesNoDialog(DialogResults dialogResult)
        {
            var result = new LulDialogResult()
            {
                DialogResult = dialogResult
            };
            var dialogService = Substitute.For <IDialogService <MessageBoxDialog, LulDialogResult> >();

            dialogService.Show(Arg.Any <string>(), Arg.Any <string>(), DialogButtons.YesNo).Returns(result);

            var messanger = new MessageBoxProvider(dialogService);
        }
Esempio n. 12
0
        public static void InitializeInputDialog(string inputResult, DialogResults buttonResults)
        {
            InputDialogResult result = new InputDialogResult()
            {
                Input        = inputResult,
                DialogResult = buttonResults
            };

            var dialogService = Substitute.For <IDialogService <InputDialog, InputDialogResult> >();

            dialogService.Show(Arg.Any <string>(), Arg.Any <string>(), DialogButtons.OkCancel).Returns(result);

            var dialog = new InputDialogProvider(dialogService);
        }
        private void ShowBrouwerDetailsDialog()
        {
            DialogViewModelBase <DialogResults> dialog;

            if (BrouwersVM.SelectedBrouwer != null)
            {
                dialog = new BrouwerDetailsDialogViewModel("Brouwer Details", BrouwersVM.SelectedBrouwer);
            }
            else
            {
                dialog = new AlertDialogViewModel("Brouwer Details", "Selecteer een Brouwer aub!");
            }
            DialogResults result = _dialogService.OpenDialog(dialog);

            Debug.WriteLine(result);
        }
Esempio n. 14
0
        private void VerwijderBrouwer()
        {
            //Vraag bevestiging om bier te verwijderen via YesNo Dialoogvenster
            YesNoDialogViewModel dialog = new YesNoDialogViewModel("Verwijderen Brouwer", $"Bent u zeker dat u Brouwer '{SelectedBrouwer.BrNaam}' wilt verwijderen?");

            DialogResults result = _dialogService.OpenDialog(dialog);

            Debug.WriteLine(result);
            if (result == DialogResults.Yes)
            {
                Brouwers = new ObservableCollection <Brouwer>(_dataService.VerwijderBrouwer(SelectedBrouwer));
                if (_brouwers.Count > 0)
                {
                    SelectedBrouwer = _brouwers[0];
                }
            }
        }
Esempio n. 15
0
        //private void BrowseImage()
        //{
        //    var filepad = _fileDialog.OpenFile("Image Files (*.gif;*.png;*.jpg)|*.gif;*.png;*.jpg");
        //    if (filepad != null)
        //    {

        //        string appPath = Environment.CurrentDirectory;
        //        FileInfo fileInfo = new FileInfo(filepad);
        //        string filename = fileInfo.Name;
        //        string destPath = Path.Combine(appPath + "\\Images", filename);
        //        if(!File.Exists(destPath)) File.Copy(filepad, destPath);
        //        SelectedBier.ImagePad = filename;
        //    }
        //}
        private void VerwijderBier()
        {
            //Vraag bevestiging om bier te verwijderen via YesNo Dialoogvenster
            YesNoDialogViewModel dialog = new YesNoDialogViewModel("Verwijderen Bier", $"Bent u zeker dat u Bier '{SelectedBier.Naam}' wilt verwijderen?");

            DialogResults result = _dialogService.OpenDialog(dialog);

            Debug.WriteLine(result);
            if (result == DialogResults.Yes)
            {
                // Bieren = new ObservableCollection<Bier>(ObjectConverter.BO_BierenToBieren(_dataService.VerwijderBier(ObjectConverter.BierToBO_Bier(SelectedBier))));
                Bieren = new ObservableCollection <Bier>(_mapper.Map <List <Bier> >(_dataService.VerwijderBier(_mapper.Map <BO_Bier>(SelectedBier))));
                if (_bieren.Count > 0)
                {
                    SelectedBier = _bieren[0];
                }
            }
        }
Esempio n. 16
0
        void dowork()
        {
            string value = string.Empty;

            strtoken = string.Empty;

            if (!Token.dotoken())
            {
                if (Program.loginid == 0)
                {
                    return;
                }
            }

            //if (Token.dotoken())
            //{
            string strtime = dt.ToString("mm");

            if (DialogResults.InputBox(@"OTP", string.Format("Kindly enter the token to Authorize this transaction.", $"********{Program.Userphone.Substring(7)}"), ref value) == DialogResult.OK)
            {
                if (Token.tokenInsertValidation(Program.UserID, Program.ApplicationCode, value.ToString(), true, string.Format("{0}..{1}..{2}...{3}..{4}", this.groupControl1.Text.Trim(), sValue2, sValue4, sValue3, postrequested)))
                //if (Token.validatetoken(value.ToString()))
                {
                    processApprove();
                    btnApprove.Enabled = true;
                }
                else
                {
                    ////false
                    //dowork();
                    btnApprove.Enabled = true;
                    //BtnToken_Click(null, null);
                }
            }
            //}
            //else
            //    dowork();

            //}

            //if (dotoken())
            //{
        }
Esempio n. 17
0
        //private void SbnDisapprove_Click(object sender, EventArgs e)
        //{
        //    string value = string.Empty;

        //    if (DialogResults.InputBox(@"Comments for Disapproving ", "Reclassification", ref value) == DialogResult.OK)
        //    {
        //        //value = String.Format("{0:N2}", Convert.ToDecimal(value));

        //        if (!string.IsNullOrWhiteSpace(value))
        //        {
        //            if (string.IsNullOrEmpty(selection.SelectedCount.ToString()) || selection.SelectedCount == 0)
        //            {
        //                Common.setMessageBox("No Record selected", "Reclassification", 1); return;
        //            }
        //            else
        //            {
        //                for (int i = 0; i < selection.SelectedCount; i++)
        //                {
        //    tableTrans.Rows.Add(new object[] { (selection.GetSelectedRow(i) as DataRowView)["ID"], (selection.GetSelectedRow(i) as DataRowView)["BSID"], (selection.GetSelectedRow(i) as DataRowView)["TransID"]
        //});
        //                }

        //                using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
        //                {
        //                    connect.Open();
        //                    _command = new SqlCommand("doReclassifiedRequestDisapproved", connect) { CommandType = CommandType.StoredProcedure };
        //                    _command.Parameters.Add(new SqlParameter("@pTransaction", SqlDbType.Structured)).Value = tableTrans;
        //                    _command.Parameters.Add(new SqlParameter("@userid", SqlDbType.VarChar)).Value = Program.UserID;
        //                    _command.Parameters.Add(new SqlParameter("@comment", SqlDbType.VarChar)).Value = value;

        //                    using (System.Data.DataSet ds = new System.Data.DataSet())
        //                    {
        //                        ds.Clear();
        //                        adp = new SqlDataAdapter(_command);
        //                        adp.Fill(ds);
        //                        connect.Close();

        //                        if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "00")
        //                        {
        //                            Common.setMessageBox(ds.Tables[0].Rows[0]["returnMessage"].ToString(), Program.ApplicationName, 2);
        //                            setReload();
        //                            return;
        //                        }
        //                        else
        //                        {
        //                            Tripous.Sys.ErrorBox(String.Format("{0}", ds.Tables[0].Rows[0]["returnMessage"].ToString()));
        //                            return;
        //                        }
        //                    }

        //                }
        //            }

        //        }
        //        else
        //        {
        //            Common.setMessageBox("Disapproval Comment is Empty", "Reclassification", 3);

        //            return;
        //        }
        //    }
        //}

        void dowork()
        {
            string value = string.Empty;

            strtoken = string.Empty;

            if (DialogResults.InputBox(@"OTP", string.Format("Kindly enter the token to Authorize this transaction.", $"********{Program.Userphone.Substring(7)}"), ref value) == DialogResult.OK)
            {
                if (validatetoken(value.ToString()))
                {
                    Processwork();
                    sbnUpdate.Enabled = false;
                }
                else
                {
                    sbnUpdate.Enabled = false;
                    BtnToken_Click(null, null);
                }
            }
        }
Esempio n. 18
0
        private void SbnDisapprove_Click(object sender, EventArgs e)
        {
            string value = string.Empty;

            if (DialogResults.InputBox(@"Comments for Disapproving ", "Reclassification", ref value) == DialogResult.OK)
            {
                //value = String.Format("{0:N2}", Convert.ToDecimal(value));

                if (!string.IsNullOrWhiteSpace(value))
                {
                    if (string.IsNullOrEmpty(selection.SelectedCount.ToString()) || selection.SelectedCount == 0)
                    {
                        Common.setMessageBox("No Record selected", "Receipt Reprint Approval", 1); return;
                    }
                    else
                    {
                        for (int i = 0; i < selection.SelectedCount; i++)
                        {
                            //tableTrans.Rows.Add(new object[] { (selection.GetSelectedRow(i) as DataRowView)["ID"], (selection.GetSelectedRow(i) as DataRowView)["BSID"], (selection.GetSelectedRow(i) as DataRowView)["TransID"] });

                            //DELETE FROM Receipt.tblReprintedReceipts WHERE PaymentRefNumber
                            string query1 = string.Format("DELETE FROM Receipt.tblReprintedReceipts WHERE PaymentRefNumber='{0}'", String.Format("{0}", (selection.GetSelectedRow(i) as DataRowView)["PaymentRefNumber"]));

                            using (SqlConnection db = new SqlConnection(Logic.ConnectionString))
                            {
                                SqlTransaction transaction;

                                db.Open();

                                transaction = db.BeginTransaction();
                                try
                                {
                                    //string query1 = String.Format("UPDATE Receipt.tblReprintedReceipts SET FirstApprovalStatus=1,FirstApprovalBy = '{0}', FirstApprovalDate = '{1}' WHERE PaymentRefNumber IN('{2}')", Program.UserName, string.Format("{ 0:yyyy / MM / dd hh: mm: ss}", DateTime.Now), String.Format("{0}", (selection.GetSelectedRow(i) as DataRowView)["PaymentRefNumber"]));

                                    using (SqlCommand sqlCommand = new SqlCommand(query1, db, transaction))
                                    {
                                        sqlCommand.ExecuteNonQuery();
                                    }
                                }
                                catch (Exception ex)
                                {
                                    transaction.Rollback();
                                    Tripous.Sys.ErrorBox(ex);
                                    return;
                                }
                                transaction.Commit();

                                db.Close();
                            }
                        }
                        Common.setMessageBox("Receipt Reprint Approval disapprove ", "Receipt Reprint Approval", 3);
                        setReload(); return;
                    }
                }
                else
                {
                    Common.setMessageBox("Disapproval Comment is Empty", "Receipt Reprint Approval", 3);
                    setReload();
                    return;
                }
            }
        }
Esempio n. 19
0
        void btnDisapprove_Click(object sender, EventArgs e)
        {
            string value = string.Empty;

            if (DialogResults.InputBox(@"Comments for Disapproving ", "Transscation Disapproval", ref value) == DialogResult.OK)
            {
                //value = String.Format("{0:N2}", Convert.ToDecimal(value));

                if (!string.IsNullOrWhiteSpace(value))
                {
                    using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                    {
                        connect.Open();
                        _command = new SqlCommand("doTransactionDisapproval", connect)
                        {
                            CommandType = CommandType.StoredProcedure
                        };
                        _command.Parameters.Add(new SqlParameter("@userid", SqlDbType.VarChar)).Value       = Program.UserID;
                        _command.Parameters.Add(new SqlParameter("@UserComment", SqlDbType.VarChar)).Value  = value;
                        _command.Parameters.Add(new SqlParameter("@PostingRequestID", SqlDbType.Int)).Value = Convert.ToInt32(postrequested);

                        //@Years
                        using (System.Data.DataSet ds = new System.Data.DataSet())
                        {
                            ds.Clear();
                            adp = new SqlDataAdapter(_command);
                            adp.Fill(ds);
                            connect.Close();

                            if (ds.Tables[0].Rows[0]["returnCode"].ToString() != "00")
                            {
                                Common.setMessageBox(ds.Tables[0].Rows[0]["returnMessage"].ToString(), Program.ApplicationName, 2);

                                return;
                            }
                            else
                            {
                                Common.setMessageBox(ds.Tables[0].Rows[0]["returnMessage"].ToString(), Program.ApplicationName, 2);
                                //return;
                            }
                        }
                    }
                }
                else
                {
                    Common.setMessageBox("Disapproval Comment is Empty", "Transscation Disapproval", 3);

                    return;
                }
            }

            setDBComboBoxRev(); documentViewer1.DocumentSource = null;
            //    using (SqlConnection db = new SqlConnection(Logic.ConnectionString))
            //{
            //    SqlTransaction transaction;

            //    db.Open();

            //    transaction = db.BeginTransaction();

            //    try
            //    {
            //        using (SqlCommand sqlCommand1 = new SqlCommand(string.Format("update Reconciliation.tblTransactionPostingRequest set IsApproved=0 where BankShortCode='{0}' and BatchCode='{1}'", sValue.Trim(), sValue1.Trim()), db, transaction))
            //        {
            //            sqlCommand1.ExecuteNonQuery();
            //        }

            //        transaction.Commit();
            //    }
            //    catch (Exception ex)
            //    {
            //        transaction.Rollback();
            //        Tripous.Sys.ErrorBox(ex);
            //    }

            //    db.Close();



            //    return;
            //}
        }
Esempio n. 20
0
        private void SbnDisapprove_Click(object sender, EventArgs e)
        {
            string value = string.Empty;

            if (DialogResults.InputBox(@"Comments for Disapproving ", "Reclassification", ref value) == DialogResult.OK)
            {
                //value = String.Format("{0:N2}", Convert.ToDecimal(value));

                if (!string.IsNullOrWhiteSpace(value))
                {
                    if (string.IsNullOrEmpty(selection.SelectedCount.ToString()) || selection.SelectedCount == 0)
                    {
                        Common.setMessageBox("No Record selected", "Reclassification", 1); return;
                    }
                    else
                    {
                        for (int i = 0; i < selection.SelectedCount; i++)
                        {
                            tableTrans.Rows.Add(new object[] { (selection.GetSelectedRow(i) as DataRowView)["ID"], (selection.GetSelectedRow(i) as DataRowView)["BSID"], (selection.GetSelectedRow(i) as DataRowView)["TransID"] });
                        }

                        using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                        {
                            connect.Open();
                            _command = new SqlCommand("doReclassifiedRequestDisapproved", connect)
                            {
                                CommandType = CommandType.StoredProcedure
                            };
                            _command.Parameters.Add(new SqlParameter("@pTransaction", SqlDbType.Structured)).Value = tableTrans;
                            _command.Parameters.Add(new SqlParameter("@userid", SqlDbType.VarChar)).Value          = Program.UserID;
                            _command.Parameters.Add(new SqlParameter("@comment", SqlDbType.VarChar)).Value         = value;

                            using (System.Data.DataSet ds = new System.Data.DataSet())
                            {
                                ds.Clear();
                                adp = new SqlDataAdapter(_command);
                                adp.Fill(ds);
                                connect.Close();

                                if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                                {
                                    Common.setMessageBox(ds.Tables[0].Rows[0]["returnMessage"].ToString(), Program.ApplicationName, 2);
                                    setReload();
                                    return;
                                }
                                else
                                {
                                    Tripous.Sys.ErrorBox(String.Format("{0}", ds.Tables[0].Rows[0]["returnMessage"].ToString()));
                                    return;
                                }
                            }
                        }
                    }
                }
                else
                {
                    Common.setMessageBox("Disapproval Comment is Empty", "Reclassification", 3);

                    return;
                }
            }
        }
Esempio n. 21
0
        private void onSetResultExecuted(Object parameter)
        {
            DialogResults result = (DialogResults)parameter;

            Result = result;
        }
Esempio n. 22
0
 public DialogViewModelBase(String title)
 {
     Title            = title;
     SetResultCommand = new RelayCommand(onSetResultExecuted, onSetResultCanExecute);
     m_Result         = DialogResults.NotSet;
 }
 public DialogViewModelBase(String title)
 {
     Title = title;
     SetResultCommand = new RelayCommand(onSetResultExecuted, onSetResultCanExecute);
     m_Result = DialogResults.NotSet;
 }
Esempio n. 24
0
 public void setResponse(DialogResults res)
 {
     response = res;
 }
Esempio n. 25
0
 private void btnOk_Click(object sender, RoutedEventArgs e)
 {
     DialogResult = DialogResults.Ok;
     Hide();
 }
Esempio n. 26
0
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     DialogResult = DialogResults.Cancel;
     Hide();
 }
Esempio n. 27
0
 public NestedDialogResults(TNestedType innerItem, DialogResults dialogResults)
 {
     DialogResult = dialogResults;
     InnerResults = innerItem;
 }
 private void CloseDialog(DialogResults dialogResults)
 {
     DialogResult = dialogResults;
     Close();
 }
Esempio n. 29
0
 private void Button_btnCancel(object sender, RoutedEventArgs e)
 {
     DialogResult = DialogResults.Cancel;
     Close();
 }
Esempio n. 30
0
 private void Button_btnOk(object sender, RoutedEventArgs e)
 {
     DialogResult = DialogResults.Ok;
     Close();
 }
Esempio n. 31
0
 /// <summary>
 /// Creates and initializes a new <see cref="DialogEventArgs"/> instance.
 /// </summary>
 /// <param name="result">A <see cref="DialogResults"/> to associate with the event.</param>
 public DialogEventArgs(DialogResults result = DialogResults.DialogOK)
 {
     Result = result;
 }