private void button_Submit_Click(object sender, EventArgs e) { BillItem billItem = new BillItem(); string remark = ""; foreach (string line in textBox_Remark.Lines) { remark += line; remark += Environment.NewLine; } if (checkPricePassed(billItem.ItemPrice)) { billItem.ItemPrice = double.Parse(textBox_ItemPrice.Text); billItem.ItemName = textBox_ItemName.Text; billItem.Date = InsertDatePicker.Value; billItem.Remark = remark; BillItemService billItemService = new BillItemService(); bool check = billItemService.saveNewBill(billItem); if (check) { MessageBox.Show("录入成功"); reset(); } } else { MessageBox.Show("请检查输入"); } }
public BillItemServiceTestSuite() { BillItemRepositoryMock = new Mock <IBillItemRepository>(); BillServiceMock = new Mock <IBillService>(); BillItemService = new BillItemService(BillItemRepositoryMock.Object, BillServiceMock.Object); }
public ContentController(UserService userService, ItemService itemService, OrderService orderService, BillItemService billItemService) { this.itemService = itemService; this.orderService = orderService; this.billItemService = billItemService; this.userService = userService; }
public HomeController(ILogger <HomeController> logger, UserService userService, ItemService itemService, OrderService orderService, BillItemService billItemService) { _logger = logger; this.itemService = itemService; this.orderService = orderService; this.billItemService = billItemService; this.userService = userService; }