public ActionResult Add(PersonBill bill) { if (bill != null) { bill.u_id = HttpContextUntity.CurrentUser.Id; bill.io_flag = bill.money_type == (int)SiteEnum.MoneyType.总额 ? 1 : -1; bill.item_money = bill.item_money * bill.io_flag; bill.create_time = DateTime.Now; int result = PersonBillService.Insert(bill); if (result > 0) { return(RedirectToAction("Index", "Home")); } else { ModelState.AddModelError("500", "信息错误,请稍后再试!"); } } else { ModelState.AddModelError("500", "信息错误,请稍后再试!"); } return(View()); }
public async Task AddPersonBill(Guid billId, Guid personId) { var personBill = new PersonBill { BillId = billId, PersonId = personId }; await _context.PersonBills.AddAsync(personBill); }
public static int Update(PersonBill obj) { try { using (var access = new PersonBillAccess()) { return(access.Update(obj)); } } catch (Exception ex) { throw ex; } }