| | |
| | | |
| | | using Common; |
| | | using Model; |
| | | using Oracle.DataAccess.Client; |
| | | using Oracle.ManagedDataAccess.Client; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | |
| | | /// <param name="supportStaff">归属客服人员</param> |
| | | /// <param name="productId">产品ID</param> |
| | | /// <returns></returns> |
| | | //public List<GwClient> LoadInfoList(out int recordCount, int pageIndex, int pageSizestring, string clientID, string clientName, string telphone, string agent) |
| | | public List<GwClient> LoadInfoList(out int recordCount, int pageIndex, int pageSizestring, string clientID, string clientName, string telephone, string agent, string company, string salesman, string supportStaff, string productId, int isEnable, string permissionsSQL ) |
| | | public List<GwClient> LoadInfoList(out int recordCount, int pageIndex, int pageSizestring, string clientID, string clientName, string telephone, string agent, string company, string salesman, string supportStaff, string productId, int isEnable,int isSub, string permissionsSQL ) |
| | | { |
| | | |
| | | List<GwClient> list = new List<GwClient>(); |
| | |
| | | stringBuilder.Append(" ) t on t.client_id = gwc.client_id "); |
| | | //stringBuilder.Append("from GW_CLIENT where 1=1"); |
| | | stringBuilder.Append(" WHERE 1=1"); |
| | | OracleParameter[] oracleParameterArray = new OracleParameter[8]; |
| | | OracleParameter[] oracleParameterArray = new OracleParameter[9]; |
| | | if (clientID != null && clientID != "") |
| | | { |
| | | oracleParameterArray[0] = new OracleParameter(":ClientID", (OracleDbType)126); |
| | |
| | | stringBuilder.Append(" and gwc.IS_ENABLE = :IS_ENABLE"); |
| | | } |
| | | |
| | | //是否一级账户。0为一级 |
| | | if (isSub == 0) |
| | | { |
| | | oracleParameterArray[8] = new OracleParameter(":CLIENT_PARENTID", OracleDbType.Int32); |
| | | ((DbParameter)oracleParameterArray[8]).Value = (object)(isSub); |
| | | stringBuilder.Append(" and gwc.CLIENT_PARENTID = :CLIENT_PARENTID"); |
| | | } |
| | | else |
| | | { |
| | | oracleParameterArray[8] = new OracleParameter(":CLIENT_PARENTID", OracleDbType.Int32); |
| | | ((DbParameter)oracleParameterArray[8]).Value = (object)(isSub); |
| | | stringBuilder.Append(" and gwc.CLIENT_PARENTID != 0"); |
| | | } |
| | | |
| | | |
| | | if (productId != null && productId != "") |
| | | { |
| | | stringBuilder.Append(" and gwc.CLIENT_ID IN ( SELECT distinct CLIENT_ID FROM GW_SP WHERE PRODUCT_ID = '" + productId + "' )"); |
| | | } |
| | | |
| | | |
| | | //客户权限SQL脚本 |
| | | stringBuilder.Append(permissionsSQL); |
| | |
| | | */ |
| | | public bool UpdateClientAmount(Int64 AddBalance, Int64 payAmount, string clientId ) |
| | | { |
| | | return OracleHelper.ExecuteSql("UPDATE GW_CLIENT SET BALANCE=(BALANCE + :BALANCE), TOP_UP_AMOUNT_TOTAL=(TOP_UP_AMOUNT_TOTAL + :TOP_UP_AMOUNT_TOTAL) WHERE CLIENT_ID=:CLIENT_ID", OracleHelper.Connection, new OracleParameter(":BALANCE", (object)AddBalance), new OracleParameter(":TOP_UP_AMOUNT_TOTAL", (object)payAmount), new OracleParameter(":CLIENT_ID", (object)clientId)) > 0; |
| | | return OracleHelper.ExecuteSql("UPDATE GW_CLIENT SET BALANCE=(BALANCE + :BALANCE)," + |
| | | " TOP_UP_AMOUNT_TOTAL=(TOP_UP_AMOUNT_TOTAL + :TOP_UP_AMOUNT_TOTAL) WHERE CLIENT_ID=:CLIENT_ID", |
| | | OracleHelper.Connection, new OracleParameter(":BALANCE", (object)AddBalance), |
| | | new OracleParameter(":TOP_UP_AMOUNT_TOTAL", (object)payAmount), new OracleParameter(":CLIENT_ID", (object)clientId)) > 0; |
| | | } |
| | | |
| | | public bool UpdateClientProduct(string clientId, string productId) |
| | |
| | | o.SupportStaff = oracleReaderWrapper.GetString("SUPPORT_STAFF", ""); |
| | | o.FinancialStaff = oracleReaderWrapper.GetString("FINANCIAL_STAFF", ""); |
| | | o.ChargeType = oracleReaderWrapper.GetInt("CHARGE_TYPE", 0); |
| | | o.SmsBillType = oracleReaderWrapper.GetInt("SMS_BILLTYPE",0); |
| | | o.SmsStatusReport = oracleReaderWrapper.GetInt("SMS_STATUS_REPORT", 0); |
| | | o.MmsStatusReport = oracleReaderWrapper.GetInt("MMS_STATUS_REPORT", 0); |
| | | |