| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data.Common; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using Common; |
| | |
| | | /// <returns></returns> |
| | | public bool Add(GwClientProduct gcp) |
| | | { |
| | | return OracleHelper.ExecuteSql("insert into GW_Client_Product(id,client_id,product_id) values(:id,:client_id,:product_id)", OracleHelper.Connection, new OracleParameter(":id", (object)gcp.Id), new OracleParameter(":client_id", (object)gcp.ClientId), new OracleParameter(":product_id", (object)gcp.ProductId)) > 0; |
| | | return OracleHelper.ExecuteSql("insert into GW_Client_Product(id,client_id,product_id,sp_id,ACTIVATE_STATUS) values(:id,:client_id,:product_id,:sp_id,:ACTIVATE_STATUS)", |
| | | OracleHelper.Connection, new OracleParameter(":id", (object)gcp.Id), new OracleParameter(":client_id", (object)gcp.ClientId), |
| | | new OracleParameter(":product_id", gcp.ProductId),new OracleParameter(":sp_id",gcp.SpId), |
| | | new OracleParameter(":ACTIVATE_STATUS", gcp.ActivateStatus)) > 0; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新 |
| | | /// </summary> |
| | | /// <param name="gcp"></param> |
| | | /// <returns></returns> |
| | | public bool Update(GwClientProduct gcp) |
| | | { |
| | | return OracleHelper.ExecuteSql("update GW_Client_Product set product_id=:product_id,client_id=:client_id where sp_id=:sp_id ", |
| | | OracleHelper.Connection, new OracleParameter(":product_id", gcp.ProductId), new OracleParameter(":sp_id", gcp.SpId), |
| | | new OracleParameter(":client_id",gcp.ClientId) |
| | | ) > 0; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 查找账号是否存在 |
| | | /// </summary> |
| | | /// <param name="spid"></param> |
| | | /// <returns></returns> |
| | | public bool FindBySp(string spid) |
| | | { |
| | | using (OracleDataReader oracleDataReader = OracleHelper.ExecuteReader(string.Format("select * from GW_Client_Product where SP_ID=:SP_ID"), OracleHelper.Connection, new OracleParameter(":SP_ID", spid))) |
| | | { |
| | | if (oracleDataReader.Read()) |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |