public JsonResult Edit(BusinessLable model)
        {
            try
            {
                if (model.BusinessLableId > 0)
                {
                    var entity = _businessLableService.GetById(model.BusinessLableId);
                    //修改
                    entity.Name = model.Name;

                    //执行更新
                    _businessLableService.Update(entity);
                }
                else
                {
                    //新增
                    model.Name = model.Name;

                    _businessLableService.Insert(model);
                }
            }
            catch (Exception)
            {
                return(Json(new { Status = Successed.Error, Info = Successed.Error.ToString() }, JsonRequestBehavior.AllowGet));
            }
            return(Json(new { Status = Successed.Ok }, JsonRequestBehavior.AllowGet));
        }
 /// <summary>
 /// 删除实体
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public void Delete(BusinessLable model)
 {
     this._BusinessLableBiz.Delete(model);
 }
 /// <summary>
 /// 修改实体
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public void Update(BusinessLable model)
 {
     this._BusinessLableBiz.Update(model);
 }
 /// <summary>
 /// 添加实体
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public BusinessLable Insert(BusinessLable model)
 {
     return(this._BusinessLableBiz.Insert(model));
 }
Beispiel #5
0
 /// <summary>
 /// 删除实体
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public void Delete(BusinessLable model)
 {
     this._repoBusinessLable.Delete(model);
 }
Beispiel #6
0
 /// <summary>
 /// 修改实体
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public void Update(BusinessLable model)
 {
     this._repoBusinessLable.Update(model);
 }
Beispiel #7
0
 public BusinessLable Insert(BusinessLable model)
 {
     return(this._repoBusinessLable.Insert(model));
 }