Inheritance: System.Collections.Specialized.NameObjectCollectionBase
Example #1
0
    public Orders()
    {
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools           = ToolsFactory.CreateTools();
        encrypt         = EncryptFactory.CreateEncrypt();
        MyOrders        = OrdersFactory.CreateOrders();
        Mylog           = OrdersLogFactory.CreateOrdersLog();
        MyDelivery      = DeliveryWayFactory.CreateDeliveryWay();
        MyPayway        = PayWayFactory.CreatePayWay();
        MyProduct       = ProductFactory.CreateProduct();
        Mypackage       = PackageFactory.CreatePackage();
        Myorderdelivery = OrdersDeliveryFactory.CreateOrdersDelivery();
        MyFavorFee      = PromotionFavorFeeFactory.CreatePromotionFavorFee();
        MyCoupon        = PromotionFavorCouponFactory.CreatePromotionFavorCoupon();
        MyBack          = OrdersBackApplyFactory.CreateOrdersBackApply();
        MyPolicy        = PromotionFavorPolicyFactory.CreatePromotionFavorPolicy();
        MySupplier      = SupplierFactory.CreateSupplier();
        Mydelierytime   = DeliveryTimeFactory.CreateDeliveryTime();
        MyMember        = MemberFactory.CreateMember();
        MyConsumption   = MemberConsumptionFactory.CreateMemberConsumption();
        pageurl         = new PageURL(int.Parse(Application["Static_IsEnable"].ToString()));
        MyAccountLog    = MemberAccountLogFactory.CreateMemberAccountLog();
        MyFavor         = PromotionFavorFactory.CreatePromotionFavor();
        MyCouponRule    = PromotionCouponRuleFactory.CreatePromotionFavorCoupon();
        MyInvoice       = OrdersInvoiceFactory.CreateOrdersInvoice();
    }
Example #2
0
 // 12/22/2007 Paul.  Inside the timer event, there is no current context, so we need to pass the application.
 public static DataTable Parent(HttpApplicationState Application, string sPARENT_TYPE, Guid gPARENT_ID)
 {
     DataTable dt = new DataTable();
     string sTABLE_NAME = Sql.ToString(Application["Modules." + sPARENT_TYPE + ".TableName"]);
     if ( !Sql.IsEmptyString(sTABLE_NAME) )
     {
         DbProviderFactory dbf = DbProviderFactories.GetFactory(Application);
         using ( IDbConnection con = dbf.CreateConnection() )
         {
             con.Open();
             string sSQL;
             sSQL = "select *"                + ControlChars.CrLf
                  + "  from vw" + sTABLE_NAME + ControlChars.CrLf
                  + " where ID = @ID"         + ControlChars.CrLf;
             using ( IDbCommand cmd = con.CreateCommand() )
             {
                 cmd.CommandText = sSQL;
                 Sql.AddParameter(cmd, "@ID", gPARENT_ID);
                 using ( DbDataAdapter da = dbf.CreateDataAdapter() )
                 {
                     ((IDbDataAdapter)da).SelectCommand = cmd;
                     da.Fill(dt);
                 }
             }
         }
     }
     return dt;
 }
Example #3
0
    public ZhongXin()
    {
        //初始化ASP.NET内置对象
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools      = ToolsFactory.CreateTools();
        MyBLL      = ZhongXinFactory.Create();
        MySupplier = SupplierFactory.CreateSupplier();
        DBHelper   = SQLHelperFactory.CreateSQLHelper();

        pub          = new Public_Class();
        sendmessages = new ZhongXinUtil.SendMessages();

        //Supplier_ID = tools.CheckInt(Session["supplier_id"].ToString());
        //佣金
        CommissionAccNo = System.Configuration.ConfigurationManager.AppSettings["zhongxin_commissionaccno"];
        CommissionAccNm = System.Configuration.ConfigurationManager.AppSettings["zhongxin_commissionaccnm"];
        //交易保证金
        GuaranteeAccNo = System.Configuration.ConfigurationManager.AppSettings["zhongxin_dealguaranteeaccno"];
        GuaranteeAccNm = System.Configuration.ConfigurationManager.AppSettings["zhongxin_dealguaranteeaccnm"];
    }
