using System;
|
using System.Collections.Generic;
|
using System.Text;
|
using System.Data;
|
|
namespace BLL
|
{
|
public class ClsIF_ORGANIZATIONS_View
|
{
|
|
/// <summary>
|
/// 根据组织名称 返回组织内码
|
/// </summary>
|
/// <param name="HDataCenterName"></param>
|
/// <param name="sErrMsg"></param>
|
/// <returns></returns>
|
public Int64 get_ORGANIZATIONSIDByName(string HDataCenterName, ref string sErrMsg)
|
{
|
try
|
{
|
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
|
DataSet ds = oCN.RunProcReturn("select HItemID from h_v_CLD_ORGANIZATIONSList where Hname='" + HDataCenterName + "'", "h_v_CLD_ORGANIZATIONSList");
|
if (ds == null || ds.Tables[0].Rows.Count == 0)
|
{
|
return -1;
|
}
|
else
|
{
|
return DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HItemID"]);
|
}
|
}
|
catch (Exception e)
|
{
|
sErrMsg = sErrMsg + "," + e.Message;
|
return -1;
|
}
|
}
|
|
/// <summary>
|
/// 根据组织名称获取组织代码
|
/// </summary>
|
/// <param name="HDataCenterName"></param>
|
/// <param name="sErrMsg"></param>
|
/// <returns></returns>
|
public string get_ORGANIZATIONSNOByName(string HDataCenterName, ref string sErrMsg)
|
{
|
try
|
{
|
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
|
DataSet ds = oCN.RunProcReturn("select HNumber from h_v_CLD_ORGANIZATIONSList where Hname='" + HDataCenterName + "'", "h_v_CLD_ORGANIZATIONSList");
|
if (ds == null || ds.Tables[0].Rows.Count == 0)
|
{
|
return "";
|
}
|
else
|
{
|
return DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HNumber"]);
|
}
|
}
|
catch (Exception e)
|
{
|
sErrMsg = sErrMsg + "," + e.Message;
|
return "";
|
}
|
}
|
|
/// <summary>
|
/// 返回组织列表
|
/// </summary>
|
/// <returns></returns>
|
public DataSet get_ORGANIZATIONSList(ref string sErrMsg)
|
{
|
try
|
{
|
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
|
return oCN.RunProcReturn("select * from h_v_CLD_ORGANIZATIONSList", "h_v_CLD_ORGANIZATIONSList");
|
}
|
catch (Exception e)
|
{
|
sErrMsg = sErrMsg + "," + e.Message;
|
return null;
|
}
|
}
|
|
|
}
|
}
|