public SessionVariableManager(System.Web.SessionState.HttpSessionState session, System.Web.HttpServerUtility server, string userHostAddress, string pageName, Cache cache, System.Web.HttpApplicationState application)
 {
     _application     = application;
     _session         = session;
     _server          = server;
     _userHostAddress = userHostAddress;
     _pageName        = pageName;
     _cache           = cache;
 }
Ejemplo n.º 2
0
        public WorkflowManager(System.Web.HttpApplicationState application, System.Web.SessionState.HttpSessionState session, System.Web.HttpRequest request, System.Web.HttpResponse response)
        {
            // get reference to asp.net members
            this.Application = application;
            this.Session     = session;
            this.Request     = request;
            this.Response    = response;

            _PageToGoTO             = null;
            this.EventWatingDataSet = null;
            this.PreviousStateName  = null;
        }
Ejemplo n.º 3
0
 private IXpoDataStoreProvider GetDataStoreProvider(string connectionString, System.Data.IDbConnection connection) {
     System.Web.HttpApplicationState application = (System.Web.HttpContext.Current != null) ? System.Web.HttpContext.Current.Application : null;
     IXpoDataStoreProvider dataStoreProvider = null;
     if(application != null && application["DataStoreProvider"] != null) {
         dataStoreProvider = application["DataStoreProvider"] as IXpoDataStoreProvider;
     }
     else {
         dataStoreProvider = XPObjectSpaceProvider.GetDataStoreProvider(connectionString, connection, true);
         if(application != null) {
             application["DataStoreProvider"] = dataStoreProvider;
         }
     }
     return dataStoreProvider;
 }
Ejemplo n.º 4
0
        public static void LoadInitCode(System.Web.HttpApplicationState app)
        {
            SqlConnection conn = ConnectionPool.BorrowConnection();

            //DataTable dtRet = null;
            try
            {
                DataTable dtDept = SqlHelper.ExecuteDataTable(conn, CommandType.Text, "select * from tbDept");
                app["tbDept"] = dtDept;

                DataTable dtLogin = SqlHelper.ExecuteDataTable(conn, CommandType.Text, "select * from tbLogin");
                app["tbLogin"] = dtLogin;

                DataTable dtOper = SqlHelper.ExecuteDataTable(conn, CommandType.Text, "select * from tbOper");
                app["tbOper"] = dtOper;

                DataTable dtNameCode = SqlHelper.ExecuteDataTable(conn, CommandType.Text, "select * from tbNameCode");
                app["tbNameCode"] = dtNameCode;

                DataTable dtProductClass = SqlHelper.ExecuteDataTable(conn, CommandType.Text, "select * from tbProductClass");
                app["tbProductClass"] = dtProductClass;

                DataTable dtInventory = SqlHelper.ExecuteDataTable(conn, CommandType.Text, "select * from tbInventory");
                app["tbInventory"] = dtInventory;

                DataTable dtComputationGroup = SqlHelper.ExecuteDataTable(conn, CommandType.Text, "select * from tbcomputationgroup");
                app["tbComputationGroup"] = dtComputationGroup;

                DataTable dtComputationUnit = SqlHelper.ExecuteDataTable(conn, CommandType.Text, "select * from tbcomputationUnit");
                app["tbComputationUnit"] = dtComputationUnit;

                DataTable dtWarehouse = SqlHelper.ExecuteDataTable(conn, CommandType.Text, "select * from tbWarehouse");
                app["tbWarehouse"] = dtWarehouse;
            }
            catch (Exception ex)
            {
                LogAdapter.WriteFeaturesException(ex);
                throw ex;
            }
            finally
            {
                ConnectionPool.ReturnConnection(conn);
            }
        }
Ejemplo n.º 5
0
        private IXpoDataStoreProvider GetDataStoreProvider(string connectionString, System.Data.IDbConnection connection)
        {
            System.Web.HttpApplicationState application       = (System.Web.HttpContext.Current != null) ? System.Web.HttpContext.Current.Application : null;
            IXpoDataStoreProvider           dataStoreProvider = null;

            if (application != null && application["DataStoreProvider"] != null)
            {
                dataStoreProvider = application["DataStoreProvider"] as IXpoDataStoreProvider;
            }
            else
            {
                dataStoreProvider = DemoXPODatabaseHelper.GetDataStoreProvider(connectionString, connection, !MainDemoModule.IsSiteMode);
                if (application != null)
                {
                    application["DataStoreProvider"] = dataStoreProvider;
                }
            }
            return(dataStoreProvider);
        }