Example #4
0
    public Cart()
    {
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools         = ToolsFactory.CreateTools();
        encrypt       = EncryptFactory.CreateEncrypt();
        MyOrders      = OrdersFactory.CreateOrders();
        MyCart        = OrdersGoodsTmpFactory.CreateOrdersGoodsTmp();
        MyProduct     = ProductFactory.CreateProduct();
        MyMem         = MemberFactory.CreateMember();
        Mypackage     = PackageFactory.CreatePackage();
        MyAddr        = MemberAddressFactory.CreateMemberAddress();
        MyDelivery    = DeliveryWayFactory.CreateDeliveryWay();
        MyPayway      = PayWayFactory.CreatePayWay();
        Mydelierytime = DeliveryTimeFactory.CreateDeliveryTime();
        MyInvioce     = OrdersInvoiceFactory.CreateOrdersInvoice();
        MyFavorFee    = PromotionFavorFeeFactory.CreatePromotionFavorFee();
        MyCoupon      = PromotionFavorCouponFactory.CreatePromotionFavorCoupon();
        MyPolicy      = PromotionFavorPolicyFactory.CreatePromotionFavorPolicy();
        MyGift        = PromotionFavorGiftFactory.CreatePromotionFavorGift();
        MyCommission  = SupplierCommissionCategoryFactory.CreateSupplierCommissionCategory();
        MySupplier    = SupplierFactory.CreateSupplier();
        MyFavor       = PromotionFavorFactory.CreatePromotionFavor();
        MyLimit       = PromotionLimitFactory.CreatePromotionLimit();
        MyMemberFavor = MemberFavoritesFactory.CreateMemberFavorites();
        pageurl       = new PageURL(int.Parse(Application["Static_IsEnable"].ToString()));
    }
 public HttpApplicationStateWrapper(HttpApplicationState httpApplicationState)
 {
     if (httpApplicationState == null) {
         throw new ArgumentNullException("httpApplicationState");
     }
     _application = httpApplicationState;
 }
Example #6
0
        public Broker(HttpApplicationState app)
        {
            this._app = app;
            LogUtil.Setup();
            StartSuperWebSocketByConfig();

        }
Example #7
0
        public static void threadproc_tags(object obj)
        {
            System.Web.HttpApplicationState app = (System.Web.HttpApplicationState)obj;

            SortedDictionary <string, List <int> > tags = new SortedDictionary <string, List <int> >();

            // update the cache

            DataSet ds = btnet.DbUtil.get_dataset("select bg_id, bg_tags from bugs where isnull(bg_tags,'') <> ''");

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                string[] labels = btnet.Util.split_string_using_commas((string)dr[1]);

                // for each tag label, build a list of bugids that have that label
                for (int i = 0; i < labels.Length; i++)
                {
                    string label = normalize_tag(labels[i]);

                    if (label != "")
                    {
                        if (!tags.ContainsKey(label))
                        {
                            tags[label] = new List <int>();
                        }

                        tags[label].Add((int)dr[0]);
                    }
                }
            }

            app["tags"] = tags;
        }
Example #8
0
    public Member()
    {
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools         = ToolsFactory.CreateTools();
        MyMember      = MemberFactory.CreateMember();
        Mygrade       = MemberGradeFactory.CreateMemberGrade();
        MyMemLog      = MemberLogFactory.CreateMemberLog();
        encrypt       = EncryptFactory.CreateEncrypt();
        MyConsumption = MemberConsumptionFactory.CreateMemberConsumption();
        MyFavor       = MemberFavoritesFactory.CreateMemberFavorites();
        MyProduct     = ProductFactory.CreateProduct();
        MyPackage     = PackageFactory.CreatePackage();
        MyReview      = ProductReviewFactory.CreateProductReview();
        MyFeedback    = FeedBackFactory.CreateFeedBack();
        MyAddr        = MemberAddressFactory.CreateMemberAddress();
        MyCart        = OrdersGoodsTmpFactory.CreateOrdersGoodsTmp();
        MyCoupon      = PromotionFavorCouponFactory.CreatePromotionFavorCoupon();
        // MyEmail = U_EmailNotifyRequestFactory.CreateU_EmailNotifyRequest();
        MyAccountLog = MemberAccountLogFactory.CreateMemberAccountLog();
        MyShop       = SupplierShopFactory.CreateSupplierShop();

        pageurl = new PageURL(int.Parse(Application["Static_IsEnable"].ToString()));
    }
Example #9
0
        public static List<Bubis.Andika.DAL.EF.Roles> GetRoles(HttpApplicationState application)
        {
            if (!RolesIsLoaded(application))
                LoadRoles(application);

            return application[ROLES_PAGES] as List<Bubis.Andika.DAL.EF.Roles>;
        }
 public HttpApplicationStateWrapper(System.Web.HttpApplicationState httpApplicationState)
 {
     if (httpApplicationState == null)
     {
         throw new ArgumentNullException("httpApplicationState");
     }
     this._application = httpApplicationState;
 }
