Example #1
0
        public void Pay(int id)
        {
            var msg = new Msg();

            try
            {
                var Db   = new Bills().BillDb;
                var bill = Db.GetById(id);
                if (bill == null)
                {
                    throw new Exception("该账单不存在");
                }
                bill.Bill_is_active = 2;
                if (Db.Update(bill))
                {
                    msg.Message = "结算成功!";
                }
                else
                {
                    throw new Exception("发生未知错误!");
                }
            }
            catch (Exception ex)
            {
                msg.Code    = -1;
                msg.Message = ex.Message;
            }
            Response.Write(msg.ToJson());
            Response.End();
        }