Esempio n. 1
0
 private void AccountComboBoxIsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     if (AccountComboBox.IsEnabled)
     {
         AccountComboBox.Focus();
     }
 }
        public AzureManageSubscriptionsDialog SelectManageSubscriptions()
        {
            WaitForInputIdle();

            // <Manage...> is different from other list item, selecting it
            // using SelectItem will throw COMException
            // This is what the cloud service team did in their tests for their
            // combo box special items that bring up dialogs.
            AccountComboBox.ClickItem("<Manage...>");

            return(new AzureManageSubscriptionsDialog(App, AutomationElement.FromHandle(App.WaitForDialogToReplace(Element))));
        }
Esempio n. 3
0
        // Load formular. Loader spilleroversigt
        private void Form1_Load(object sender, EventArgs e)
        {
            wowpath = (string)Registry.GetValue(keyName, "WOW Home Folder", "");
            if (wowpath == "" || !Directory.Exists(wowpath + "\\WTF\\"))
            {
                while (true)
                {
                    var browser = new FolderBrowserDialog
                    {
                        Description = "Mark home folder for WOW (where WTF and Interface is located)"
                    };
                    browser.ShowDialog();
                    wowpath = browser.SelectedPath;
                    if (!Directory.Exists(wowpath + "\\WTF\\"))
                    {
                        MessageBox.Show("The folder WTF was not found in this folder " + wowpath, "Error in input",
                                        MessageBoxButtons.OK);
                    }
                    else
                    {
                        Registry.SetValue(keyName, "WOW Home Folder", wowpath);
                        break;
                    }
                }
            }

            var account     = (string)Registry.GetValue(keyName, "Account", "");
            var fileEntries = Directory.GetDirectories(wowpath + @"\WTF\Account\", "*");

            foreach (var fileName in fileEntries)
            {
                var parts       = fileName.Split('\\');
                var spillernavn = parts[parts.Count() - 1];

                AccountComboBox.Items.Add(spillernavn);
            }

            AccountComboBox.SelectedItem = account;
            AccountComboBox.Focus();
        }
Esempio n. 4
0
        public void UpdateVariables(DataRow aGeneralVoucherDataRow)
        {
            try
            {
                aPurchaseDataRow = aGeneralVoucherDataRow;
                PurchaseVoucherNumTxtBox.Text = aGeneralVoucherDataRow["VoucherNumber"].ToString();
                aVendorDataRow = VendorsMgmt.SelectVendorRowByID(int.Parse(aGeneralVoucherDataRow["VendorID"].ToString()));
                if (aVendorDataRow == null)
                {
                    // MessageBox.Show(MsgTxt.UnexpectedError + "\n IN [EditBill-SelectCustomerRowByID Returned Null] " + MsgTxt.FormWillCloseNowTxt, MsgTxt.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    throw new Exception("EditVoucher-SelectVendorRowByID Returned Null");
                }

                VendorsComboBox.Text         = aVendorDataRow["Name"].ToString();
                VendorDescriptionTxtBox.Text = aVendorDataRow["Company"].ToString();
                //account amount is latered to iscredit
                DateLbl.Text   = DateTime.Parse(aGeneralVoucherDataRow["Date"].ToString()).ToShortDateString();
                TimeLbl.Text   = DateTime.Parse(aGeneralVoucherDataRow["Time"].ToString()).ToShortTimeString();
                TellerLbl.Text = UsersMgmt.SelectUserNameByID(int.Parse(aGeneralVoucherDataRow["TellerID"].ToString()));
                if (TellerLbl.Text == null)
                {
                    //MessageBox.Show(MsgTxt.UnexpectedError + "\n IN [EditBill-UsersMgmt.UsrById Returned Null] " + MsgTxt.FormWillCloseNowTxt, MsgTxt.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    throw new Exception("[EditVoucher-UsersMgmt.UsrById Returned Null]");
                }
                //DOWN RIGHT
                SubtotalTxtBox.Text      = aGeneralVoucherDataRow["Subtotal"].ToString();
                DiscountPercTxtBox.Text  = aGeneralVoucherDataRow["DiscountPerc"].ToString();
                DiscountTxtBox.Text      = (float.Parse(SubtotalTxtBox.Text) * float.Parse(DiscountPercTxtBox.Text) / 100).ToString();
                ItemsDiscountTxtBox.Text = aGeneralVoucherDataRow["TotalItemsDiscount"].ToString();
                TotalDiscountTxtBox.Text = aGeneralVoucherDataRow["TotalDiscount"].ToString();
                TotalTaxTxtBox.Text      = aGeneralVoucherDataRow["TotalTax"].ToString();
                FeesTxtBox.Text          = aGeneralVoucherDataRow["Fees"].ToString();
                TotalTxtBox.Text         = aGeneralVoucherDataRow["TotalCost"].ToString();
                //GroupBox1 Elements
                if (aPurchaseDataRow["IsRevised"].ToString() == "1")
                {
                    ReviseInfoGB.Show();
                    ReviseDatelbl.Text       = DateTime.Parse(aPurchaseDataRow["ReviseDate"].ToString()).ToShortDateString();
                    ReviseTime.Text          = DateTime.Parse(aPurchaseDataRow["ReviseTime"].ToString()).ToShortTimeString();
                    RevisedBylbl.Text        = aPurchaseDataRow["RevisedBy"].ToString();
                    IsRevisedLbl.Visible     = true;
                    ReviseLossProfitLbl.Text = aPurchaseDataRow["ReviseLoss"].ToString();
                }
                else
                {
                    ReviseInfoGB.Hide();
                }

                if (aPurchaseDataRow["IsChecked"].ToString() == "1")
                {
                    ChkedByUserNameLbl.Text = aPurchaseDataRow["CheckedBy"].ToString();

                    ChkDateLbl.Text = DateTime.Parse(aPurchaseDataRow["CheckDate"].ToString()).ToShortDateString();
                    CheckTime.Text  = DateTime.Parse(aPurchaseDataRow["CheckTime"].ToString()).ToShortTimeString();
                    CheckInfoGB.Show();
                }
                else
                {
                    CheckInfoGB.Hide();
                }
                //PaymentInformation
                DataRow aMethodRow = PaymentMethodMgmt.SelectMethodRowByID(int.Parse(aPurchaseDataRow["PaymentMethodID"].ToString()));
                if (aMethodRow == null)
                {
                    // MessageBox.Show(MsgTxt.UnexpectedError + "\n IN [EditBill-SelectMethodRowByID Returned Null] " + MsgTxt.FormWillCloseNowTxt, MsgTxt.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    throw new Exception("EditVoucher-SelectMethodRowByID Returned Null");
                }
                PaymentMethodCheckBox.Text      = aMethodRow["Name"].ToString();
                PaymentMethodDescripTxtBox.Text = aMethodRow["Description"].ToString();//PaymentMethodMgmt.SelectDescriptionByID(int.Parse(PaymentMethodCheckBox.SelectedValue.ToString()));
                if (aMethodRow["IsCash"].ToString() == "1")
                {
                    CashPaymentGB.Show();
                    CashPaymentGB.BringToFront();
                    PayInVisaGB.Hide();
                    CheckGB.Hide();
                }
                else if (aMethodRow["IsCredit"].ToString() == "1")
                {
                    PayInVisaGB.Show();
                    PayInVisaGB.BringToFront();
                    CashPaymentGB.Hide();
                    CheckGB.Hide();
                }
                else
                {
                    CheckGB.Show();
                    CheckGB.BringToFront();
                    CashPaymentGB.Hide();
                    PayInVisaGB.Hide();
                    CheckNumberTxtBox.Text = aPurchaseDataRow["CheckNumber"].ToString();
                    DataRow aCheckDataRow = ChecksMgmt.SelectCheckRowByNumber(int.Parse(aPurchaseDataRow["CheckNumber"].ToString()));
                    if (aCheckDataRow == null)
                    {
                        //MessageBox.Show(MsgTxt.UnexpectedError + "\n IN [EditBill-SelectCheckRowByNumber Returned Null] " + MsgTxt.FormWillCloseNowTxt, MsgTxt.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        throw new Exception("EditVoucher-SelectCheckRowByNumber Returned Null");
                    }
                    HolderNameTxtBox.Text    = aCheckDataRow["HolderName"].ToString();
                    CheckCommentsTxtBox.Text = aCheckDataRow["Comments"].ToString();
                    CheckDatePicker.Text     = aCheckDataRow["PaymentDate"].ToString();
                }
                DataRow aAccountRow = AccountsMgmt.SelectAccountRowByID(int.Parse(aPurchaseDataRow["AccountID"].ToString()));
                if (aAccountRow == null)
                {
                    // MessageBox.Show(MsgTxt.UnexpectedError + "\n IN [EditBill-SelectAccountRowByID Returned Null] " + MsgTxt.FormWillCloseNowTxt, MsgTxt.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    throw new Exception("EditBill-SelectAccountRowByID Returned Null");
                }
                else
                {
                    AccountComboBox.Text          = aAccountRow["Name"].ToString();
                    AccountDescriptionTxtBox.Text = aAccountRow["Description"].ToString();
                    CurrencyComboBox.Text         = CurrencyMgmt.SelectCurrencyNameByID(int.Parse(aAccountRow["CurrencyID"].ToString()));
                    if (CurrencyComboBox.Text == null)
                    {
                        MessageBox.Show(MsgTxt.UnexpectedError + "\n IN [EditVoucher-SelectCurrencyNameByID Returned Null] " + MsgTxt.FormWillCloseNowTxt, MsgTxt.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        this.Close();
                    }
                    CreditCardInfoTxtBox.Text = aPurchaseDataRow["CreditCardInfo"].ToString();
                }
                if (aPurchaseDataRow["IsCashCredit"].ToString() == "1")
                {
                    CashMethodComboBox.SelectedIndex = 1;
                    VendorAccountAmountTxtBox.Show();
                    VendorAccountAmountTxtBox.Text = aPurchaseDataRow["VendorAccountAmountOld"].ToString();
                    AccountComboBox.Hide();
                    AccountLbl.Hide();
                    CashInTxtBox.Hide();
                    ExchangeTxtBox.Hide();
                    CashInLbl.Hide();
                    ExchangeLbl.Hide();
                    JODstatic.Hide();
                    CurrencyLbl.Hide();
                    IsCreditLbl.Show();
                }
                else
                {
                    CashMethodComboBox.SelectedIndex = 0;
                    VendorAccountAmountTxtBox.Hide();
                    AccountComboBox.Show();
                    AccountLbl.Show();
                    CashInTxtBox.Show();
                    ExchangeTxtBox.Show();
                    CashInLbl.Show();
                    ExchangeLbl.Show();
                    JODstatic.Show();
                    CurrencyLbl.Show();
                    IsCreditLbl.Hide();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(MsgTxt.UnexpectedError + "\n IN [EditVoucher-UpdateVariables] \n Exception: \n" + ex.ToString() + "\n" + MsgTxt.FormWillCloseNowTxt, MsgTxt.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }
Esempio n. 5
0
 public void SetAccountComboBoxValue(string value)
 {
     AccountComboBox.SelectByText(value);
 }
Esempio n. 6
0
 public string GetAccountComboBoxValueByIndex(int index)
 {
     return(AccountComboBox.get_Text(index));
 }