Example #11
0
 public Scope(Page page)
 {
     application = page.Application;
     session = page.Session;
     request = page.Request;
     this.page = page;
     items = page.Items;
 }
Example #12
0
 //构建构造函数
 public Verify()
 {
     //初始化ASP.NET内置对象
     Response    = System.Web.HttpContext.Current.Response;
     Request     = System.Web.HttpContext.Current.Request;
     Server      = System.Web.HttpContext.Current.Server;
     Session     = System.Web.HttpContext.Current.Session;
     Application = System.Web.HttpContext.Current.Application;
 }
Example #13
0
    public ProductPrice()
    {
        Application = System.Web.HttpContext.Current.Application;

        tools   = ToolsFactory.CreateTools();
        MyMem   = MemberFactory.CreateMember();
        Myprice = ProductPriceFactory.CreateProductPrice();
        Mygrade = MemberGradeFactory.CreateMemberGrade();
    }
Example #14
0
 public static void OnStart( HttpApplicationState appState )
 {
     // Uncomment to debug bootstrapping process.
     // Note: IIS 7 starts up far too fast for Visual Studio to attach.  If you need to
     //       Debug the bootstrapping process then you need to uncomment this line of code,
     //       connect to Rem through the browser.  This statement will force a debugger to
     //       attach to the worker process and enable you to debug.
     //System.Diagnostics.Debugger.Launch();
     new Bootstrapper().Run ( appState );
 }
 private string GetSessionId(HttpApplicationState Application)
 {
     if (Application["sessionId"] == null)
     {
         Application.Lock();
         Application["sessionId"] = opentok.CreateSession().Id;
         Application.UnLock();
     }
     return (string)Application["sessionId"];
 }
 // todo: serialize access to this method
 private SingularAssociationManager initAssociationManager(HttpApplicationState application)
 {
     SingularAssociationManager returnValue = (SingularAssociationManager)application["dossia.openid.associationManager"];
     if (returnValue == null)
     {
         returnValue = new SingularAssociationManager();
         application["dossia.openid.associationManager"] = returnValue;
     }
     return returnValue;
 }
        public BootcampCore([NotNull] HttpServerUtility server, [NotNull] HttpApplicationState application, [CanBeNull] HttpResponse response, BootcampMode mode, bool noisy)
        {
            Assert.ArgumentNotNull(server, "server");
              Assert.ArgumentNotNull(application, "application");

              this.Server = server;
              this.Application = application;
              this.Response = response;
              this.Mode = mode;
              this.Noisy = noisy;
        }
Example #18
0
    public Charts()
    {
        //初始化ASP.NET内置对象
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        statistic = new Statistic();
    }
Example #19
0
		// 08/17/2005   Special Term function that helps with a list. 
		public static object Term(HttpApplicationState Application, string sCultureName, string sListName, object oField)
		{
			// 01/11/2008   Protect against uninitialized variables. 
			if ( String.IsNullOrEmpty(sListName) )
				return String.Empty;

			if ( oField == null || oField == DBNull.Value )
				return oField;
			// 11/28/2005   Convert field to string instead of cast.  Cast will not work for integer fields. 
			return Term(Application, sCultureName, sListName + oField.ToString());
		}
Example #20
0
    public Addr()
    {
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools = ToolsFactory.CreateTools();
        MyBLL = AddrFactory.CreateAddr();
    }
Example #21
0
    public OrdersLog()
    {
        //初始化ASP.NET内置对象
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools = ToolsFactory.CreateTools();
        MyBLL = OrdersLogFactory.CreateOrdersLog();
    }
Example #22
0
    public FriendlyLinkCate()
    {
        //初始化ASP.NET内置对象
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools = ToolsFactory.CreateTools();
        MyBLL = FriendlyLinkFactory.CreateFriendlyLinkCate();
    }
Example #23
0
    public Logistics()
    {
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        MyBLL   = LogisticsFactory.CreateLogistics();
        tools   = ToolsFactory.CreateTools();
        encrypt = EncryptFactory.CreateEncrypt();
    }
Example #24
0
    public SupplierGrade()
    {
        //初始化ASP.NET内置对象
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools = ToolsFactory.CreateTools();
        MyBLL = SupplierGradeFactory.CreateSupplierGrade();
    }
Example #25
0
    public SCMConfig()
    {
        //初始化ASP.NET内置对象
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools    = ToolsFactory.CreateTools();
        DBHelper = SQLHelperFactory.CreateSQLHelper();
    }
