本文整理汇总了C#中API.DAL.ConnectionManager.CloseConnection方法的典型用法代码示例。如果您正苦于以下问题:C# ConnectionManager.CloseConnection方法的具体用法?C# ConnectionManager.CloseConnection怎么用?C# ConnectionManager.CloseConnection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类API.DAL.ConnectionManager
的用法示例。
在下文中一共展示了ConnectionManager.CloseConnection方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadMailInfo
public DataSet LoadMailInfo(Int32 ReportID)
{
ConnectionManager conManager = new ConnectionManager(ConName);
IDataReader reader = null;
try
{
DataSet dsRef = new DataSet();
const String spName = "spGetMailInfo";
conManager.OpenDataReader(out reader, spName, ReportID);
dsRef = Util.DataReaderToDataSet(reader);
return dsRef;
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (conManager != null)
{
conManager.CloseConnection();
conManager.Dispose();
}
if (reader.IsNotNull() && reader.IsClosed.IsFalse())
reader.Close();
}
}
示例2: LoadReportSourceDataSet
public void LoadReportSourceDataSet(ref DataSet dsRef, CommandType cmdType, String strCmdText, IDbDataParameter[] sqlParam)
{
ConnectionManager conManager = new ConnectionManager(ConName);
IDataReader reader = null;
try
{
if (sqlParam.IsNull() || sqlParam.Length.IsZero())
conManager.OpenDataReader(strCmdText, out reader);
else
conManager.OpenDataReader(out reader, strCmdText, sqlParam);
//
dsRef = Util.DataReaderToDataSet(reader);
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (conManager != null)
{
conManager.CloseConnection();
conManager.Dispose();
}
if (reader.IsNotNull() && reader.IsClosed.IsFalse())
reader.Close();
}
}
示例3: LoadReportTreeInfo
public void LoadReportTreeInfo(ref DataSet dsRef)
{
ConnectionManager conManager = new ConnectionManager(ConName);
IDataReader reader = null;
try
{
const String spName = "spWebReportSuite";
conManager.OpenDataReader(out reader, spName, 1, 0);
dsRef = Util.DataReaderToDataSet(reader);
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (conManager != null)
{
conManager.CloseConnection();
conManager.Dispose();
}
if (reader.IsNotNull() && reader.IsClosed.IsFalse())
reader.Close();
}
}
示例4: GetReportList
public static CustomList<ReportSuiteMenu> GetReportList()
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
CustomList<ReportSuiteMenu> ReportSuiteMenuCollection = new CustomList<ReportSuiteMenu>();
IDataReader reader = null;
String sql = "EXEC spGetReportList";
try
{
conManager.OpenDataReader(sql, out reader);
while (reader.Read())
{
ReportSuiteMenu newReportSuiteMenu = new ReportSuiteMenu();
newReportSuiteMenu.REPORTID = reader.GetInt32("REPORTID");
newReportSuiteMenu.NODE_TEXT = reader.GetString("NODE_TEXT");
ReportSuiteMenuCollection.Add(newReportSuiteMenu);
}
return ReportSuiteMenuCollection;
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (conManager != null)
{
conManager.CloseConnection();
conManager.Dispose();
}
if (reader != null && !reader.IsClosed)
reader.Close();
}
}
示例5: GetReportSuiteMenu
public static CustomList<ReportSuiteMenu> GetReportSuiteMenu()
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
CustomList<ReportSuiteMenu> ReportSuiteMenuCollection = new CustomList<ReportSuiteMenu>();
IDataReader reader = null;
String sql = "EXEC spGetUserWiseProfileReport";
try
{
conManager.OpenDataReader(sql, out reader);
while (reader.Read())
{
ReportSuiteMenu newReportSuiteMenu = new ReportSuiteMenu();
newReportSuiteMenu.SetData(reader);
ReportSuiteMenuCollection.Add(newReportSuiteMenu);
}
return ReportSuiteMenuCollection;
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (conManager != null)
{
conManager.CloseConnection();
conManager.Dispose();
}
if (reader != null && !reader.IsClosed)
reader.Close();
}
}
示例6: GetReportValueEmp
public static CustomList<ParameterFilterValue> GetReportValueEmp(string search)
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
CustomList<ParameterFilterValue> ParameterFilterValueCollection = new CustomList<ParameterFilterValue>();
IDataReader reader = null;
String sql = "Exec spReportViewerEmpSearch " + search;
try
{
conManager.OpenDataReader(sql, out reader);
while (reader.Read())
{
ParameterFilterValue newParameterFilterValue = new ParameterFilterValue();
newParameterFilterValue.SetData(reader);
ParameterFilterValueCollection.Add(newParameterFilterValue);
}
return ParameterFilterValueCollection;
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (conManager != null)
{
conManager.CloseConnection();
conManager.Dispose();
}
if (reader != null && !reader.IsClosed)
reader.Close();
}
}
示例7: GetReportValueDesig
public static CustomList<ParameterFilterValue> GetReportValueDesig(string orgKey)
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
CustomList<ParameterFilterValue> ParameterFilterValueCollection = new CustomList<ParameterFilterValue>();
IDataReader reader = null;
String sql = "select DesigKey As ActualValues, DesigName As DisplayMember, DesigName As [Values] from Gen_Desig Where OrgKey in(" + orgKey + ")";
try
{
conManager.OpenDataReader(sql, out reader);
while (reader.Read())
{
ParameterFilterValue newParameterFilterValue = new ParameterFilterValue();
newParameterFilterValue.SetData(reader);
ParameterFilterValueCollection.Add(newParameterFilterValue);
}
return ParameterFilterValueCollection;
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (conManager != null)
{
conManager.CloseConnection();
conManager.Dispose();
}
if (reader != null && !reader.IsClosed)
reader.Close();
}
}
示例8: GetAllLeftMenuItemsByUserCodeAndApplicationID
public static CustomList<LeftMenuItems> GetAllLeftMenuItemsByUserCodeAndApplicationID(string userCode, int applicationId)
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
CustomList<LeftMenuItems> LeftMenuItemsCollection = new CustomList<LeftMenuItems>();
IDataReader reader = null;
if (HttpContext.Current.Session["UserSession_LeftMenu"] != null)
return (CustomList<LeftMenuItems>)HttpContext.Current.Session["UserSession_LeftMenu"];
conManager.OpenDataReader(out reader, "spWebGetMenusByUserAndApplication", userCode, applicationId);
try
{
while (reader.Read())
{
LeftMenuItems newLeftMenuItems = new LeftMenuItems();
newLeftMenuItems.SetData(reader);
LeftMenuItemsCollection.Add(newLeftMenuItems);
}
LeftMenuItemsCollection.InsertSpName = "spInsertLeftMenuItems";
LeftMenuItemsCollection.UpdateSpName = "spUpdateLeftMenuItems";
LeftMenuItemsCollection.DeleteSpName = "spDeleteLeftMenuItems";
HttpContext.Current.Session["UserSession_LeftMenu"] = LeftMenuItemsCollection;
return LeftMenuItemsCollection;
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (conManager != null)
{
conManager.CloseConnection();
conManager.Dispose();
}
if (reader != null && !reader.IsClosed)
reader.Close();
}
}
示例9: GetDefaultApplicationByUserCode
public static ApplicationUser GetDefaultApplicationByUserCode(string userCode)
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
IDataReader reader = null;
conManager.OpenDataReader(out reader, "spWebGetDefaultApplicationByUserCode", userCode);
ApplicationUser newApplication = new ApplicationUser(); try
{
while (reader.Read())
{
newApplication.SetData(reader);
}
return newApplication;
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (conManager != null)
{
conManager.CloseConnection();
conManager.Dispose();
}
if (reader != null && !reader.IsClosed)
reader.Close();
}
}
示例10: GetUserWiseHiddenControls
public static CustomList<UserWiseHiddenControls> GetUserWiseHiddenControls(String nameSpace, String formName, String userCode)
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
CustomList<UserWiseHiddenControls> UserWiseHiddenControlsCollection = new CustomList<UserWiseHiddenControls>();
IDataReader reader = null;
const String spName = "sqGetHiddenControls";
conManager.OpenDataReader(out reader, spName, nameSpace, formName, userCode);
try
{
while (reader.Read())
{
UserWiseHiddenControls newUserWiseHiddenControls = new UserWiseHiddenControls();
newUserWiseHiddenControls.SetData(reader);
UserWiseHiddenControlsCollection.Add(newUserWiseHiddenControls);
}
return UserWiseHiddenControlsCollection;
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (conManager != null)
{
conManager.CloseConnection();
conManager.Dispose();
}
if (reader != null && !reader.IsClosed)
reader.Close();
}
}
示例11: DoLogin
public static Users DoLogin(string userName, string password)
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
IDataReader reader = null;
conManager.OpenDataReader(out reader, "spWebLogin ", userName,password);
try
{
Users user = new Users();
while (reader.Read())
{
user.SetDataDoLogin(reader);
}
return user;
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (conManager != null)
{
conManager.CloseConnection();
conManager.Dispose();
}
if (reader != null && !reader.IsClosed)
reader.Close();
}
}
示例12: GetFormAccessRightsByUserCodeAndFormName
public static FormAccessRights GetFormAccessRightsByUserCodeAndFormName(string userCode, string formName)
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
IDataReader reader = null;
FormAccessRights newFormAccessRights = new FormAccessRights();
conManager.OpenDataReader(out reader, "spWebGetFormAccessRights", userCode, formName);
try
{
while (reader.Read())
{
newFormAccessRights.SetData(reader);
}
return newFormAccessRights;
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (conManager != null)
{
conManager.CloseConnection();
conManager.Dispose();
}
if (reader != null && !reader.IsClosed)
reader.Close();
}
}
示例13: GetAllMenuItemsByUserCode
public static CustomList<Menu> GetAllMenuItemsByUserCode(string UserCode)
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
CustomList<Menu> MenuCollection = new CustomList<Menu>();
IDataReader reader = null;
conManager.OpenDataReader(out reader, "spWebGetMenuAndAccessRights", UserCode);
try
{
while (reader.Read())
{
Menu newMenu = new Menu();
newMenu.SetData(reader);
MenuCollection.Add(newMenu);
}
MenuCollection.InsertSpName = "spInsertMenu";
MenuCollection.UpdateSpName = "spUpdateMenu";
MenuCollection.DeleteSpName = "spDeleteMenu";
return MenuCollection;
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (conManager != null)
{
conManager.CloseConnection();
conManager.Dispose();
}
if (reader != null && !reader.IsClosed)
reader.Close();
}
}
示例14: GetAllAccessRightsOfAPage
public static Menu GetAllAccessRightsOfAPage(string UserCode, int ObjectID)
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
IDataReader reader = null;
conManager.OpenDataReader(out reader, "spWebGetMenuAndAccessRights", UserCode, ObjectID);
try
{
Menu menu = new Menu();
while (reader.Read())
{
menu.SetData(reader);
}
return menu;
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (conManager != null)
{
conManager.CloseConnection();
conManager.Dispose();
}
if (reader != null && !reader.IsClosed)
reader.Close();
}
}