当前位置: 首页>>代码示例>>C#>>正文


C# ConnectionManager.CloseConnection方法代码示例

本文整理汇总了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();
     }
 }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:27,代码来源:ReportSuite.cs

示例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();
     }
 }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:28,代码来源:ReportSuite.cs

示例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();
            }
        }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:26,代码来源:ReportSuite.cs

示例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();
            }
        }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:34,代码来源:ReportSuiteMenu.cs

示例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();
            }
        }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:33,代码来源:ReportSuiteMenu.cs

示例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();
            }
        }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:33,代码来源:ParameterFilterValue.cs

示例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();
            }
        }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:33,代码来源:ParameterFilterValue.cs

示例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();
            }
        }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:42,代码来源:LeftMenuItems.cs

示例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();
            }
        }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:30,代码来源:ApplicationUser.cs

示例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();
            }
        }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:33,代码来源:UserWiseHiddenControls.cs

示例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();
            }
        }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:30,代码来源:Users.cs

示例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();
            }
        }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:32,代码来源:FormAccessRights.cs

示例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();
            }
        }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:36,代码来源:Menu.cs

示例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();
            }
        }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:30,代码来源:Menu.cs


注:本文中的API.DAL.ConnectionManager.CloseConnection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。