64 lines
1.9 KiB
C#
64 lines
1.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Data.OracleClient;
|
|
using System.Linq;
|
|
using WX.CRM.Common;
|
|
using WX.CRM.Model.Entity;
|
|
|
|
namespace WX.CRM.DAL.Csvr
|
|
{
|
|
public class CSVR_IDMAPDAL
|
|
{
|
|
public List<CSVR_IDMAP> GetResIdByCustomerIds(string selecttype)
|
|
{
|
|
OracleConnection conn = new OracleConnection(OracleHelper.AYCRMConn);
|
|
if (conn.State == ConnectionState.Closed)
|
|
conn.Open();
|
|
try
|
|
{
|
|
using (OracleTransaction trans = conn.BeginTransaction())
|
|
{
|
|
var p = new List<OracleParameter>
|
|
{
|
|
new OracleParameter { ParameterName = "v_selecttype", OracleType = OracleType.VarChar, Value = selecttype },
|
|
new OracleParameter
|
|
{
|
|
ParameterName = "v_sqldata",
|
|
OracleType = OracleType.Cursor,
|
|
Direction = ParameterDirection.Output
|
|
}
|
|
|
|
};
|
|
var ds = OracleHelper.DataQueray(trans, CommandType.StoredProcedure, "PACK_CSVR.CSVR_IDMAPNEWIDS", p.ToArray());
|
|
trans.Commit();
|
|
return ds.Tables[0].ToList<CSVR_IDMAP>();
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
|
|
throw;
|
|
}
|
|
finally
|
|
{
|
|
if (conn.State == ConnectionState.Open)
|
|
conn.Close();
|
|
}
|
|
}
|
|
|
|
public bool InserCustomerIds(DataTable dt)
|
|
{
|
|
try
|
|
{
|
|
OracleHelper.BulkToDB(dt, "TEMP_CUSTOMERTURN");
|
|
return true;
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
}
|
|
}
|