private void BtnWithdraw_Click(object sender, RoutedEventArgs e) { if (decimal.TryParse(TxtAmount.Text, out decimal bedrag)) { try { ActiveAccount.Withdraw(bedrag); } catch (ArgumentException ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } catch (InvalidOperationException ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation); } UpdateGUI(); } else { MessageBox.Show("Invalid amount entered.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); TxtAmount.Focus(); TxtAmount.Select(0, TxtAmount.Text.Length); } }
protected void TxtAmount_TextChanged(object sender, EventArgs e) { try { if (DdlCRDR.SelectedValue == "2") { if (ddlPMTMode.SelectedValue != "3") { double BAL = Convert.ToDouble(TxtBalance.Text.Trim().ToString() == "" ? "0" : TxtBalance.Text.Trim().ToString()); double curbal = Convert.ToDouble(TxtAmount.Text.Trim().ToString() == "" ? "0" : TxtAmount.Text.Trim().ToString()); if ((Convert.ToInt32(ViewState["GlCode"].ToString()) < 100) && Convert.ToInt32(ViewState["GlCode"].ToString()) != 3) { if (curbal > BAL) { lblMessage.Text = "Insufficient Account Balance...!!"; TxtAmount.Text = ""; TxtAmount.Focus(); ModalPopup.Show(this.Page); return; } } } } Submit.Focus(); } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } }
protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { try { if (TxtAmount.Text != "") { double t1 = double.Parse(TxtAmount.Text); if (t1 <= 0.0) { LblError.Visible = true; LblError.Text = "Please enter positive amount of money"; TxtAmount.Focus(); return; } else { getaccount(); } } else { LblError.Visible = true; LblError.Text = "Please Enter Valid Amount"; TxtAmount.Focus(); return; } } catch { } }
/// <summary> /// Insättningar och uttag från valt bankkonto = en transaktion /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnSaveTransaction_Click(object sender, RoutedEventArgs e) { BankAccount selcetedBankAccount = (BankAccount)CboSelectAccount.SelectedItem; decimal amount = decimal.Parse(TxtAmount.Text); if (selcetedBankAccount != null) { if (OptWithdrawal.IsChecked == true) { bool possible = selcetedBankAccount.IsWithdrawPossible(amount); if (possible == false) { MessageBox.Show("Du saknar täckning på kontot"); } } else if (OptDeposit.IsChecked == true) { selcetedBankAccount.Deposit(amount); } TxtAmount.Clear(); } }
protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { try { if (TxtAmount.Text != "" && TxtAmount2.Text != "") { double t1 = double.Parse(TxtAmount.Text); double t2 = double.Parse(TxtAmount2.Text); if (t1 <= 500 && t2 <= 500) { if (t1 == t2) { if (t1 <= 0.0) { LblError.Visible = true; LblError.Text = "Please enter positive amount of money"; TxtAmount.Focus(); return; } if (t2 <= 0.0) { LblError.Visible = true; LblError.Text = "Please enter positive amount of money"; TxtAmount2.Focus(); return; } else { LblError.Visible = false; getaccountamount(); } } else { LblError.Visible = true; LblError.Text = "Please enter same amount"; } } else { LblError.Visible = true; LblError.Text = "Please enter Amount less than or equal to 500$"; } } else { LblError.Visible = true; LblError.Text = "Please enter Amount"; } } catch { } }
/// <summary> /// limpia todos los valores que esta en el formulario para su luego añadido correspondiente /// </summary> private void clearValue() { TxtAmount.Clear(); TxtCodPaquete.Clear(); TxtCodProduct.Clear(); TxtPriceSale.Clear(); TxtQuality.Clear(); }
private void TxtAmount_TextChanged(object sender, TextChangedEventArgs e) { if (decimal.TryParse(TxtAmount.Text.Replace(",", "").Replace(".", "").TrimStart('0'), out decimal result)) { result /= 100; amount = result; TxtAmount.TextChanged -= TxtAmount_TextChanged; TxtAmount.Text = result.ToString("N2", nfi); TxtAmount.TextChanged += TxtAmount_TextChanged; TxtAmount.Select(TxtAmount.Text.Length, 0); } }
private void FrmAddTel_Load(object sender, EventArgs e) { telNoTableAdapter.Fill(auditorDataSet.TelNo); locationTableAdapter.Fill(auditorDataSet.Location); ComboLocation.SelectedIndex = -1; ComboTelNo.SelectedIndex = -1; TxtAmount.Clear(); TxtStamp.Clear(); TxtSellTax.Clear(); TxtPercentage.Text = @"2"; ComboStatus.SelectedIndex = 0; MathOperations.NetAmount(TxtAmount, TxtSellTax, TxtStamp, TxtTotalDiscount, TxtNetAmount, TxtPercentage, TxtTax, TxtPaidAmount); BtnSave.Enabled = false; }
protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { try { try { if (TxtAmount.Text == "") { LblError.Visible = true; LblError.Text = "Please enter amount in digits/Numbers"; TxtAmount.Focus(); return; } if (TxtAmount.Text != "") { t1 = double.Parse(TxtAmount.Text); if (t1 <= 0.0) { LblError.Visible = true; LblError.Text = "Please enter Valid amount of money"; TxtAmount.Focus(); return; } } } catch { LblError.Visible = true; LblError.Text = "Please enter amount in digits/Numbers"; return; } getaccountamount(); TxtAmount.Text = ""; } catch (Exception ex) { Response.Write(ex.Message); } finally { cn.Close(); } }
private void BtnSaveClick(object sender, EventArgs e) { var objAddCheque = new VmAddCheque(); if (TxtChequeNumber.Text == "" || string.IsNullOrEmpty(TxtChequeNumber.Text)) { LblMessageFaliure.Text = "Please Enter Cheque Number"; TxtChequeNumber.Focus(); return; } if (TxtGivenTo.Text == "" || string.IsNullOrEmpty(TxtGivenTo.Text)) { LblMessageFaliure.Text = "Please Enter the Name of the Person whom you gave this Cheque"; TxtGivenTo.Focus(); return; } if (TxtGivenDate.Text == "" || string.IsNullOrEmpty(TxtGivenDate.Text)) { LblMessageFaliure.Text = "Please Select Cheque Issued date"; TxtGivenDate.Focus(); return; } if (TxtValidUpto.Text == "" || string.IsNullOrEmpty(TxtValidUpto.Text)) { LblMessageFaliure.Text = "Please Select Cheque Expiry date"; TxtValidUpto.Focus(); return; } if (TxtAmount.Text == "" || string.IsNullOrEmpty(TxtAmount.Text)) { LblMessageFaliure.Text = "Please Fill the Cheque Amount"; TxtAmount.Focus(); return; } objAddCheque.Mode = "INSERT"; objAddCheque.ChequeNumber = TxtChequeNumber.Text; objAddCheque.GivenTo = TxtGivenTo.Text; objAddCheque.GivenDate = TxtGivenDate.Text; objAddCheque.ValidUpto = TxtValidUpto.Text; objAddCheque.Amount = Convert.ToDecimal(TxtAmount.Text); objAddCheque.Notes = RtfNotes.Text; SaveDatas(objAddCheque); }
partial void AmountDoneClicked(Foundation.NSObject sender) { TxtAmount.EndEditing(true); }
private void button1_Click(object sender, EventArgs e) { if (CmbRegion.Items.Count <= 0 || Convert.ToInt32(db.ExtractCode(CmbRegion.Text)) <= 0) { MessageBox.Show("Invalid Region Name", "Hindudharmam Magazine", MessageBoxButtons.OK, MessageBoxIcon.Error); CmbRegion.Focus(); return; } if (CmbParty.Items.Count <= 0 || Convert.ToInt32(db.ExtractCode(CmbParty.Text)) <= 0) { MessageBox.Show("Invalid Party Name", "Hindudharmam Magazine", MessageBoxButtons.OK, MessageBoxIcon.Error); CmbParty.Focus(); return; } if (CmbPayMode.Items.Count <= 0 || Convert.ToInt32(db.ExtractCode(CmbPayMode.Text)) <= 0) { MessageBox.Show("Invalid Payment Mode", "Hindudharmam Magazine", MessageBoxButtons.OK, MessageBoxIcon.Error); CmbPayMode.Focus(); return; } if (CmbBank.Items.Count <= 0 || Convert.ToInt32(db.ExtractCode(CmbBank.Text)) <= 0) { MessageBox.Show("Invalid Bank Name", "Hindudharmam Magazine", MessageBoxButtons.OK, MessageBoxIcon.Error); CmbBank.Focus(); return; } if (TxtAmount.Text.Length <= 0) { MessageBox.Show("Invalid Receipt Amount", "Hindudharmam Magazine", MessageBoxButtons.OK, MessageBoxIcon.Error); TxtAmount.Focus(); return; } if (Convert.ToDouble(TxtAmount.Text) <= 0) { MessageBox.Show("Invalid Receipt Amount", "Hindudharmam Magazine", MessageBoxButtons.OK, MessageBoxIcon.Error); TxtAmount.Focus(); return; } string rcptno = db.GetAccCode("RC", "mas_acc_receipt", "Receipt_code", DtpRcptDt.Value); string[] res = db.ExecuteQueries("Insert into mas_acc_receipt values ('" + rcptno + "','" + DtpRcptDt.Value.ToString("dd-MMM-yyyy") + "','" + db.GetFinYr(DtpRcptDt.Value) + "'," + db.ExtractCode(CmbPartyType.Text) + "," + db.ExtractCode(CmbRegion.Text) + "," + db.ExtractCode(CmbParty.Text) + "," + TxtAmount.Text.Trim() + "," + db.ExtractCode(CmbPayMode.Text) + ",'" + TxtRefNo.Text.Trim() + "','" + DtpRefDt.Value.ToString("dd-MMM-yyyy") + "'," + db.ExtractCode(CmbBank.Text) + ",'" + TxtRemarks.Text.Trim() + "','" + GlobalClass.UserName + "',sysdate, null, null, 'I')").Split(','); if (res[0].ToString() != "0") { MessageBox.Show("Insertion Failure..\n" + res[1].ToString(), "Hindudharmam Magazine", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } res = db.ExecuteQueries("Insert into mas_acc_reconcillation values (" + db.GetNewID("mas_acc_reconcillation", "recon_code") + ",'" + DtpRcptDt.Value.ToString("dd-MMM-yyyy") + "','" + db.GetFinYr(DtpRcptDt.Value) + "'," + db.ExtractCode(CmbPartyType.Text) + "," + db.ExtractCode(CmbParty.Text) + "," + db.ExtractCode(CmbRegion.Text) + ",'" + rcptno + "','" + DtpRcptDt.Value.ToString("dd-MMM-yyyy") + "','R'," + TxtAmount.Text.Trim() + ",null,null,'" + GlobalClass.UserName + "',sysdate, null, null, 'I')").Split(','); if (res[0].ToString() != "0") { MessageBox.Show("Insertion Failure..\n" + res[1].ToString(), "Hindudharmam Magazine", MessageBoxButtons.OK, MessageBoxIcon.Error); db.ExecuteQueries("Delete from mas_acc_receipt where receipt_code='" + rcptno + "'"); return; } MessageBox.Show("Successfully Saved with Receipt No. " + rcptno, "Hindudharmam Magazine", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtAmount.Text = ""; TxtRcptCode.Text = db.GetAccCode("RC", "mas_acc_receipt", "Receipt_code", DtpRcptDt.Value); TxtRefNo.Text = ""; TxtRemarks.Text = ""; }
void ReleaseDesignerOutlets() { if (AmountDoneBar != null) { AmountDoneBar.Dispose(); AmountDoneBar = null; } if (AmountDoneBtn != null) { AmountDoneBtn.Dispose(); AmountDoneBtn = null; } if (BtnCancel != null) { BtnCancel.Dispose(); BtnCancel = null; } if (BtnClose != null) { BtnClose.Dispose(); BtnClose = null; } if (BtnDelete != null) { BtnDelete.Dispose(); BtnDelete = null; } if (BtnOk != null) { BtnOk.Dispose(); BtnOk = null; } if (BtnRevenueDone != null) { BtnRevenueDone.Dispose(); BtnRevenueDone = null; } if (BtnTaxDone != null) { BtnTaxDone.Dispose(); BtnTaxDone = null; } if (LblAmount != null) { LblAmount.Dispose(); LblAmount = null; } if (LblDescription != null) { LblDescription.Dispose(); LblDescription = null; } if (LblRevenue != null) { LblRevenue.Dispose(); LblRevenue = null; } if (LblTaxType != null) { LblTaxType.Dispose(); LblTaxType = null; } if (LblTitle != null) { LblTitle.Dispose(); LblTitle = null; } if (LblVat != null) { LblVat.Dispose(); LblVat = null; } if (RevenueDoneBar != null) { RevenueDoneBar.Dispose(); RevenueDoneBar = null; } if (RevenuePicker != null) { RevenuePicker.Dispose(); RevenuePicker = null; } if (ScrollVw != null) { ScrollVw.Dispose(); ScrollVw = null; } if (TaxtTypePicker != null) { TaxtTypePicker.Dispose(); TaxtTypePicker = null; } if (TaxTypeDoneBar != null) { TaxTypeDoneBar.Dispose(); TaxTypeDoneBar = null; } if (TxtAmount != null) { TxtAmount.Dispose(); TxtAmount = null; } if (TxtDescription != null) { TxtDescription.Dispose(); TxtDescription = null; } if (TxtRevenue != null) { TxtRevenue.Dispose(); TxtRevenue = null; } if (TxtTaxType != null) { TxtTaxType.Dispose(); TxtTaxType = null; } if (TxtVat != null) { TxtVat.Dispose(); TxtVat = null; } }