Example #26
0
        public static void Process(HttpApplicationState Application)
        {
            if ( !bInsideWorkflow )
            {
                bInsideWorkflow = true;
                try
                {
                    //SplendidError.SystemMessage(Application, "Warning", new StackTrace(true).GetFrame(0), "WorkflowUtils.Process Begin");

                    spWORKFLOW_EVENTS_ProcessAll(Application);
                    /*
                    DbProviderFactory dbf = DbProviderFactories.GetFactory(Application);
                    using ( IDbConnection con = dbf.CreateConnection() )
                    {
                        string sSQL ;
                        sSQL = "select *                " + ControlChars.CrLf
                             + "  from vwWORKFLOW_EVENTS" + ControlChars.CrLf
                             + " order by AUDIT_VERSION " + ControlChars.CrLf;
                        using ( IDbCommand cmd = con.CreateCommand() )
                        {
                            cmd.CommandText = sSQL;
                            con.Open();

                            using ( DbDataAdapter da = dbf.CreateDataAdapter() )
                            {
                                ((IDbDataAdapter)da).SelectCommand = cmd;
                                using ( DataTable dt = new DataTable() )
                                {
                                    da.Fill(dt);
                                    if ( dt.Rows.Count > 0 )
                                        SplendidError.SystemMessage(Application, "Warning", new StackTrace(true).GetFrame(0), "Processing " + dt.Rows.Count.ToString() + " workflow events");
                                    foreach ( DataRow row in dt.Rows )
                                    {
                                        Guid gID = Sql.ToGuid(row["ID"]);
                                        // 12/30/2007 Paul.  We are not going to do anything yet, but we do need to clean up the table.
                                        spWORKFLOW_EVENTS_Delete(Application, gID);
                                    }
                                }
                            }
                        }
                    }
                    */
                }
                catch(Exception ex)
                {
                    SplendidError.SystemMessage(Application, "Error", new StackTrace(true).GetFrame(0), Utils.ExpandException(ex));
                }
                finally
                {
                    bInsideWorkflow = false;
                }
            }
        }
Example #27
0
    public ProductAuditReason()
    {
        //初始化ASP.NET内置对象
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools = ToolsFactory.CreateTools();
        MyBLL = ProductAuditReasonFactory.CreateProductAuditReason();
    }
Example #28
0
 public KeywordBidding()
 {
     //初始化ASP.NET内置对象
     Response    = System.Web.HttpContext.Current.Response;
     Request     = System.Web.HttpContext.Current.Request;
     Server      = System.Web.HttpContext.Current.Server;
     Session     = System.Web.HttpContext.Current.Session;
     Application = System.Web.HttpContext.Current.Application;
     DBHelper    = SQLHelperFactory.CreateSQLHelper();
     tools       = ToolsFactory.CreateTools();
     MyMessage   = SupplierMessageFactory.CreateSupplierMessage();
     MyBLL       = KeywordBiddingFactory.CreateKeywordBidding();
 }
Example #29
0
    public NetPayClient()
    {
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        pub = new Public_Class();
        //pub.SetCurrentSite();
        priKeyPath = System.Configuration.ConfigurationManager.AppSettings["priKeyPath"].ToString();
        pubKeyPath = System.Configuration.ConfigurationManager.AppSettings["pubKeyPath"].ToString();
    }
Example #30
0
    public RBACResource()
    {
        //初始化ASP.NET内置对象
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools      = ToolsFactory.CreateTools();
        MyBLL      = RBACResourceFactory.CreateRBACResource();
        MyGroupBLL = RBACResourceFactory.CreateRBACResourceGroup();
    }
Example #31
0
    public Config()
    {
        //初始化ASP.NET内置对象
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools          = ToolsFactory.CreateTools();
        MyBLL          = ConfigFactory.CreateConfig();
        MyReviewconfig = ProductReviewConfigFactory.CreateProductReviewConfig();
    }
Example #32
0
    public DeliveryWay()
    {
        //初始化ASP.NET内置对象
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools   = ToolsFactory.CreateTools();
        MyBLL   = DeliveryWayFactory.CreateDeliveryWay();
        addrBLL = AddrFactory.CreateAddr();
    }
Example #33
0
    public Category()
    {
        //初始化ASP.NET内置对象
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools  = ToolsFactory.CreateTools();
        MyBLL  = CategoryFactory.CreateCategory();
        MyTBLL = ProductTypeFactory.CreateProductType();
    }
Example #34
0
    public Brand()
    {
        //初始化ASP.NET内置对象
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools         = ToolsFactory.CreateTools();
        brand         = BrandFactory.CreateBrand();
        MyProductType = ProductTypeFactory.CreateProductType();
    }
