private void enter_Click(object sender, EventArgs e)
        {
            if (txtAmount.Text == "")
            {
                txtAmount.Focus();
                return;
            }

            int Amount = Convert.ToInt32(txtAmount.Text);

            txtAmount.Text = "";

            DAL.User u = new DAL.User();
            Amount = (Int32)Money + Amount;

            u.Id      = User_Id;
            u.Balance = Amount;
            if (u.Update())
            {
                MessageBox.Show("Account info Updated!");
            }
            else
            {
                MessageBox.Show(u.Error);
            }
        }
Beispiel #2
0
        private void enter_Click(object sender, EventArgs e)
        {
            int er = 0;

            ep.Clear();

            if (txtAmount.Text == "")
            {
                txtAmount.Focus();
                return;
            }
            if (cmbAccountNumber.SelectedValue == null || cmbAccountNumber.SelectedValue.ToString() == "")
            {
                er++;
                ep.SetError(cmbAccountNumber, "Required");
            }

            if (er > 0)
            {
                return;
            }

            int Amount = Convert.ToInt32(txtAmount.Text);

            txtAmount.Text = "";
            if (Amount > (Int32)Money)
            {
                txtAmount.Text = "";
                txtInfo.Text   = "Insufficient Balance!";
            }
            if (Amount < 100)
            {
                txtAmount.Text = "";
                txtInfo.Text   = "Transaction isn't possible!";
            }
            if (Amount <= (Int32)Money && Amount >= 100)
            {
                DAL.User user = new DAL.User();
                DAL.User u    = new DAL.User();

                user.Id = Convert.ToInt32(cmbAccountNumber.SelectedValue);
                user.Select_Balance();
                user.Balance += Amount;

                Amount = (Int32)Money - Amount;

                u.Id      = User_Id;
                u.Balance = Amount;

                if (user.Update() && u.Update())
                {
                    MessageBox.Show("Money Transfer Successfully!");
                }
                else
                {
                    MessageBox.Show(u.Error + user.Error);
                }
            }
        }
Beispiel #3
0
        private void enter_Click(object sender, EventArgs e)
        {
            if (txtAmount.Text == "")
            {
                txtAmount.Focus();
                return;
            }
            int Amount = Convert.ToInt32(txtAmount.Text);

            txtAmount.Text = "";

            if (Amount > (Int32)Money)
            {
                txtAmount.Text = "";
                txtInfo.Text   = "Insufficient Balance!";
            }
            if (Amount < 500)
            {
                txtAmount.Text = "";
                txtInfo.Text   = "Transaction isn't possible!";
            }
            if (Amount <= (Int32)Money && Amount >= 500)
            {
                DAL.User u = new DAL.User();
                Amount = (Int32)Money - Amount;

                u.Id      = User_Id;
                u.Balance = Amount;
                if (u.Update())
                {
                    MessageBox.Show("Data Updated!");
                }
                else
                {
                    MessageBox.Show(u.Error);
                }
            }
        }
Beispiel #4
0
 /// <summary>
 /// 更新用户数据
 /// </summary>
 public void Update(EasyLife.Model.User model)
 {
     dal.Update(model);
 }
Beispiel #5
0
 internal void Update(BE.User user)
 {
     _storage.Update(user);
 }
Beispiel #6
0
 public Model.User Update(Model.User mUser)
 {
     return(dal.Update(mUser));
 }