Exemplo n.º 1
0
 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();
     }
 }
Exemplo n.º 2
0
 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();
     }
 }
Exemplo n.º 3
0
        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();
            }
        }
Exemplo n.º 4
0
        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();
            }
        }
Exemplo n.º 5
0
        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();
            }
        }
Exemplo n.º 6
0
        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();
            }
        }
Exemplo n.º 7
0
        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();
            }
        }
Exemplo n.º 8
0
        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();
            }
        }
Exemplo n.º 9
0
        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();
            }
        }
Exemplo n.º 10
0
        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();
            }
        }
Exemplo n.º 11
0
        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();
            }
        }
Exemplo n.º 12
0
        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();
            }
        }
Exemplo n.º 13
0
        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();
            }
        }
Exemplo n.º 14
0
        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();
            }
        }