Ejemplo n.º 6
0
        private IXpoDataStoreProvider GetDataStoreProvider(string connectionString, System.Data.IDbConnection connection)
        {
            System.Web.HttpApplicationState application = System.Web.HttpContext.Current?.Application;
            IXpoDataStoreProvider           dataStoreProvider;

            if (application != null && application["DataStoreProvider"] != null)
            {
                dataStoreProvider = application["DataStoreProvider"] as IXpoDataStoreProvider;
            }
            else
            {
                dataStoreProvider = new CachedDataStoreProvider(connectionString, connection, true);
                if (application != null)
                {
                    application["DataStoreProvider"] = dataStoreProvider;
                }
            }
            return(dataStoreProvider);
        }
Ejemplo n.º 7
0
 private void CreateXPObjectSpaceProvider(string connectionString, CreateCustomObjectSpaceProviderEventArgs e) {
     System.Web.HttpApplicationState application = (System.Web.HttpContext.Current != null) ? System.Web.HttpContext.Current.Application : null;
     IXpoDataStoreProvider dataStoreProvider = null;
     if(application != null && application["DataStoreProvider"] != null) {
         dataStoreProvider = application["DataStoreProvider"] as IXpoDataStoreProvider;
         e.ObjectSpaceProvider = new XPObjectSpaceProvider(dataStoreProvider, true);
     }
     else {
         if(!String.IsNullOrEmpty(connectionString)) {
             connectionString = DevExpress.Xpo.XpoDefault.GetConnectionPoolString(connectionString);
             dataStoreProvider = new ConnectionStringDataStoreProvider(connectionString, true);
         }
         else if(e.Connection != null) {
             dataStoreProvider = new ConnectionDataStoreProvider(e.Connection);
         }
         if (application != null) {
             application["DataStoreProvider"] = dataStoreProvider;
         }
         e.ObjectSpaceProvider = new XPObjectSpaceProvider(dataStoreProvider, true);
     }
 }
Ejemplo n.º 8
0
        private bool Server()
        {
            bool http = false;

            try
            {
                System.Web.HttpApplicationState verifyHttp = System.Web.HttpContext.Current.Application;
                if (verifyHttp != null)
                {
                    http = true;
                }
                else
                {
                    http = false;
                }
            }
            catch
            {
                http = false;
            }
            return(http);
        }
