/// <summary> /// 修改一条采访编目记录 /// </summary> /// <param name="list">编目清单</param> /// <returns>修改成功与否</returns> public bool UpdateCatalogList(CreateCatalogList list, ref List <string> errorMsg) { bool result = false; try { if (list.Id == 0) { errorMsg.Add("Id Error"); return(false); } if (!CreateCatalogList.isNull(list)) //是否有空项 { if (CreateCatalogList.isNormative(list, ref errorMsg)) //是否符合规范 { result = createDal.UpdateCatalogList(list); } } } catch (Exception e) { Console.WriteLine(e.Message); throw e; } return(result); }
/// <summary> /// 增加一条编目记录 /// </summary> /// <param name="list">编目列表</param> /// <param name="errorMsg">增加成功与否</param> /// <returns></returns> public bool AddCatalogList(CreateCatalogList list, ref List <string> errorMsg) { bool result = false; try { if (!CreateCatalogList.isNull(list)) //是否有空项 { if (CreateCatalogList.isNormative(list, ref errorMsg)) //是否符合规范 { result = createDal.AddCatalogList(list); } } } catch (Exception ex) { Console.WriteLine(ex.Message); throw ex; } return(result); }