コード例 #1
0
 public ActionResult addmedium(JiaJiModels.medium model)
 {
     try
     {
         model.MediumImg = "/image/" + model.MediumImg;
         var i = new JiaJiBLL.mediumbll().mediumadd(model);
         if (i > 0)
         {
             return(Json(new { Success = true, Message = "添加成功" }));
         }
         else
         {
             return(Json(new { Success = false, Message = "添加失败" }));
         }
     }
     catch
     {
         return(Json(new { Success = false, Message = "添加失败" }));
     }
 }
コード例 #2
0
        public JsonResult editMedium(JiaJiModels.medium model)
        {
            try
            {
                int id = model.MediumID;

                var i = new JiaJiBLL.mediumbll().UpdMedium(model);
                if (i > 0)
                {
                    return(Json(new { Success = true, Message = "修改成功" }));
                }
                else
                {
                    return(Json(new { Success = false, Message = "修改失败" }));
                }
            }
            catch
            {
                return(Json(new { Success = false, Message = "修改失败" }));
            }
        }