Beispiel #1
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveForm(string keyValue, GoodstypeEntity entity)
 {
     try
     {
         service.SaveForm(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #2
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveForm(string keyValue, GoodstypeEntity entity)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         entity.Modify(keyValue);
         this.BaseRepository().Update(entity);
     }
     else
     {
         entity.Create();
         this.BaseRepository().Insert(entity);
     }
 }
 public ActionResult SaveForm(string keyValue, GoodstypeEntity entity)
 {
     if (entity.frootid != "" || entity.frootid != null)       //父级不为空
     {
         entity.ftypecode = entity.frootid + entity.ftypecode; //组成新的code
     }
     if (entity.flayer == 0 && entity.fparentcode == "")
     {
         entity.fparentcode = "0";
     }
     else
     {
         entity.fparentcode = entity.frootid;
     }
     goodstypebll.SaveForm(keyValue, entity);
     return(Success("操作成功。"));
 }