Exemplo n.º 1
0
        //删除单据数据
        public ActionResult DelSccjInfo()
        {
            long id   = Convert.ToInt64(Request["id"]);
            var  temp = T_SCCJService.LoadEntities(x => x.ID == id).FirstOrDefault();

            if (temp != null)
            {
                temp.Del_f = 1;
                T_SCCJService.EditEntity(temp);
                return(Json(new { ret = "ok", msg = "操作成功" }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { ret = "no", msg = "数据库中无此条数据" }, JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 2
0
 //添加单据数据
 public ActionResult AddorEditSccjInfo(T_SCCJ tsccj)
 {
     tsccj.ProductGGId = tsccj.ProductGGId == 0 ? 533 : tsccj.ProductGGId;
     if (tsccj.ID > 0)//修改
     {
         if (T_SCCJService.EditEntity(tsccj))
         {
             return(Json(new { ret = "ok", msg = "操作成功" }, JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Json(new { ret = "no", msg = "修改失败" }, JsonRequestBehavior.AllowGet));
         }
     }
     else//新增
     {
         tsccj.Del_f = 0;
         T_SCCJService.AddEntity(tsccj);
         return(Json(new { ret = "ok", msg = "操作成功" }, JsonRequestBehavior.AllowGet));
     }
 }