Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
 public async Task AddPersonBill(Guid billId, Guid personId)
 {
     var personBill = new PersonBill
     {
         BillId   = billId,
         PersonId = personId
     };
     await _context.PersonBills.AddAsync(personBill);
 }
Exemplo n.º 3
0
 public static int Update(PersonBill obj)
 {
     try
     {
         using (var access = new PersonBillAccess())
         {
             return(access.Update(obj));
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }