//作废单据
        public ActionResult DELJiekuan()
        {
            long id = Request["id"] == null ? 0 : Convert.ToInt64(Request["id"]);

            if (id == 0)
            {
                return(Json(new { ret = "ok", msg = "ID不可为空!" }, JsonRequestBehavior.AllowGet));
            }
            T_JieKuanBill Jkb = T_JieKuanBillService.LoadEntities(x => x.ID == id).FirstOrDefault();

            if (Jkb == null)
            {
                return(Json(new { ret = "ok", msg = "数据库中未找到该ID,联系管理员!" }, JsonRequestBehavior.AllowGet));
            }
            Jkb.Del = 1;
            if (T_JieKuanBillService.EditEntity(Jkb))
            {
                return(Json(new { ret = "ok", msg = "修改成功!" }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { ret = "ok", msg = "修改出错,联系管理员!" }, JsonRequestBehavior.AllowGet));
            }
        }
 //添加或修改
 public ActionResult AddOrEditJiekuan(T_JieKuanBill jkb)
 {
     if (jkb.ID <= 0)
     {
         jkb.AddTime = MvcApplication.GetT_time();
         jkb.Del     = 0;
         jkb.UserAdd = LoginUser.ID;
         int jkp = Convert.ToInt32(jkb.JieKuanPerson);
         jkb.JieKuanPerson = UserInfoService.LoadEntities(x => x.ID == jkp).FirstOrDefault().PerSonName;
         T_JieKuanBillService.AddEntity(jkb);
         return(Json(new { ret = "ok", msg = "添加成功!" }, JsonRequestBehavior.AllowGet));
     }
     else
     {
         if (T_JieKuanBillService.EditEntity(jkb))
         {
             return(Json(new { ret = "ok", msg = "修改成功!" }, JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Json(new { ret = "ok", msg = "修改出错,联系管理员!" }, JsonRequestBehavior.AllowGet));
         }
     }
 }