Esempio n. 1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ModTS_DEPT GetModel(string C_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,C_PARENT_ID,C_CODE,C_NAME,C_DESC,N_STATUS,C_DEPTH,N_DEPTATTR,C_EMP_ID,C_EMP_NAME,D_MOD_DT from TS_DEPT ");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID", OracleDbType.Varchar2, 50)
            };
            parameters[0].Value = C_ID;

            ModTS_DEPT model = new ModTS_DEPT();
            DataSet    ds    = DbHelperOra.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(ModTS_USER_FUN_PCI model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update TS_USER_FUN_PCI set ");
            strSql.Append("C_ID=:C_ID,");
            strSql.Append("C_MODULE_ID=:C_MODULE_ID,");
            strSql.Append("C_USER_ID=:C_USER_ID,");
            strSql.Append("C_FUNCTION_TYPE=:C_FUNCTION_TYPE,");
            strSql.Append("D_MOD_DT=:D_MOD_DT");
            strSql.Append(" where ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID",            OracleDbType.Varchar2, 50),
                new OracleParameter(":C_MODULE_ID",     OracleDbType.Varchar2, 20),
                new OracleParameter(":C_USER_ID",       OracleDbType.Varchar2, 20),
                new OracleParameter(":C_FUNCTION_TYPE", OracleDbType.Varchar2,  5),
                new OracleParameter(":D_MOD_DT",        OracleDbType.Date)
            };
            parameters[0].Value = model.C_ID;
            parameters[1].Value = model.C_MODULE_ID;
            parameters[2].Value = model.C_USER_ID;
            parameters[3].Value = model.C_FUNCTION_TYPE;
            parameters[4].Value = model.D_MOD_DT;

            int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ModTS_MODULE GetModel(string C_MODULEID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_MODULEID,C_PARENTMODULEID,C_MODULENAME,C_ASSEMBLYNAME,C_MODULECLASS,C_DISABLE,N_ORDER,N_IMAGEINDEX,C_MODULE_TYPE,C_QUERY_STR,C_REMARK,C_EMP_ID,D_MOD_DT from TS_MODULE ");
            strSql.Append(" where C_MODULEID=:C_MODULEID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_MODULEID", OracleDbType.Varchar2, 20)
            };
            parameters[0].Value = C_MODULEID;

            ModTS_MODULE model = new ModTS_MODULE();
            DataSet      ds    = DbHelperOra.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }