/// <summary> /// 获取单个代码项表 /// </summary> /// <param name="model"></param> /// <returns></returns> public ReturnBody <CodeItemsEntity> GetSingleCodeItems(QueryCodeItemsModel model) { ExceptionInfoEntity exception = WipLogHelper.GetExceptionInfo <QueryCodeItemsModel>(namespaceName, "GetSingleCodeItems", model); try { #region 验证 if (model == null || string.IsNullOrEmpty(model.setCode) || string.IsNullOrEmpty(model.code)) { exception.exceptionMsg = ResMsg.PARAMETERNOEMPTY; return(BLLHelpler.GetReturnBody <CodeItemsEntity>(ResCode.PARAMETERNOEMPTY, exception.exceptionMsg, exception)); } #endregion var retModel = codeItemsBLL.GetModel(model.setCode, model.code); if (retModel == null) { exception.exceptionMsg = "没有找到数据"; return(BLLHelpler.GetReturnBody <CodeItemsEntity>(ResCode.FAILURE, exception.exceptionMsg, exception)); } return(BLLHelpler.GetReturnBody <CodeItemsEntity>(ResCode.SUCCESS, ResMsg.SUCCESS, retModel)); } catch (Exception ex) { WipLogHelper.GetExceptionInfoForError(ex, ref exception); return(BLLHelpler.GetReturnBody <CodeItemsEntity>(ResCode.FAILURE, ResMsg.FAILURE, exception)); } }
/// <summary> /// 获得代码项表数据列表(分页) /// </summary> /// <param name="strOrderBy">排序字段</param> /// <param name="strWhere">查询条件</param> /// <param name="model">分页实体数据</param> /// <returns>代码项表列表DataSet</returns> public DataSet GetListForPage(string strOrderBy, string strWhere, QueryCodeItemsModel model) { SqlParameter[] parameters = { new SqlParameter("@strOrderBy", SqlDbType.NVarChar, 50), new SqlParameter("@strWhere", SqlDbType.NVarChar, 500), new SqlParameter("@pageIndex", SqlDbType.Int), new SqlParameter("@pageSize", SqlDbType.Int), }; parameters[0].Value = strOrderBy; parameters[1].Value = strWhere; parameters[2].Value = model.pageIndex; parameters[3].Value = model.pageSize; return(SQLServerHelper.RunProcedure("uspWip_GetCodeItemsPageList", parameters, "pagetable")); }
/// <summary> /// 获取代码项表列表(分页) /// </summary> /// <returns></returns> public ReturnBody <PageResultModel <CodeItemsEntity> > GetCodeItemsList(QueryCodeItemsModel queryModel) { var strOrderBy = " codeItems.lastModifyTime DESC"; var strWhere = ""; ExceptionInfoEntity exception = WipLogHelper.GetExceptionInfo <QueryCodeItemsModel>(namespaceName, "GetCodeItemsList", queryModel); try { if (queryModel != null) { if (!string.IsNullOrEmpty(queryModel.code)) { strWhere += " codeItems.code LIKE '%" + queryModel.code + "%',"; } if (!string.IsNullOrEmpty(queryModel.name)) { strWhere += " codeItems.name LIKE '%" + queryModel.name + "%',"; } if (!string.IsNullOrEmpty(queryModel.setCode)) { strWhere += " codeItems.setCode LIKE '%" + queryModel.setCode + "%',"; } if (!string.IsNullOrEmpty(queryModel.delFlag)) { strWhere += " codeItems.delFlag ='" + queryModel.delFlag + "',"; } if (!string.IsNullOrEmpty(strWhere)) { strWhere = strWhere.Substring(0, strWhere.Length - 1); } } PageResultModel <CodeItemsEntity> list = codeItemsBLL.GetModelListForPage(strOrderBy, strWhere, queryModel); return(BLLHelpler.GetReturnBody <PageResultModel <CodeItemsEntity> >(ResCode.SUCCESS, ResMsg.SUCCESS, list)); } catch (Exception ex) { WipLogHelper.GetExceptionInfoForError(ex, ref exception); return(BLLHelpler.GetReturnBody <PageResultModel <CodeItemsEntity> >(ResCode.FAILURE, ResMsg.FAILURE, exception)); } }
/// <summary> /// 删除代码项表 /// </summary> /// <param name="model"></param> /// <returns></returns> public ReturnBody <bool> EnableCodeItems(QueryCodeItemsModel model) { ExceptionInfoEntity exception = WipLogHelper.GetExceptionInfo <QueryCodeItemsModel>(namespaceName, "DelCodeItems", model); try { #region 验证 if (model == null || model.id == 0) { exception.exceptionMsg = ResMsg.PARAMETERNOEMPTY; return(BLLHelpler.GetReturnBody <bool>(ResCode.PARAMETERNOEMPTY, exception.exceptionMsg, exception)); } #endregion var result = codeItemsBLL.Enable(model.id.ToString(), model.delFlag, JwtHelp.GetCurUserName()); return(BLLHelpler.GetReturnBody <bool>(ResCode.SUCCESS, ResMsg.SUCCESS, result)); } catch (Exception ex) { WipLogHelper.GetExceptionInfoForError(ex, ref exception); return(BLLHelpler.GetReturnBody <bool>(ResCode.FAILURE, ResMsg.FAILURE, exception)); } }
/// <summary> /// 获得代码项表数据列表(分页) /// </summary> /// <param name="strOrderBy">排序字段</param> /// <param name="strWhere">查询条件</param> /// <param name="model">分页数据</param> /// <returns>代码项表分页数据</returns> public PageResultModel <CodeItemsEntity> GetModelListForPage(string strOrderBy, string strWhere, QueryCodeItemsModel model) { DataSet ds = codeItemsDAL.GetListForPage(strOrderBy, strWhere, model); List <CodeItemsEntity> list = DataTableToList(ds.Tables[0]); int total = codeItemsDAL.GetRecordCount(strWhere); PageResultModel <CodeItemsEntity> result = new PageResultModel <CodeItemsEntity>(); result.total = total; result.rows = list; return(result); }
public string EnableCodeItems0(QueryCodeItemsModel model) { return("ok"); }
public string GetSingleCodeItems0(QueryCodeItemsModel model) { return("ok"); }