/// <summary> /// 对象编辑 /// </summary> /// <param name="tBaseMethodInfo">用户对象</param> /// <returns>是否成功</returns> public bool Edit(TBaseMethodInfoVo tBaseMethodInfo) { string strSQL = SqlHelper.BuildUpdateExpress(tBaseMethodInfo, TBaseMethodInfoVo.T_BASE_METHOD_INFO_TABLE); strSQL += string.Format(" where ID='{0}' ", tBaseMethodInfo.ID); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 获取自定义查询结果总数 Create By Castle(胡方扬) 2012-11-19 /// </summary> /// <param name="tBaseMethodInfo">对象</param> /// <returns></returns> public int GetSelecDefinedtResultCount(TBaseMethodInfoVo tBaseMethodInfo) { string strSQL = " select * from T_BASE_METHOD_INFO {0} "; strSQL = String.Format(strSQL, BuildWhereLikeStatement(tBaseMethodInfo)); return(SqlHelper.ExecuteDataTable(strSQL).Rows.Count); }
/// <summary> /// 获取对象DataTable /// </summary> /// <param name="tBaseMethodInfo">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public DataTable SelectByTable(TBaseMethodInfoVo tBaseMethodInfo, int iIndex, int iCount) { string strSQL = " select * from T_BASE_METHOD_INFO {0} "; strSQL = String.Format(strSQL, BuildWhereStatement(tBaseMethodInfo)); return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount))); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tBaseMethodInfo_UpdateSet">UpdateSet用户对象</param> /// <param name="tBaseMethodInfo_UpdateWhere">UpdateWhere用户对象</param> /// <returns>是否成功</returns> public bool Edit(TBaseMethodInfoVo tBaseMethodInfo_UpdateSet, TBaseMethodInfoVo tBaseMethodInfo_UpdateWhere) { string strSQL = SqlHelper.BuildUpdateExpress(tBaseMethodInfo_UpdateSet, TBaseMethodInfoVo.T_BASE_METHOD_INFO_TABLE); strSQL += this.BuildWhereStatement(tBaseMethodInfo_UpdateWhere); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 获取方法依据信息 /// </summary> /// <returns></returns> private string getMethodInfo() { string strSortname = Request.Params["sortname"]; string strSortorder = Request.Params["sortorder"]; //当前页面 int intPageIndex = Convert.ToInt32(Request.Params["page"]); //每页记录数 int intPageSize = Convert.ToInt32(Request.Params["pagesize"]); TBaseMethodInfoVo TBaseMethodInfoVo = new TBaseMethodInfoVo(); TBaseMethodInfoVo.IS_DEL = "0"; TBaseMethodInfoVo.SORT_FIELD = strSortname; TBaseMethodInfoVo.SORT_TYPE = strSortorder; DataTable dt = new DataTable(); int intTotalCount = 0; if (!String.IsNullOrEmpty(srhCode) || !String.IsNullOrEmpty(srhName) || !String.IsNullOrEmpty(srhMonitorId)) { TBaseMethodInfoVo.METHOD_CODE = srhCode; TBaseMethodInfoVo.METHOD_NAME = srhName; TBaseMethodInfoVo.MONITOR_ID = srhMonitorId; dt = new TBaseMethodInfoLogic().SelectDefinedTadble(TBaseMethodInfoVo, intPageIndex, intPageSize); intTotalCount = new TBaseMethodInfoLogic().GetSelecDefinedtResultCount(TBaseMethodInfoVo); } else { dt = new TBaseMethodInfoLogic().SelectByTable(TBaseMethodInfoVo, intPageIndex, intPageSize); intTotalCount = new TBaseMethodInfoLogic().GetSelectResultCount(TBaseMethodInfoVo); } string strJson = CreateToJson(dt, intTotalCount); return(strJson); }
/// <summary> /// 对象删除 /// </summary> /// <param name="Id">ID</param> /// <returns>是否成功</returns> public bool Delete(TBaseMethodInfoVo tBaseMethodInfo) { string strSQL = "delete from T_BASE_METHOD_INFO "; strSQL += this.BuildWhereStatement(tBaseMethodInfo); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 加载数据 /// </summary> /// <returns></returns> public string frmLoadData() { TBaseMethodInfoVo TBaseMethodInfoVo = new TBaseMethodInfoVo(); TBaseMethodInfoVo.ID = Request["id"].ToString(); TBaseMethodInfoVo.IS_DEL = "0"; TBaseMethodInfoVo TBaseMethodInfoVoTemp = new TBaseMethodInfoLogic().Details(TBaseMethodInfoVo); return(ToJson(TBaseMethodInfoVoTemp)); }
public static string deleteMethodInfo(string strValue) { TBaseMethodInfoVo TBaseMethodInfoVo = new TBaseMethodInfoVo(); TBaseMethodInfoVo.ID = strValue; TBaseMethodInfoVo.IS_DEL = "1"; bool isSuccess = new TBaseMethodInfoLogic().Edit(TBaseMethodInfoVo); if (isSuccess) { new PageBase().WriteLog("删除方法依据", "", new PageBase().LogInfo.UserInfo.USER_NAME + "删除方法依据" + TBaseMethodInfoVo.ID + "成功"); } return(isSuccess == true ? "1" : "0"); }
/// <summary> /// 增加数据 /// </summary> /// <returns></returns> public string frmAdd() { TBaseMethodInfoVo TBaseMethodInfoVo = autoBindRequest(Request, new TBaseMethodInfoVo()); TBaseMethodInfoVo.ID = GetSerialNumber("method_id"); TBaseMethodInfoVo.IS_DEL = "0"; bool isSuccess = new TBaseMethodInfoLogic().Create(TBaseMethodInfoVo); if (isSuccess) { new PageBase().WriteLog("新增方法依据", "", new PageBase().LogInfo.UserInfo.USER_NAME + "新增方法依据" + TBaseMethodInfoVo.ID + "成功"); } return(isSuccess == true ? "1" : "0"); }
/// <summary> /// 修改数据 /// </summary> /// <returns></returns> public string frmUpdate() { TBaseMethodInfoVo TBaseMethodInfoVo = autoBindRequest(Request, new TBaseMethodInfoVo()); TBaseMethodInfoVo.ID = Request["id"].ToString(); TBaseMethodInfoVo.IS_DEL = "0"; bool isSuccess = new TBaseMethodInfoLogic().Edit(TBaseMethodInfoVo); if (isSuccess) { new PageBase().WriteLog("修改方法依据", "", new PageBase().LogInfo.UserInfo.USER_NAME + "修改方法依据" + TBaseMethodInfoVo.ID + "成功"); } return(isSuccess == true ? "1" : "0"); }
protected void Button1_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(this.TextBox1.Text)) { return; } if (String.IsNullOrEmpty(this.TextBox2.Text)) { return; } else { string strSourceType = this.TextBox1.Text.ToString(); string strToType = this.TextBox2.Text.ToString(); TBaseMethodInfoVo TBaseMethodInfoVo = new TBaseMethodInfoVo(); if (new TBaseMethodInfoLogic().CopyInfor(strSourceType, strToType)) { Response.Write("<script language='javascript'>alert('复制成功');</script>"); } } }
/// <summary> /// 获得查询结果总行数,用于分页 /// </summary> /// <param name="tBaseMethodInfo">对象</param> /// <returns>返回行数</returns> public int GetSelectResultCount(TBaseMethodInfoVo tBaseMethodInfo) { return(access.GetSelectResultCount(tBaseMethodInfo)); }
public TBaseMethodInfoLogic(TBaseMethodInfoVo _tBaseMethodInfo) { tBaseMethodInfo = _tBaseMethodInfo; access = new TBaseMethodInfoAccess(); }
/// <summary> /// 对象删除 /// </summary> /// <param name="Id">ID</param> /// <returns>是否成功</returns> public bool Delete(TBaseMethodInfoVo tBaseMethodInfo) { return(access.Delete(tBaseMethodInfo)); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tBaseMethodInfo_UpdateSet">UpdateSet用户对象</param> /// <param name="tBaseMethodInfo_UpdateWhere">UpdateWhere用户对象</param> /// <returns>是否成功</returns> public bool Edit(TBaseMethodInfoVo tBaseMethodInfo_UpdateSet, TBaseMethodInfoVo tBaseMethodInfo_UpdateWhere) { return(access.Edit(tBaseMethodInfo_UpdateSet, tBaseMethodInfo_UpdateWhere)); }
/// <summary> /// 获取对象DataTable /// </summary> /// <param name="tBaseMethodInfo">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public DataTable SelectByTable(TBaseMethodInfoVo tBaseMethodInfo, int iIndex, int iCount) { return(access.SelectByTable(tBaseMethodInfo, iIndex, iCount)); }
/// <summary> /// 获取对象List /// </summary> /// <param name="tBaseMethodInfo">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public List <TBaseMethodInfoVo> SelectByObject(TBaseMethodInfoVo tBaseMethodInfo, int iIndex, int iCount) { string strSQL = String.Format("select * from T_BASE_METHOD_INFO " + this.BuildWhereStatement(tBaseMethodInfo)); return(SqlHelper.ExecuteObjectList(tBaseMethodInfo, BuildPagerExpress(strSQL, iIndex, iCount))); }
/// <summary> /// 对象明细 /// </summary> /// <param name="tBaseMethodInfo">对象条件</param> /// <returns>对象</returns> public TBaseMethodInfoVo Details(TBaseMethodInfoVo tBaseMethodInfo) { string strSQL = String.Format("select * from T_BASE_METHOD_INFO " + this.BuildWhereStatement(tBaseMethodInfo)); return(SqlHelper.ExecuteObject(new TBaseMethodInfoVo(), strSQL)); }
/// <summary> /// 根据对象构造条件语句 模糊查询,需要时自己修改 查询条件即可 /// </summary> /// <param name="tBaseMethodInfo"></param> /// <returns></returns> public string BuildWhereLikeStatement(TBaseMethodInfoVo tBaseMethodInfo) { StringBuilder strWhereStatement = new StringBuilder(" Where 1=1 "); if (null != tBaseMethodInfo) { //ID if (!String.IsNullOrEmpty(tBaseMethodInfo.ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND ID = '{0}'", tBaseMethodInfo.ID.ToString())); } //方法依据编号 if (!String.IsNullOrEmpty(tBaseMethodInfo.METHOD_CODE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND METHOD_CODE LIKE '%{0}%'", tBaseMethodInfo.METHOD_CODE.ToString())); } //方法依据名称 if (!String.IsNullOrEmpty(tBaseMethodInfo.METHOD_NAME.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND METHOD_NAME LIKE '%{0}%'", tBaseMethodInfo.METHOD_NAME.ToString())); } //监测类别(废水和废气、环境空气和废气、土壤和固体废弃物、噪声和震动、电磁辐射及放射性、其它) if (!String.IsNullOrEmpty(tBaseMethodInfo.MONITOR_ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND MONITOR_ID = '{0}'", tBaseMethodInfo.MONITOR_ID.ToString())); } //方法依据描述 if (!String.IsNullOrEmpty(tBaseMethodInfo.DESCRIPTION.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND DESCRIPTION = '{0}'", tBaseMethodInfo.DESCRIPTION.ToString())); } //0为在使用、1为停用 if (!String.IsNullOrEmpty(tBaseMethodInfo.IS_DEL.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND IS_DEL = '{0}'", tBaseMethodInfo.IS_DEL.ToString())); } //备注1 if (!String.IsNullOrEmpty(tBaseMethodInfo.REMARK1.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK1 = '{0}'", tBaseMethodInfo.REMARK1.ToString())); } //备注2 if (!String.IsNullOrEmpty(tBaseMethodInfo.REMARK2.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK2 = '{0}'", tBaseMethodInfo.REMARK2.ToString())); } //备注3 if (!String.IsNullOrEmpty(tBaseMethodInfo.REMARK3.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK3 = '{0}'", tBaseMethodInfo.REMARK3.ToString())); } //备注4 if (!String.IsNullOrEmpty(tBaseMethodInfo.REMARK4.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK4 = '{0}'", tBaseMethodInfo.REMARK4.ToString())); } //备注5 if (!String.IsNullOrEmpty(tBaseMethodInfo.REMARK5.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK5 = '{0}'", tBaseMethodInfo.REMARK5.ToString())); } } return(strWhereStatement.ToString()); }
/// <summary> /// 获得查询结果总行数,用于分页 /// </summary> /// <param name="tBaseMethodInfo">对象</param> /// <returns>返回行数</returns> public int GetSelectResultCount(TBaseMethodInfoVo tBaseMethodInfo) { string strSQL = "select Count(*) from T_BASE_METHOD_INFO " + this.BuildWhereStatement(tBaseMethodInfo); return(Convert.ToInt32(SqlHelper.ExecuteScalar(strSQL))); }
/// <summary> /// 对象明细 /// </summary> /// <param name="tBaseMethodInfo">对象条件</param> /// <returns>对象</returns> public TBaseMethodInfoVo Details(TBaseMethodInfoVo tBaseMethodInfo) { return(access.Details(tBaseMethodInfo)); }
/// <summary> /// 根据对象特征获取单一对象 /// </summary> /// <param name="tBaseMethodInfo">对象</param> /// <returns></returns> public TBaseMethodInfoVo SelectByObject(TBaseMethodInfoVo tBaseMethodInfo) { return(access.SelectByObject(tBaseMethodInfo)); }
/// <summary> /// 获取对象List /// </summary> /// <param name="tBaseMethodInfo">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public List <TBaseMethodInfoVo> SelectByObject(TBaseMethodInfoVo tBaseMethodInfo, int iIndex, int iCount) { return(access.SelectByObject(tBaseMethodInfo, iIndex, iCount)); }
/// <summary> /// 对象添加 /// </summary> /// <param name="sysRole">对象</param> /// <returns>是否成功</returns> public bool Create(TBaseMethodInfoVo tBaseMethodInfo) { return(access.Create(tBaseMethodInfo)); }
/// <summary> /// 根据对象获取全部数据,用Table承载 /// 数据量较小时使用【不推荐】 /// </summary> /// <param name="tBaseMethodInfo"></param> /// <returns></returns> public DataTable SelectByTable(TBaseMethodInfoVo tBaseMethodInfo) { return(access.SelectByTable(tBaseMethodInfo)); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tBaseMethodInfo">用户对象</param> /// <returns>是否成功</returns> public bool Edit(TBaseMethodInfoVo tBaseMethodInfo) { return(access.Edit(tBaseMethodInfo)); }
/// <summary> /// 根据对象获取全部数据,用Table承载 /// 数据量较小时使用【不推荐】 /// </summary> /// <param name="tBaseMethodInfo"></param> /// <returns></returns> public DataTable SelectByTable(TBaseMethodInfoVo tBaseMethodInfo) { string strSQL = "select * from T_BASE_METHOD_INFO " + this.BuildWhereStatement(tBaseMethodInfo); return(SqlHelper.ExecuteDataTable(strSQL)); }
/// <summary> /// 对象添加 /// </summary> /// <param name="tBaseMethodInfo">对象</param> /// <returns>是否成功</returns> public bool Create(TBaseMethodInfoVo tBaseMethodInfo) { string strSQL = SqlHelper.BuildInsertExpress(tBaseMethodInfo, TBaseMethodInfoVo.T_BASE_METHOD_INFO_TABLE); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }