Posted by Brad Wed 29th Mar 2006 23:00 - Syntax is C# - 141 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers
Description:
type/namespace Account can not be found Line 26 and 24
Class 'Bankaccountforms.PayInForm' already defines a member called
'deposit_button_Click' with the same parameter types - line 121
type/namespace Account can not be found Line 26 and 24
Class 'Bankaccountforms.PayInForm' already defines a member called
'deposit_button_Click' with the same parameter types - line 121
-
using System;
-
using System.Drawing;
-
using System.Collections;
-
using System.ComponentModel;
-
using System.Windows.Forms;
-
-
namespace Bankaccountforms
-
{
-
///
-
/// Summary description for PayInForm.
-
///
-
public class PayInForm : System.Windows.Forms.Form
-
{
-
private System.Windows.Forms.Label deposit_label;
-
private System.Windows.Forms.TextBox deposit_textBox;
-
private System.Windows.Forms.Button deposit_button;
-
///
-
/// Required designer variable.
-
///
-
-
private System.ComponentModel.Container components = null;
-
-
-
private Account inPayInFunds;
-
-
public void PayInFundsForm( Account inPayInFunds)
-
{
-
//
-
// Required for Windows Form Designer support
-
//
-
InitializeComponent();
-
-
payInFunds = inPayInFunds;
-
AccountNumber.Text = currentAccount.GetAccountNumber();}
-
-
-
-
private void deposit_button_Click(object sender, System.EventArgs e)
-
{
-
editAccount.PayInFunds(decimal.Parse(nameTextBox.Text));
-
{
-
-
//
-
// Required for Windows Form Designer support
-
//
-
-
-
//
-
// TODO: Add any constructor code after InitializeComponent call
-
//
-
}
-
}
-
-
///
-
/// Clean up any resources being used.
-
///
-
protected override void Dispose( bool disposing )
-
{
-
if( disposing )
-
{
-
if(components != null)
-
{
-
components.Dispose();
-
}
-
}
-
base.Dispose( disposing );
-
}
-
-
#region Windows Form Designer generated code
-
///
-
/// Required method for Designer support - do not modify
-
/// the contents of this method with the code editor.
-
///
-
private void InitializeComponent()
-
{
-
this.deposit_label = System.Windows.Forms.Label();
-
this.deposit_textBox = System.Windows.Forms.TextBox();
-
this.deposit_button = System.Windows.Forms.Button();
-
this.SuspendLayout();
-
//
-
// deposit_label
-
//
-
this.deposit_label.Location = System.Drawing.Point(40, 16);
-
this.deposit_label.Name = "deposit_label";
-
this.deposit_label.Size = System.Drawing.Size(208, 40);
-
this.deposit_label.TabIndex = 0;
-
this.deposit_label.Text = "How much would you like to deposit??";
-
this.deposit_label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-
//
-
// deposit_textBox
-
//
-
this.deposit_textBox.Location = System.Drawing.Point(112, 88);
-
this.deposit_textBox.Name = "deposit_textBox";
-
this.deposit_textBox.Size = System.Drawing.Size(56, 20);
-
this.deposit_textBox.TabIndex = 1;
-
this.deposit_textBox.Text = "�0.00";
-
//
-
// deposit_button
-
//
-
this.deposit_button.Location = System.Drawing.Point(96, 160);
-
this.deposit_button.Name = "deposit_button";
-
this.deposit_button.Size = System.Drawing.Size(88, 72);
-
this.deposit_button.TabIndex = 2;
-
this.deposit_button.Text = "Deposit";
-
this.deposit_button.Click += System.EventHandler(this.deposit_button_Click);
-
//
-
// PayInForm
-
//
-
this.AutoScaleBaseSize = System.Drawing.Size(5, 13);
-
this.ClientSize = System.Drawing.Size(292, 273);
-
this.Controls.Add(this.deposit_button);
-
this.Controls.Add(this.deposit_textBox);
-
this.Controls.Add(this.deposit_label);
-
this.Name = "PayInForm";
-
this.Text = "PayInForm";
-
this.ResumeLayout(false);
-
-
}
-
#endregion
-
-
private void deposit_button_Click(object sender, System.EventArgs e)
-
{
-
decimal payIn = 0;
-
bool flag = false;
-
try
-
{
-
string stringPayIn = PayInAmmountOnForm.Text;
-
payIn = decimal.Parse(stringPayIn);
-
flag = true;
-
}
-
catch
-
{
-
flag = false;
-
MessageBox.Show ( "Please enter a value consisting of numbers only" );
-
}
-
if (flag)
-
{
-
if (currentAccount.PayInFunds(payIn))
-
{
-
MessageBox.Show ("Pay in sucessfull" );
-
}
-
else
-
{
-
MessageBox.Show ( "Pay in failed" );
-
}
-
}
-
Close();
-
-
}
-
}
-
}
PermaLink to this entry https://pastebin.co.uk/598
Posted by Brad Wed 29th Mar 2006 23:00 - Syntax is C# - 141 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers