private void btnOk_Click(object sender, RoutedEventArgs e) { //by wygdove start UserAccountInfo accountinfo = new UserAccountInfo(); using (var context = new BMS_DBEntities()) { accountinfo.UAccountNumber = this.AccountId.Text; accountinfo.UName = this.LName.Text; accountinfo.UPhone = this.LPhone.Text; accountinfo.Balance = decimal.Parse(this.LoanAmount.Text); var q = from t in context.UserAccountInfoes where t.UAccountNumber == accountinfo.UAccountNumber select t; if (q.Count() == 0) { CustomOperation.CreateLoan(accountinfo, "企业贷款"); context.SaveChanges(); context.Dispose(); } } //by wygdove end //将贷款信息添置数据库 using (var context = new BMS_DBEntities()) { BusinessLoanInfo firm = new BusinessLoanInfo() { BlCompany = this.Company.Text, BlCompanyLoaction = this.Location.Text, BlAccountNumber = accountinfo.UAccountNumber, BlCompanyAsset = this.TotalAssets.Text }; try { context.BusinessLoanInfoes.Add(firm); context.SaveChanges(); context.Dispose(); MessageBox.Show("贷款成功"); } catch (Exception ex) { MessageBox.Show("贷款失败! " + ex.Message); } context.Dispose(); this.Close(); } }
//开户 private void btnOk_Click(object sender, RoutedEventArgs e) { UserAccountInfo accountinfo = new UserAccountInfo(); accountinfo.UAccountNumber = this.txtAccountNo.Text; accountinfo.UIdCardNumber = this.txtIDCard.Text; accountinfo.UName = this.txtAccountName.Text; accountinfo.UAccountPassword = this.txtPass.Password; accountinfo.Balance = decimal.Parse(this.txtMoney.Text); CustomOperation.CreateUser(accountinfo); OperateRecord page = new OperateRecord(); NavigationService ns = NavigationService.GetNavigationService(this); ns.Navigate(page); }
private void btnOk_Click(object sender, RoutedEventArgs e) { //by wygdove start UserAccountInfo accountinfo = new UserAccountInfo(); using (var context = new BMS_DBEntities()) { accountinfo.UAccountNumber = this.AccountId.Text; accountinfo.UName = this.PName.Text; accountinfo.UPhone = this.PPhone.Text; accountinfo.Balance = decimal.Parse(this.LoanAmount.Text); var q = from t in context.UserAccountInfoes where t.UAccountNumber == accountinfo.UAccountNumber select t; if (q.Count() == 0) { CustomOperation.CreateLoan(accountinfo, "个人贷款"); context.SaveChanges(); context.Dispose(); } } //by wygdove end //将贷款信息添置数据库 using (var context = new BMS_DBEntities()) { PersonalLoanInfo person = new PersonalLoanInfo() { PlWork = this.Unit.Text, //PlSalary = this.Wage.Text, PlAccountNumber = this.AccountId.Text, PlSalary = decimal.Parse(this.Wage.Text) }; try { context.PersonalLoanInfoes.Add(person); context.SaveChanges(); MessageBox.Show("贷款成功"); } catch (Exception ex) { MessageBox.Show("贷款失败!" + ex.Message); } } this.Close(); }
private void btnOk_Click(object sender, RoutedEventArgs e) { //by wygdove start UserAccountInfo accountinfo = new UserAccountInfo(); using (var context = new BMS_DBEntities()) { accountinfo.UAccountNumber = this.AccountId.Text; accountinfo.UName = this.SName.Text; accountinfo.UPhone = this.Phone.Text; accountinfo.Balance = decimal.Parse(this.LoanAmount.Text); var q = from t in context.UserAccountInfoes where t.UAccountNumber == accountinfo.UAccountNumber select t; if (q.Count() == 0) { CustomOperation.CreateLoan(accountinfo, "教学贷款"); context.SaveChanges(); context.Dispose(); } } //by wygdove end //将贷款信息添置数据库 using (var context = new BMS_DBEntities()) { StudentLoanInfo student = new StudentLoanInfo() { SlSchool = this.School.Text, SlInstitute = this.Academy.Text, SlProfession = this.Major.Text, SlAccountNumber = this.AccountId.Text }; try { context.StudentLoanInfoes.Add(student); context.SaveChanges(); MessageBox.Show("贷款成功"); } catch (Exception ex) { MessageBox.Show("贷款失败!" + ex.Message); } } this.Close(); }
//存款 private void btnOk_Click(object sender, RoutedEventArgs e) { UserAccountInfo accountinfo = new UserAccountInfo(); accountinfo.UAccountNumber = this.txtAccount.Text; try { accountinfo.Balance = decimal.Parse(this.txtmount.Text); } catch { MessageBox.Show("金额输入不正确"); } CustomOperation.UpdateSave(accountinfo); OperateRecord page = new OperateRecord(); NavigationService ns = NavigationService.GetNavigationService(this); ns.Navigate(page); }