Example #35
0
    public HomeLeftCate()
    {
        //初始化ASP.NET内置对象
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools  = ToolsFactory.CreateTools();
        MyBLL  = HomeLeftCateFactory.CreateHomeLeftCate();
        MyCate = CategoryFactory.CreateCategory();
    }
Example #36
0
    public SysMessage()
    {
        //初始化ASP.NET内置对象
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools = ToolsFactory.CreateTools();
        MyBLL = SysMessageFactory.CreateSysMessage();
        pub   = new Public_Class();
    }
Example #37
0
    public Help()
    {
        //初始化ASP.NET内置对象
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools = ToolsFactory.CreateTools();
        MyBLL = HelpFactory.CreateHelp();
        cate  = new HelpCate();
    }
Example #38
0
    public Package()
    {
        //初始化ASP.NET内置对象
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools     = ToolsFactory.CreateTools();
        MyBLL     = PackageFactory.CreatePackage();
        MyBLLPRO  = ProductFactory.CreateProduct();
        MyProduct = new Product();
    }
Example #39
0
    public ProductTag()
    {
        //初始化ASP.NET内置对象
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools     = ToolsFactory.CreateTools();
        MyBLL     = ProductTagFactory.CreateProductTag();
        MyProduct = ProductFactory.CreateProduct();
        pub       = new Public_Class();
    }
Example #40
0
    public SupplierLogistics()
    {
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        MyBLL             = SupplierLogisticsFactory.CreateSupplierLogistics();
        tools             = ToolsFactory.CreateTools();
        Addr              = new Addr();
        MyLogisticsTender = LogisticsTenderFactory.CreateLogisticsTender();
        MyLogistics       = new Logistics();
    }
 public void InitOnSessionEnd(System.Web.HttpApplicationState application, System.Web.SessionState.HttpSessionState session)
 {
     if (session != null)
     {
         // Remove employee from list.
         application.Lock();
         Remove(session.SessionID);
         application.UnLock();
     }
     else
     {
         System.Diagnostics.Trace.WriteLine("Session is null!");
     }
 }
Example #42
0
    public Notice()
    {
        //初始化ASP.NET内置对象
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools = ToolsFactory.CreateTools();
        MyBLL = NoticeFactory.CreateNotice();

        noticeCate = new NoticeCate();
    }
 // 12/22/2007 Paul.  Inside the timer event, there is no current context, so we need to pass the application.
 public static string Culture(HttpApplicationState Application)
 {
     string sCulture = Sql.ToString(Application["CONFIG.default_language"]);
     // 12/22/2007 Paul.  The cache is not available when we are inside the timer event.
     if ( HttpContext.Current != null && HttpContext.Current.Cache != null )
     {
         DataView vwLanguages = new DataView(SplendidCache.Languages());
         vwLanguages.RowFilter = "NAME = '" + sCulture +"'";
         if ( vwLanguages.Count > 0 )
             sCulture = Sql.ToString(vwLanguages[0]["NAME"]);
     }
     if ( Sql.IsEmptyString(sCulture) )
         sCulture = "en-US";
     return L10N.NormalizeCulture(sCulture);
 }
Example #44
0
		// 12/22/2007   Inside the timer event, there is no current context, so we need to pass the application. 
		public static string Culture(HttpApplicationState Application)
		{
			string sCulture = Sql.ToString(Application["CONFIG.default_language"]);
			// 12/22/2007   The cache is not available when we are inside the timer event. 
			// 02/18/2008   The Languages function is now thread safe, so it can be called from the timer. 
			//if ( HttpContext.Current != null && HttpContext.Current.Cache != null )
			{
				DataView vwLanguages = new DataView(SplendidCache.Languages(Application));
				// 05/20/2008   Normalize culture before lookup. 
				vwLanguages.RowFilter = "NAME = '" + L10N.NormalizeCulture(sCulture) +"'";
				if ( vwLanguages.Count > 0 )
					sCulture = Sql.ToString(vwLanguages[0]["NAME"]);
			}
			if ( Sql.IsEmptyString(sCulture) )
				sCulture = "en-US";
			return L10N.NormalizeCulture(sCulture);
		}
 private void CompileApplication()
 {
     this._theApplicationType = BuildManager.GetGlobalAsaxType();
     BuildResultCompiledGlobalAsaxType globalAsaxBuildResult = BuildManager.GetGlobalAsaxBuildResult();
     if (globalAsaxBuildResult != null)
     {
         if (globalAsaxBuildResult.HasAppOrSessionObjects)
         {
             this.GetAppStateByParsingGlobalAsax();
         }
         this._fileDependencies = globalAsaxBuildResult.VirtualPathDependencies;
     }
     if (this._state == null)
     {
         this._state = new HttpApplicationState();
     }
     this.ReflectOnApplicationType();
 }
Example #46
0
        internal static async void CheckForUpdates(HttpApplicationState application)
        {
            bool autoSuggestUpdate =
                Conversion.TryCastBoolean(ConfigurationHelper.GetUpdaterParameter("AutoSuggestUpdate"));

            if (autoSuggestUpdate)
            {
                try
                {
                    Updater.UpdateManager updater = new Updater.UpdateManager();
                    Release release = await updater.GetLatestReleaseAsync();

                    if (release != null)
                    {
                        application["UpdateAvailable"] = true;
                    }
                }
                catch (Exception ex)
                {
                    Log.Error("Exception occurred. {Exception}.", ex);
                }
            }
        }
Example #47
0
		// 11/15/2009   We need a version of the function that accepts the application. 
		public static Currency CreateCurrency(HttpApplicationState Application, Guid gCURRENCY_ID)
		{
			Currency C10n = Application["CURRENCY." + gCURRENCY_ID.ToString()] as Taoqi.Currency;
			if ( C10n == null )
			{
				// 05/09/2006  First try and use the default from CONFIG. 
				gCURRENCY_ID = Sql.ToGuid(Application["CONFIG.default_currency"]);
				C10n = Application["CURRENCY." + gCURRENCY_ID.ToString()] as Taoqi.Currency;
				if ( C10n == null )
				{
					// Default to USD if default not specified. 
					gCURRENCY_ID = m_gUSDollar;
					C10n = Application["CURRENCY." + gCURRENCY_ID.ToString()] as Taoqi.Currency;
				}
				// If currency is still null, then create a blank zone. 
				if ( C10n == null )
				{
					C10n = new Currency();
					Application["CURRENCY." + gCURRENCY_ID.ToString()] = C10n;
				}
			}
			return C10n;
		}
Example #48
0
 /// <summary>
 /// spWORKFLOW_EVENTS_ProcessAll
 /// </summary>
 public static void spWORKFLOW_EVENTS_ProcessAll(HttpApplicationState Application)
 {
     if ( HttpContext.Current != null && HttpContext.Current.Application != null )
     {
         // 12/22/2007 Paul.  By calling the SqlProcs version, we will ensure a compile-time error if the parameters change.
         SqlProcs.spWORKFLOW_EVENTS_ProcessAll();
     }
     else
     {
         DbProviderFactory dbf = DbProviderFactories.GetFactory(Application);
         using ( IDbConnection con = dbf.CreateConnection() )
         {
             con.Open();
             using ( IDbTransaction trn = con.BeginTransaction() )
             {
                 try
                 {
                     using ( IDbCommand cmd = con.CreateCommand() )
                     {
                         cmd.Transaction = trn;
                         cmd.CommandType = CommandType.StoredProcedure;
                         cmd.CommandText = "spWORKFLOW_EVENTS_ProcessAll";
                         cmd.ExecuteNonQuery();
                     }
                     trn.Commit();
                 }
                 catch(Exception ex)
                 {
                     trn.Rollback();
                     throw(new Exception(ex.Message, ex.InnerException));
                 }
             }
         }
     }
 }
Example #49
0
 /// <summary>
 /// Dumps the values found in the application state
 /// </summary>
 /// <param name="Input">Application state variable</param>
 /// <returns>A string containing the application state information</returns>
 public static string DumpApplicationState(HttpApplicationState Input)
 {
     StringBuilder String = new StringBuilder();
     foreach (string Key in Input.Keys)
     {
         String.Append(Key).Append(": ")
             .Append(Input[Key].ToString())
             .Append("<br />Properties<br />")
             .Append(Reflection.Reflection.DumpProperties(Input[Key]))
             .Append("<br />");
     }
     return String.ToString();
 }
Example #50
0
 void Session_Start(object sender, EventArgs e)
 {
     State = Application;
 }
 public HttpApplicationStateAdapter(HttpApplicationState app)
 {
     this.app = app;
 }