Ejemplo n.º 9
0
 public Cache(System.Web.HttpApplicationState applicationState)
 {
     ApplicationState = applicationState;
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Get ExcelPackage's Stream from Page.Application
 /// </summary>
 /// <param name="Application"></param>
 /// <param name="name"></param>
 /// <returns></returns>
 public static System.IO.Stream getFromApplication(System.Web.HttpApplicationState Application, String name)
 {
     return(Application[name] as System.IO.Stream);
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Store ExcelPackage's Stream to Page.Application
 /// </summary>
 /// <param name="package"></param>
 /// <param name="Application"></param>
 /// <param name="name"></param>
 public static void storeToApplication(rf.OfficeOpenXml.ExcelPackage package, System.Web.HttpApplicationState Application, String name)
 {
     Application[name] = package.Stream;
 }
Ejemplo n.º 12
0
 public WebApplicationLogSink(System.Web.HttpApplicationState state, string file)
 {
     State = state;
     LogFile = file;
 }
Ejemplo n.º 13
0
 //*************************************************************
 public static void start_pop3(System.Web.HttpApplicationState app)
 {
     System.Threading.Thread thread = new System.Threading.Thread(threadproc_pop3);
     thread.Start(app);
 }
Ejemplo n.º 14
0
        public void ParaInit(System.Web.HttpApplicationState app)
        {
            try
            {
                DataSet dsIn = new DataSet();

                InitCode  inc     = new InitCode();
                Hashtable htapp   = (Hashtable)Application["appconf"];
                string    strcons = (string)htapp["cons"];
                DataSet   dsOut   = inc.LoadCodeTable(strcons);

                //错误返回表

                //返回结果存放到Application
                app["tbCommCode"]          = dsOut.Tables["tbCommCode"];
                app["AllMD"]               = dsOut.Tables["AllMD"];
                app["AllREGION"]           = dsOut.Tables["AllREGION"];
                app["AllMDP"]              = dsOut.Tables["AllMDP"];
                app["MAC"]                 = dsOut.Tables["MAC"];
                app["Goods"]               = dsOut.Tables["Goods"];
                app["PClass"]              = dsOut.Tables["PClass"];
                app["AllMaterial"]         = dsOut.Tables["AllMaterial"];
                app["Provider"]            = dsOut.Tables["Provider"];
                app["NewDept"]             = dsOut.Tables["NewDept"];
                app["tbNameCodeToStorage"] = dsOut.Tables["tbNameCodeToStorage"];
                app["tbFormula"]           = dsOut.Tables["tbFormula"];
                app["DeptMapInfo"]         = dsOut.Tables["DeptMapInfo"];
                app["AcctMonth"]           = dsOut.Tables["AcctMonth"];
                app["tbLocalLogin"]        = dsOut.Tables["tbLocalLogin"];

                app["tbCommCodeBDEPT"] = dsOut.Tables["tbCommCodeBDEPT"];
                Hashtable htOperFunc = new Hashtable();
                DataTable dttmp      = dsOut.Tables["OperFunc"];
                if (dttmp.Rows.Count > 0)
                {
                    string    strOperID  = "";
                    ArrayList alFuncList = null;
                    for (int i = 0; i < dttmp.Rows.Count; i++)
                    {
                        CMSMStruct.MenuStruct menu1 = new CMSMStruct.MenuStruct();
                        menu1.strFuncName    = dttmp.Rows[i]["vcFuncName"].ToString();
                        menu1.strFuncAddress = dttmp.Rows[i]["vcFuncAddress"].ToString();
                        if (strOperID == dttmp.Rows[i]["vcOperID"].ToString())
                        {
                            alFuncList.Add(menu1);
                            if (i == dttmp.Rows.Count - 1)
                            {
                                htOperFunc.Add(strOperID, alFuncList);
                            }
                        }
                        else
                        {
                            if (strOperID != "" && alFuncList.Count > 0)
                            {
                                htOperFunc.Add(strOperID, alFuncList);
                            }

                            alFuncList = new ArrayList();
                            alFuncList.Add(menu1);
                            strOperID = dttmp.Rows[i]["vcOperID"].ToString();
                            if (i == dttmp.Rows.Count - 1)
                            {
                                htOperFunc.Add(strOperID, alFuncList);
                            }
                        }
                    }
                }
                app["OperFunc"] = htOperFunc;

                Hashtable htIOTime = new Hashtable();
                dttmp = null;
                dttmp = dsOut.Tables["IOTime"];
                if (dttmp.Rows.Count > 0)
                {
                    string    strOfficer = "";
                    ArrayList altmp      = null;
                    for (int i = 0; i < dttmp.Rows.Count; i++)
                    {
                        CMSMStruct.SignIOTimeStruct sio1 = new CommCenter.CMSMStruct.SignIOTimeStruct();
                        sio1.strSIOTID    = dttmp.Rows[i]["iotName"].ToString();
                        sio1.strOfficer   = dttmp.Rows[i]["Officer"].ToString();
                        sio1.strClassName = dttmp.Rows[i]["vcClassName"].ToString();
                        sio1.strClassId   = dttmp.Rows[i]["vcClassId"].ToString();
                        sio1.strInTime    = dttmp.Rows[i]["InTime"].ToString();
                        sio1.strOutTime   = dttmp.Rows[i]["OutTime"].ToString();
                        if (strOfficer == sio1.strOfficer)
                        {
                            altmp.Add(sio1);
                            if (i == dttmp.Rows.Count - 1)
                            {
                                htIOTime.Add(strOfficer, altmp);
                            }
                        }
                        else
                        {
                            if (strOfficer != "" && altmp.Count > 0)
                            {
                                htIOTime.Add(strOfficer, altmp);
                            }

                            altmp = new ArrayList();
                            altmp.Add(sio1);
                            strOfficer = sio1.strOfficer;
                            if (i == dttmp.Rows.Count - 1)
                            {
                                htIOTime.Add(strOfficer, altmp);
                            }
                        }
                    }
                }
                app["IOTime"] = htIOTime;


                app.UnLock();
            }
            catch (Exception e)
            {
                AMSLog clog = new AMSLog();
                clog.WriteLine(e);
            }
        }