public JsonResult CORU(bs_Project model) { MessageJSON mj = new MessageJSON(MessageState.fail, "操作失败", MessageIcon.no); if (model.ID == 0) { bs_ProjectBll.Create(model); if (model != null && model.ID > 0) { mj = new MessageJSON(MessageState.success, "创建项目成功", MessageIcon.yes); } else { mj = new MessageJSON(MessageState.fail, "项目名不为空且项目&公司不重复", MessageIcon.no); } } else { if (bs_ProjectBll.Update(model)) { mj = new MessageJSON(MessageState.success, "更新项目成功", MessageIcon.yes); } else { mj = new MessageJSON(MessageState.fail, "更新项目失败", MessageIcon.no); } } return(Json(mj, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 更新项目 /// </summary> /// <param name="model"></param> public bool Update(bs_Project model) { if (db.Update(model) > 0) { return(true); } return(false); }
/// <summary> /// 创建项目 /// </summary> /// <param name="model"></param> public void Create(bs_Project model) { try { db.Insert(model); } catch (System.Exception) { } }
/// <summary> /// 更新项目 /// </summary> /// <param name="model"></param> public bool Update(bs_Project model) { return(dal.Update(model)); }
/// <summary> /// 创建项目 /// </summary> /// <param name="model"></param> public void Create(bs_Project model) { dal.Create(model); }