Example #52
0
        public String convert(string doc, String page, HttpApplicationState application)
        {
            try
            {
                String output = "";
                String pdfFilePath = configManager.getConfig("path.pdf") + doc;
                String swfFilePath = configManager.getConfig("path.swf") + doc + page + ".swf";
                String command = "";

                if (configManager.getConfig("splitmode") == "true")
                    command = configManager.getConfig("cmd.conversion.splitpages");
                else
                    command = configManager.getConfig("cmd.conversion.singledoc");

                command = command.Replace("{path.pdf}", this.configManager.getConfig("path.pdf"));
                command = command.Replace("{path.swf}", this.configManager.getConfig("path.swf"));
                command = command.Replace("{pdffile}", doc);

                try
                {
                    if (!this.isNotConverted(pdfFilePath, swfFilePath))
                    {
                        return "[Converted]";
                    }
                }
                catch (Exception ex)
                {
                    return "[" + ex.Message + "]";
                }

                int return_var = 0;
                String pagecommand = "";

                if (configManager.getConfig("splitmode") == "true")
                {
                    pagecommand = command.Replace("%", page);
                    pagecommand += " -p " + page;
                }

                System.Diagnostics.Process proc = new System.Diagnostics.Process();
                proc.StartInfo.FileName = command.Substring(0, command.IndexOf(".exe") + 5);
                command = command.Substring(command.IndexOf(".exe") + 5);

                if (configManager.getConfig("splitmode") == "true")
                    proc.StartInfo.Arguments = pagecommand.Substring(pagecommand.IndexOf(".exe") + 5);
                else
                    proc.StartInfo.Arguments = command;

                proc.StartInfo.UseShellExecute = false;
                proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
                proc.StartInfo.CreateNoWindow = true;
                proc.StartInfo.RedirectStandardOutput = true;

                if (proc.Start())
                {
                    output = proc.StandardOutput.ReadToEnd();
                    proc.WaitForExit();
                    proc.Close();
                    return_var = 0;

                    if (configManager.getConfig("splitmode") == "true")
                    {
                        if(application["runningExecutions"] == null){
                            application["runningExecutions"] = new Hashtable();
                        }

                        bool forkExecution = true;

                        if((application["runningExecutions"] as Hashtable)[command] != null){
                            TimeSpan duration = DateTime.Now - (DateTime)(application["runningExecutions"] as Hashtable)[command];
                            forkExecution = duration.Minutes > 1;
                        }

                        if(forkExecution){
                            System.Diagnostics.Process proc2 = new System.Diagnostics.Process();
                            proc2.StartInfo.FileName = proc.StartInfo.FileName;
                            proc2.StartInfo.Arguments = command;
                            proc2.StartInfo.UseShellExecute = true;
                            proc2.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
                            proc2.StartInfo.CreateNoWindow = true;

                            // save the executing command to avoid multiple split mode executions
                            (application["runningExecutions"] as Hashtable)[command] = DateTime.Now;

                            proc2.Start();
                        }
                    }
                }
                else
                    return_var = -1;

                if(return_var == 0)
                    return "[Converted]";
                else
                    return "[Error converting document, make sure the conversion tool is installed and that correct user permissions are applied to the SWF Path directory]";
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return "";
        }
Example #53
0
 public static ProfielService getProfielService(HttpApplicationState Application)
 {
     return (ProfielService)Application["profielService"];
 }
Example #54
0
 public static BerichtenService getBerichtenService(HttpApplicationState Application)
 {
     return (BerichtenService)Application["berichtenService"];
 }
        //
        //
        //

        internal void InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) {
            Debug.Assert(context != null, "context != null");

            // Remember state
            _state = state;

            PerfCounters.IncrementCounter(AppPerfCounter.PIPELINES);

            try {
                try {
                    // Remember context for config lookups
                    _initContext = context;
                    _initContext.ApplicationInstance = this;

                    // Set config path to be application path for the application initialization
                    context.ConfigurationPath = context.Request.ApplicationPathObject;

                    // keep HttpContext.Current working while running user code
                    using (new DisposableHttpContextWrapper(context)) {

                        // Build module list from config
                        if (HttpRuntime.UseIntegratedPipeline) {

                            Debug.Assert(_moduleConfigInfo != null, "_moduleConfigInfo != null");
                            Debug.Assert(_moduleConfigInfo.Count >= 0, "_moduleConfigInfo.Count >= 0");

                            try {
                                context.HideRequestResponse = true;
                                _hideRequestResponse = true;
                                InitIntegratedModules();
                            }
                            finally {
                                context.HideRequestResponse = false;
                                _hideRequestResponse = false;
                            }
                        }
                        else {
                            InitModules();

                            // this is used exclusively for integrated mode
                            Debug.Assert(null == _moduleContainers, "null == _moduleContainers");
                        }

                        // Hookup event handlers via reflection
                        if (handlers != null)
                            HookupEventHandlersForApplicationAndModules(handlers);

                        // Initialization of the derived class
                        _context = context;
                        if (HttpRuntime.UseIntegratedPipeline && _context != null) {
                            _context.HideRequestResponse = true;
                        }
                        _hideRequestResponse = true;

                        try {
                            Init();
                        }
                        catch (Exception e) {
                            RecordError(e);
                        }
                    }

                    if (HttpRuntime.UseIntegratedPipeline && _context != null) {
                        _context.HideRequestResponse = false;
                    }
                    _hideRequestResponse = false;
                    _context = null;
                    _resumeStepsWaitCallback= new WaitCallback(this.ResumeStepsWaitCallback);

                    // Construct the execution steps array
                    if (HttpRuntime.UseIntegratedPipeline) {
                        _stepManager = new PipelineStepManager(this);
                    }
                    else {
                        _stepManager = new ApplicationStepManager(this);
                    }

                    _stepManager.BuildSteps(_resumeStepsWaitCallback);
                }
                finally {
                    _initInternalCompleted = true;

                    // Reset config path
                    context.ConfigurationPath = null;

                    // don't hold on to the context
                    _initContext.ApplicationInstance = null;
                    _initContext = null;
                }
            }
            catch { // Protect against exception filters
                throw;
            }
        }
Example #56
0
	internal void SetContext (HttpContext context)
	{
		_context = context;

		_application = context.Application;
		_response = context.Response;
		_request = context.Request;
		_cache = context.Cache;
	}
        internal void InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) {
            // Remember state
            _state = state;

            try {
                //  Remember the context for the initialization
                if (context != null) {
                    _initContext = context;
                    _initContext.ApplicationInstance = this;
                }

                // if we're doing integrated pipeline wireup, then appContext is non-null and we need to init modules and register event subscriptions with IIS
                if (appContext != IntPtr.Zero) {
                    // 1694356: app_offline.htm and <httpRuntime enabled=/> require that we make this check here for integrated mode
                    using (new ApplicationImpersonationContext()) {
                        HttpRuntime.CheckApplicationEnabled();
                    }

                    // retrieve app level culture
                    InitAppLevelCulture();

                    Debug.Trace("PipelineRuntime", "InitSpecial for " + appContext.ToString() + "\n");
                    RegisterEventSubscriptionsWithIIS(appContext, context, handlers);
                }
                else {
                    // retrieve app level culture
                    InitAppLevelCulture();

                    // Hookup event handlers via reflection
                    if (handlers != null) {
                        HookupEventHandlersForApplicationAndModules(handlers);
                    }
                }

                // if we're doing integrated pipeline wireup, then appContext is non-null and we need to register the application (global.asax) event handlers
                if (appContext != IntPtr.Zero) {
                    if (_appPostNotifications != 0 || _appRequestNotifications != 0) {
                        RegisterIntegratedEvent(appContext,
                                                HttpApplicationFactory.applicationFileName,
                                                _appRequestNotifications,
                                                _appPostNotifications,
                                                this.GetType().FullName,
                                                MANAGED_PRECONDITION,
                                                false);
                    }
                }
            }
            finally  {
                _initSpecialCompleted = true;

                //  Do not hold on to the context
                if (_initContext != null) {
                    _initContext.ApplicationInstance = null;
                    _initContext = null;
                }
            }
        }
Example #58
0
 /// <summary>
 /// 设置当前上传的进度信息
 /// 根据UploadID记录在Application中
 /// </summary>
 /// <param name="uploadId"></param>
 /// <param name="progress"></param>
 /// <param name="application"></param>
 void SetProgress(string uploadId, Progress progress, HttpApplicationState application)
 {
     if (uploadId == null || uploadId == string.Empty || progress == null)
         return;
     application.Lock();
     application["OpenlabUpload_" + uploadId] = progress;
     application.UnLock();
 }
 /// <summary>
 /// Set a property in the application state to quickly determine if image optimisation
 /// is supported by the data set.
 /// </summary>
 /// <param name="application"></param>
 internal static void Init(HttpApplicationState application)
 {
     application["51D_ImageOptimiser"] = new bool?(Manager.ImageOptimisation.Enabled &&
         WebProvider.ActiveProvider != null);
     EventLog.Debug(String.Format("Image Optimisation '{0}'", application["51D_ImageOptimiser"]));
 }
Example #60
0
 /// <summary>
 /// 根据UploadID获取上传进度信息
 /// </summary>
 /// <param name="uploadId"></param>
 /// <param name="application"></param>
 /// <returns></returns>
 public static Progress GetProgress(string uploadId, HttpApplicationState application)
 {
     Progress progress = application["OpenlabUpload_" + uploadId] as Progress;
     return progress;
 }