/// <summary> /// 对象编辑 /// </summary> /// <param name="tBaseAttributeTypeValue">用户对象</param> /// <returns>是否成功</returns> public bool Edit(TBaseAttributeTypeValueVo tBaseAttributeTypeValue) { string strSQL = SqlHelper.BuildUpdateExpress(tBaseAttributeTypeValue, TBaseAttributeTypeValueVo.T_BASE_ATTRIBUTE_TYPE_VALUE_TABLE); strSQL += string.Format(" where ID='{0}' ", tBaseAttributeTypeValue.ID); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 获取属性配置信息 /// </summary> /// <returns></returns> private string getAttributeConfigInfo() { string strSortname = Request.Params["sortname"]; string strSortorder = Request.Params["sortorder"]; //当前页面 int intPageIndex = Convert.ToInt32(Request.Params["page"]); //每页记录数 int intPageSize = Convert.ToInt32(Request.Params["pagesize"]); DataTable dt = new DataTable(); int intTotalCount = 0; TBaseAttributeTypeValueVo TBaseAttributeTypeValueVo = new TBaseAttributeTypeValueVo(); TBaseAttributeTypeValueVo.IS_DEL = "0"; TBaseAttributeTypeValueVo.SORT_FIELD = strSortname; TBaseAttributeTypeValueVo.SORT_TYPE = strSortorder; if (!String.IsNullOrEmpty(srh_ItemId) || !String.IsNullOrEmpty(srh_AttTypeId) || !String.IsNullOrEmpty(srh_AttId)) { TBaseAttributeTypeValueVo.ITEM_TYPE = srh_ItemId; TBaseAttributeTypeValueVo.ATTRIBUTE_TYPE_ID = srh_AttTypeId; TBaseAttributeTypeValueVo.ATTRIBUTE_ID = srh_AttId; dt = new TBaseAttributeTypeValueLogic().SelectDefinedTadble(TBaseAttributeTypeValueVo, intPageIndex, intPageSize); intTotalCount = new TBaseAttributeTypeValueLogic().GetSelecDefinedtResultCount(TBaseAttributeTypeValueVo); } else { dt = new TBaseAttributeTypeValueLogic().SelectByTable(TBaseAttributeTypeValueVo, intPageIndex, intPageSize); intTotalCount = new TBaseAttributeTypeValueLogic().GetSelectResultCount(TBaseAttributeTypeValueVo); } string strJson = CreateToJson(dt, intTotalCount); return(strJson); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tBaseAttributeTypeValue_UpdateSet">UpdateSet用户对象</param> /// <param name="tBaseAttributeTypeValue_UpdateWhere">UpdateWhere用户对象</param> /// <returns>是否成功</returns> public bool Edit(TBaseAttributeTypeValueVo tBaseAttributeTypeValue_UpdateSet, TBaseAttributeTypeValueVo tBaseAttributeTypeValue_UpdateWhere) { string strSQL = SqlHelper.BuildUpdateExpress(tBaseAttributeTypeValue_UpdateSet, TBaseAttributeTypeValueVo.T_BASE_ATTRIBUTE_TYPE_VALUE_TABLE); strSQL += this.BuildWhereStatement(tBaseAttributeTypeValue_UpdateWhere); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 获取对象DataTable /// </summary> /// <param name="tBaseAttributeTypeValue">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public DataTable SelectByTable(TBaseAttributeTypeValueVo tBaseAttributeTypeValue, int iIndex, int iCount) { string strSQL = " select * from T_BASE_ATTRIBUTE_TYPE_VALUE {0} "; strSQL = String.Format(strSQL, BuildWhereStatement(tBaseAttributeTypeValue)); return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount))); }
/// <summary> /// 对象删除 /// </summary> /// <param name="Id">ID</param> /// <returns>是否成功</returns> public bool Delete(TBaseAttributeTypeValueVo tBaseAttributeTypeValue) { string strSQL = "delete from T_BASE_ATTRIBUTE_TYPE_VALUE "; strSQL += this.BuildWhereStatement(tBaseAttributeTypeValue); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 加载数据 /// </summary> /// <returns></returns> public string frmLoadData() { TBaseAttributeTypeValueVo TBaseAttributeTypeValueVo = new TBaseAttributeTypeValueVo(); TBaseAttributeTypeValueVo.ID = Request["id"].ToString(); TBaseAttributeTypeValueVo.IS_DEL = "0"; TBaseAttributeTypeValueVo TBaseAttributeTypeValueVoTemp = new TBaseAttributeTypeValueLogic().Details(TBaseAttributeTypeValueVo); return(ToJson(TBaseAttributeTypeValueVoTemp)); }
/// <summary> /// 修改数据 /// </summary> /// <returns></returns> public string frmUpdate() { TBaseAttributeTypeValueVo TBaseAttributeTypeValueVo = autoBindRequest(Request, new TBaseAttributeTypeValueVo()); TBaseAttributeTypeValueVo.ID = Request["id"].ToString(); TBaseAttributeTypeValueVo.IS_DEL = "0"; bool isSuccess = new TBaseAttributeTypeValueLogic().Edit(TBaseAttributeTypeValueVo); if (isSuccess) { new PageBase().WriteLog("修改属性配置", "", new PageBase().LogInfo.UserInfo.USER_NAME + "修改属性配置" + TBaseAttributeTypeValueVo.ID + "成功"); } return(isSuccess == true ? "1" : "0"); }
/// <summary> /// 增加数据 /// </summary> /// <returns></returns> public string frmAdd() { TBaseAttributeTypeValueVo TBaseAttributeTypeValueVo = autoBindRequest(Request, new TBaseAttributeTypeValueVo()); TBaseAttributeTypeValueVo.ID = GetSerialNumber("AttributeConfig_Id"); TBaseAttributeTypeValueVo.IS_DEL = "0"; bool isSuccess = new TBaseAttributeTypeValueLogic().Create(TBaseAttributeTypeValueVo); if (isSuccess) { new PageBase().WriteLog("增加属性配置", "", new PageBase().LogInfo.UserInfo.USER_NAME + "增加属性配置" + TBaseAttributeTypeValueVo.ID + "成功"); } return(isSuccess == true ? "1" : "0"); }
public static string deleteAttributeConfigInfo(string strValue) { TBaseAttributeTypeValueVo TBaseAttributeTypeValueVo = new TBaseAttributeTypeValueVo(); TBaseAttributeTypeValueVo.ID = strValue; TBaseAttributeTypeValueVo.IS_DEL = "1"; bool isSuccess = new TBaseAttributeTypeValueLogic().Edit(TBaseAttributeTypeValueVo); if (isSuccess) { new PageBase().WriteLog("删除属性配置", "", new PageBase().LogInfo.UserInfo.USER_NAME + "删除属性配置" + strValue + "成功"); } return(isSuccess == true ? "1" : "0"); }
/// <summary> /// 获取自定义查询结果总数 Create By Castle(胡方扬) 2012-11-19 /// </summary> /// <param name="tBaseAttributeTypeValue">对象</param> /// <returns></returns> public int GetSelecDefinedtResultCount(TBaseAttributeTypeValueVo tBaseAttributeTypeValue) { string strSQL = String.Format("SELECT * FROM T_BASE_ATTRIBUTE_TYPE_VALUE WHERE IS_DEL='{0}'", tBaseAttributeTypeValue.IS_DEL); if (!String.IsNullOrEmpty(tBaseAttributeTypeValue.ITEM_TYPE)) { strSQL += String.Format(" AND ITEM_TYPE ='{0}'", tBaseAttributeTypeValue.ITEM_TYPE); } if (!String.IsNullOrEmpty(tBaseAttributeTypeValue.ATTRIBUTE_ID)) { strSQL += String.Format(" AND ATTRIBUTE_ID ='{0}'", tBaseAttributeTypeValue.ATTRIBUTE_ID); } if (!String.IsNullOrEmpty(tBaseAttributeTypeValue.ATTRIBUTE_TYPE_ID)) { strSQL += String.Format(" AND ATTRIBUTE_TYPE_ID ='{0}'", tBaseAttributeTypeValue.ATTRIBUTE_TYPE_ID); } return(SqlHelper.ExecuteDataTable(strSQL).Rows.Count); }
/// <summary> /// 自定义查询 Create By Castle(胡方扬) 2012-11-19 /// </summary> /// <param name="tBaseAttributeTypeValue">对象</param> /// <param name="iIndex">起始页</param> /// <param name="iCount">条数</param> /// <returns></returns> public DataTable SelectDefinedTadble(TBaseAttributeTypeValueVo tBaseAttributeTypeValue, int iIndex, int iCount) { string strSQL = String.Format("SELECT * FROM T_BASE_ATTRIBUTE_TYPE_VALUE WHERE IS_DEL='{0}'", tBaseAttributeTypeValue.IS_DEL); if (!String.IsNullOrEmpty(tBaseAttributeTypeValue.ITEM_TYPE)) { strSQL += String.Format(" AND ITEM_TYPE ='{0}'", tBaseAttributeTypeValue.ITEM_TYPE); } if (!String.IsNullOrEmpty(tBaseAttributeTypeValue.ATTRIBUTE_ID)) { strSQL += String.Format(" AND ATTRIBUTE_ID ='{0}'", tBaseAttributeTypeValue.ATTRIBUTE_ID); } if (!String.IsNullOrEmpty(tBaseAttributeTypeValue.ATTRIBUTE_TYPE_ID)) { strSQL += String.Format(" AND ATTRIBUTE_TYPE_ID ='{0}'", tBaseAttributeTypeValue.ATTRIBUTE_TYPE_ID); } return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount))); }
/// <summary> /// 获取对象DataTable /// </summary> /// <param name="tBaseAttributeTypeValue">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public DataTable SelectByTable(TBaseAttributeTypeValueVo tBaseAttributeTypeValue, int iIndex, int iCount) { return(access.SelectByTable(tBaseAttributeTypeValue, iIndex, iCount)); }
/// <summary> /// 获取对象List /// </summary> /// <param name="tBaseAttributeTypeValue">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public List <TBaseAttributeTypeValueVo> SelectByObject(TBaseAttributeTypeValueVo tBaseAttributeTypeValue, int iIndex, int iCount) { return(access.SelectByObject(tBaseAttributeTypeValue, iIndex, iCount)); }
/// <summary> /// 对象明细 /// </summary> /// <param name="tBaseAttributeTypeValue">对象条件</param> /// <returns>对象</returns> public TBaseAttributeTypeValueVo Details(TBaseAttributeTypeValueVo tBaseAttributeTypeValue) { return(access.Details(tBaseAttributeTypeValue)); }
/// <summary> /// 获得查询结果总行数,用于分页 /// </summary> /// <param name="tBaseAttributeTypeValue">对象</param> /// <returns>返回行数</returns> public int GetSelectResultCount(TBaseAttributeTypeValueVo tBaseAttributeTypeValue) { return(access.GetSelectResultCount(tBaseAttributeTypeValue)); }
public TBaseAttributeTypeValueLogic(TBaseAttributeTypeValueVo _tBaseAttributeTypeValue) { tBaseAttributeTypeValue = _tBaseAttributeTypeValue; access = new TBaseAttributeTypeValueAccess(); }
/// <summary> /// 对象明细 /// </summary> /// <param name="tBaseAttributeTypeValue">对象条件</param> /// <returns>对象</returns> public TBaseAttributeTypeValueVo Details(TBaseAttributeTypeValueVo tBaseAttributeTypeValue) { string strSQL = String.Format("select * from T_BASE_ATTRIBUTE_TYPE_VALUE " + this.BuildWhereStatement(tBaseAttributeTypeValue)); return(SqlHelper.ExecuteObject(new TBaseAttributeTypeValueVo(), strSQL)); }
/// <summary> /// 根据对象特征获取单一对象 /// </summary> /// <param name="tBaseAttributeTypeValue">对象</param> /// <returns></returns> public TBaseAttributeTypeValueVo SelectByObject(TBaseAttributeTypeValueVo tBaseAttributeTypeValue) { return(access.SelectByObject(tBaseAttributeTypeValue)); }
/// <summary> /// 根据对象获取全部数据,用Table承载 /// 数据量较小时使用【不推荐】 /// </summary> /// <param name="tBaseAttributeTypeValue"></param> /// <returns></returns> public DataTable SelectByTable(TBaseAttributeTypeValueVo tBaseAttributeTypeValue) { string strSQL = "select * from T_BASE_ATTRIBUTE_TYPE_VALUE " + this.BuildWhereStatement(tBaseAttributeTypeValue); return(SqlHelper.ExecuteDataTable(strSQL)); }
/// <summary> /// 根据对象构造条件语句 /// </summary> /// <param name="tBaseAttributeTypeValue"></param> /// <returns></returns> public string BuildWhereStatement(TBaseAttributeTypeValueVo tBaseAttributeTypeValue) { StringBuilder strWhereStatement = new StringBuilder(" Where 1=1 "); if (null != tBaseAttributeTypeValue) { //ID if (!String.IsNullOrEmpty(tBaseAttributeTypeValue.ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND ID = '{0}'", tBaseAttributeTypeValue.ID.ToString())); } //监测类别 if (!String.IsNullOrEmpty(tBaseAttributeTypeValue.ITEM_TYPE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND ITEM_TYPE = '{0}'", tBaseAttributeTypeValue.ITEM_TYPE.ToString())); } //排口点位类别 if (!String.IsNullOrEmpty(tBaseAttributeTypeValue.OUTLETPOINT_TYPE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND OUTLETPOINT_TYPE = '{0}'", tBaseAttributeTypeValue.OUTLETPOINT_TYPE.ToString())); } //属性类别 if (!String.IsNullOrEmpty(tBaseAttributeTypeValue.ATTRIBUTE_TYPE_ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND ATTRIBUTE_TYPE_ID = '{0}'", tBaseAttributeTypeValue.ATTRIBUTE_TYPE_ID.ToString())); } //属性 if (!String.IsNullOrEmpty(tBaseAttributeTypeValue.ATTRIBUTE_ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND ATTRIBUTE_ID = '{0}'", tBaseAttributeTypeValue.ATTRIBUTE_ID.ToString())); } //排序 if (!String.IsNullOrEmpty(tBaseAttributeTypeValue.SN.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND SN = '{0}'", tBaseAttributeTypeValue.SN.ToString())); } //使用状态(0为启用、1为停用) if (!String.IsNullOrEmpty(tBaseAttributeTypeValue.IS_DEL.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND IS_DEL = '{0}'", tBaseAttributeTypeValue.IS_DEL.ToString())); } //备注1 if (!String.IsNullOrEmpty(tBaseAttributeTypeValue.REMARK1.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK1 = '{0}'", tBaseAttributeTypeValue.REMARK1.ToString())); } //备注2 if (!String.IsNullOrEmpty(tBaseAttributeTypeValue.REMARK2.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK2 = '{0}'", tBaseAttributeTypeValue.REMARK2.ToString())); } //备注3 if (!String.IsNullOrEmpty(tBaseAttributeTypeValue.REMARK3.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK3 = '{0}'", tBaseAttributeTypeValue.REMARK3.ToString())); } //备注4 if (!String.IsNullOrEmpty(tBaseAttributeTypeValue.REMARK4.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK4 = '{0}'", tBaseAttributeTypeValue.REMARK4.ToString())); } //备注5 if (!String.IsNullOrEmpty(tBaseAttributeTypeValue.REMARK5.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK5 = '{0}'", tBaseAttributeTypeValue.REMARK5.ToString())); } } return(strWhereStatement.ToString()); }
/// <summary> /// 获取对象List /// </summary> /// <param name="tBaseAttributeTypeValue">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public List <TBaseAttributeTypeValueVo> SelectByObject(TBaseAttributeTypeValueVo tBaseAttributeTypeValue, int iIndex, int iCount) { string strSQL = String.Format("select * from T_BASE_ATTRIBUTE_TYPE_VALUE " + this.BuildWhereStatement(tBaseAttributeTypeValue)); return(SqlHelper.ExecuteObjectList(tBaseAttributeTypeValue, BuildPagerExpress(strSQL, iIndex, iCount))); }
/// <summary> /// 根据对象获取全部数据,用Table承载 /// 数据量较小时使用【不推荐】 /// </summary> /// <param name="tBaseAttributeTypeValue"></param> /// <returns></returns> public DataTable SelectByTable(TBaseAttributeTypeValueVo tBaseAttributeTypeValue) { return(access.SelectByTable(tBaseAttributeTypeValue)); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tBaseAttributeTypeValue_UpdateSet">UpdateSet用户对象</param> /// <param name="tBaseAttributeTypeValue_UpdateWhere">UpdateWhere用户对象</param> /// <returns>是否成功</returns> public bool Edit(TBaseAttributeTypeValueVo tBaseAttributeTypeValue_UpdateSet, TBaseAttributeTypeValueVo tBaseAttributeTypeValue_UpdateWhere) { return(access.Edit(tBaseAttributeTypeValue_UpdateSet, tBaseAttributeTypeValue_UpdateWhere)); }
/// <summary> /// 对象删除 /// </summary> /// <param name="Id">ID</param> /// <returns>是否成功</returns> public bool Delete(TBaseAttributeTypeValueVo tBaseAttributeTypeValue) { return(access.Delete(tBaseAttributeTypeValue)); }
/// <summary> /// 对象添加 /// </summary> /// <param name="sysRole">对象</param> /// <returns>是否成功</returns> public bool Create(TBaseAttributeTypeValueVo tBaseAttributeTypeValue) { return(access.Create(tBaseAttributeTypeValue)); }
/// <summary> /// 获得查询结果总行数,用于分页 /// </summary> /// <param name="tBaseAttributeTypeValue">对象</param> /// <returns>返回行数</returns> public int GetSelectResultCount(TBaseAttributeTypeValueVo tBaseAttributeTypeValue) { string strSQL = "select Count(*) from T_BASE_ATTRIBUTE_TYPE_VALUE " + this.BuildWhereStatement(tBaseAttributeTypeValue); return(Convert.ToInt32(SqlHelper.ExecuteScalar(strSQL))); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tBaseAttributeTypeValue">用户对象</param> /// <returns>是否成功</returns> public bool Edit(TBaseAttributeTypeValueVo tBaseAttributeTypeValue) { return(access.Edit(tBaseAttributeTypeValue)); }
/// <summary> /// 对象添加 /// </summary> /// <param name="tBaseAttributeTypeValue">对象</param> /// <returns>是否成功</returns> public bool Create(TBaseAttributeTypeValueVo tBaseAttributeTypeValue) { string strSQL = SqlHelper.BuildInsertExpress(tBaseAttributeTypeValue, TBaseAttributeTypeValueVo.T_BASE_ATTRIBUTE_TYPE_VALUE_TABLE); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }