Example #1
0
        /// <summary>
        /// 用户信息修改
        /// </summary>
        /// <param name="info">用户信息</param>
        /// <param name="msg">成功、错误或异常信息</param>
        /// <returns>0-成功  大于0-失败   小于0-异常</returns>
        public int DB_ModifyInfo(UserInfo info, out string msg)
        {
            msg = "";

            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            int ret = -1;

            try
            {
                bool _flag = false;

                string updateText = _builder.GetModifyLandSql(info.openid, info.name, info.phone, info.idcardno,
                                                              info.address, info.headurl, info.usertype, out _flag, out msg);
                ArrayList listSql = new ArrayList();
                listSql.Add(updateText);

                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, updateText);

                if (!_flag)
                {
                    ret = 10;
                    return(ret);
                }


                DbHelperOra.ExecuteSqlTran(listSql, connection);
                //ret:影响的记录数
                msg = "修改用户信息成功";
                ret = 0;

                return(ret);
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);

                msg = GetExceptionInfo(ex);
                ret = -1;
                return(ret);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }