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); } }
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); } } }
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); } } }
/// <summary> /// 更新用户数据 /// </summary> public void Update(EasyLife.Model.User model) { dal.Update(model); }
internal void Update(BE.User user) { _storage.Update(user); }
public Model.User Update(Model.User mUser) { return(dal.Update(mUser)); }