Example #1
0
 public override void AdjustWebConfig(WebConfig wc)
 {
     wc._AssemblyDomain = "System";
     wc._CompilerVersion = "3.5";
     wc._AssemblyVersion = "3.5.0.0";
     wc._CompilerAssemblyVersion = "2.0.0.0";
 }
        protected virtual void DeployWebConfig()
        {
            string path = Path.Combine(DestinationFolder, "Web.Config");
            WebConfig wc = null;
            if (CreateWebConfig != null)
            {
                wc = CreateWebConfig();
            }
            else
            {
                wc = new WebConfig();
            }
            wc._TrustLevel = AstoriaTestProperties.ServiceTrustLevel.ToString();
            //wc._AuthMode = AstoriaTestProperties.HostAuthenicationMethod;
            wc._TransferMode = AstoriaTestProperties.TransferMode;
            wc._MaxBufferSize = AstoriaTestProperties.MaxBufferSize;
            wc._MaxReceivedMessageSize = AstoriaTestProperties.MaxReceivedMessageSize;
            wc._MaxRequestLength = AstoriaTestProperties.MaxRequestLength;
            wc._TransportSecurityMode = AstoriaTestProperties.TransportSecurityMode;
            wc._CloseTimeout = AstoriaTestProperties.CloseTimeout;
            wc._OpenTimeout = AstoriaTestProperties.OpenTimeout;
            wc._ReceiveTimeout = AstoriaTestProperties.ReceiveTimeout;
            wc._SendTimeout = AstoriaTestProperties.SendTimeout;
            wc._AspNetCompatibilityEnabled = AstoriaTestProperties.AspNetCompatibilityEnabled;
	    wc._CompilerOptions += " /Define:" + this.Workspace.DataLayerProviderKind.ToString();

            Versioning.Server.AdjustWebConfig(wc);

            if (this.Database != null)
            {
                wc.ConnectionStringSettings = this.Workspace.GetConnectionStringSettingsForProvider(this, this.Database.DatabaseConnectionString);
            }
            wc.Save(path);
        }
Example #3
0
        public WebRequestTimer(int request = TIMEOUT_REQUEST, WebConfig? config = null)
        {
            if (!config.HasValue)
                config = new WebConfig { LogLevel = LogLevel.None };
            WebCore.Initialize(config.Value);
            if (request <= 0) request = TIMEOUT_REQUEST;

            _timeoutRequest = request;
        }
Example #4
0
 public ManageForm()
 {
     WebConfig cfg = new WebConfig
     {
         AdditionalOptions = new string[]
         {
             "--use-gl=desktop", "ignore-gpu-blacklist"
         }
     };
     WebCore.Initialize(cfg);
     InitializeComponent();
     Load += ManageForm_Load;
 }
Example #5
0
        // TODO: look at this again and see if it's really necessary (and if it can be simplified)
        // with the new Awesomium version.
        // TODO: use custom-built WebSession for further configuration and add data sources (see below) only once
        public static void Init()
        {
            // We may be a new window in the same process.
            if (!initialized && !WebCore.IsInitialized)
            {
                WebCore.CreatedView += WebCore_CreatedView;

                // Setup WebCore with plugins enabled.
                WebConfig config = new WebConfig
                {
                    // !THERE CAN ONLY BE A SINGLE WebCore RUNNING PER PROCESS!
                    // We have ensured that our application is single instance,
                    // with the use of the WPFSingleInstance utility.
                    // We can now safely enable cache and cookies.
                    //SaveCacheAndCookies = true,
                    // In case our application is installed in ProgramFiles,
                    // we wouldn't want the WebCore to attempt to create folders
                    // and files in there. We do not have the required privileges.
                    // Furthermore, it is important to allow each user account
                    // have its own cache and cookies. So, there's no better place
                    // than the Application User Data Path.
                    /*UserDataPath = My.Application.UserAppDataPath,*/

                    //EnablePlugins = false, // TODO: make this configurable in case someone wants to use flash ...
                    /*HomeURL = Settings.Default.HomeURL,*/
                    /*LogPath = My.Application.UserAppDataPath,*/
                    LogLevel = LogLevel.None,
                    //AcceptLanguageOverride = "de-DE", // TODO: set this to the correct system language (needed for bibleserver)
                    ChildProcessPath = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "WordsLive.Awesomium.exe"),
                };

                //WebCore.Started += (sender, args) => WebCore.BaseDirectory = dataDirectory.FullName;

                // Caution! Do not start the WebCore in window's constructor.
                // This may be a startup window and a synchronization context
                // (necessary for auto-update), may not be available during
                // construction; the Dispatcher may not be running yet
                // (see App.xaml.cs).
                //
                // Setting the start parameter to false, let's us define
                // configuration settings early enough to be secure, but
                // actually delay the starting of the WebCore until
                // the first WebControl or WebView is created.
                WebCore.Initialize(config, false);

                initialized = true;
            }
        }
        public AwesomiumWPFWebWindow(WebSession iSession, WebConfig webConfig)
        {
            _Session = iSession;
            _WebConfig = webConfig;

            _WebControl = new WebControl()
            {
                WebSession = _Session,
                Visibility = Visibility.Hidden,
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment = VerticalAlignment.Stretch,
                ContextMenu = new ContextMenu() { Visibility = Visibility.Collapsed }
            };

            _AwesomiumHTMLWindow = new AwesomiumHTMLWindow(_WebControl);     
        }
Example #7
0
		public void Initialize(GraphicsDevice device, int renderTargetWidth, int renderTargetHeight, string basePath, string customCss = "") {
			mBasePath = basePath;

			//OnLoadCompleted = new OnLoadCompletedDelegate();

			//WebCore.Initialize(new WebCoreConfig() { CustomCSS = "::-webkit-scrollbar { visibility: hidden; }" });			
			//WebCore.Initialize(new WebConfig() { CustomCSS = customCSS, SaveCacheAndCookies = true });  //1.7
			//WebCore.Initialize(new WebCoreConfig() { CustomCSS = customCSS, SaveCacheAndCookies = true });
			var webConfig = new WebConfig {
				LogPath = Environment.CurrentDirectory,
				LogLevel = LogLevel.Verbose
			};
			WebCore.Initialize(webConfig);

			var webPreferences = new WebPreferences {
				CustomCSS = "::-webkit-scrollbar { visibility: hidden; }"
			};
			WebSession = WebCore.CreateWebSession(webPreferences);

			if (mLogger != null)
				mLogger.Info("WEBCORE initialized.");

			WebTexture = new Texture2D(device, renderTargetWidth, renderTargetHeight);

			if (mLogger != null)
				mLogger.Info("Rendertarget created.");


			WebView = WebCore.CreateWebView(renderTargetWidth, renderTargetHeight, WebSession);

			//LoadingFrameComplete still seems to take an
			//inordinate amout of time with local files...
			//SOMETIMES.  
			//As long as you haven't navigated to an online
			//page and back it is instant.  Odd.
			WebView.DocumentReady += OnDocumentReadyInternal;
			WebView.LoadingFrameComplete += OnLoadingFrameCompleteInternal;

			if (mLogger != null)
				mLogger.Info("WebView created.");

			WebView.IsTransparent = true;
		}
    protected void btnSave_Click(object sender, EventArgs e)
    {
        WebConfig saveconfig = new WebConfig();

        saveconfig.interimCodePaper = txtbInterimCodePaper.Text;
        saveconfig.permanentCodePaper = txtbPermanentCodePaper.Text;

        saveconfig.systemNameEnglish = txtbNameEnglish.Text;
        saveconfig.systemNamePersian = txtbNamePersian.Text;

        saveconfig.expirationForSelectReferee = TimeSpan.Parse(txtbExpSelectReferee.Text);
        saveconfig.expirationForSubmitOnline = TimeSpan.Parse(txtbExpSubmitOnline.Text);

        saveconfig.systemEmailHostName = txtbsysEmailHostName.Text;
        saveconfig.systemEmailDisplayName = txtbSysEmailDisplayName.Text;
        saveconfig.systemEmail = new Email(txtbSysEmailAddress.Text, txtbSysEmailPass.Text);

        saveconfig.theMinimumReferees = int.Parse(txtbMinReferee.Text);

        SysProperty.SaveConfig(saveconfig);
    }
Example #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (base._User != null)
     {
         this.Balance  = base._User.Balance.ToString();
         this.UserName = base._User.Name.ToString();
     }
     this.so["OnlinePay_Alipay_Status_ON"].ToBoolean(false);
     if (WebConfig.GetAppSettingsInt("OnlinePayType", 2) == 2)
     {
         base.Response.Redirect("../Alipay02/Default.aspx", true);
     }
     else
     {
         this.Money        = _Convert.StrToDouble(this.PayMoney.Text, 0.0);
         this.RealPayMoney = this.Money;
         double num2 = this.so["OnlinePay_Alipay_PayFormalitiesFeesScale"].ToDouble(0.0) / 100.0;
         double num3 = Math.Round((double)(this.Money * num2), 2);
         this.Money        += num3;
         this.PayMoney.Text = this.Money.ToString();
         this.BindDataForPayList(this.RealPayMoney);
         string text1 = "金额:" + ((this.Money - num3)).ToString() + " ";
     }
 }
Example #10
0
        public int GetCountErrorBdwContact()
        {
            int    count   = 0;
            string stmt    = "SELECT COUNT(*) FROM TB_I_BDW_CONTACT WHERE ERROR IS NOT NULL ";
            string connStr = WebConfig.GetConnectionString("CSMConnectionString");

            try
            {
                using (SqlConnection thisConnection = new SqlConnection(connStr))
                {
                    using (SqlCommand cmdCount = new SqlCommand(stmt, thisConnection))
                    {
                        thisConnection.Open();
                        count = (int)cmdCount.ExecuteScalar();
                    }
                }
                return(count);
            }
            catch (Exception ex)
            {
                Logger.Error("Exception occur:\n", ex);
                return(0);
            }
        }
Example #11
0
    public void GoToRequestLoginPage(string DefaultPage)
    {
        string request = Utility.GetRequest("RequestLoginPage");

        if (request == null)
        {
            request = "";
        }
        if (((request == "") && (DefaultPage.Trim() == "")) && WebConfig.GetAppSettingsBool("GotoRoomWhenLogin", false))
        {
            request = "~/Default.aspx";
        }
        if (request != "")
        {
            if (request.StartsWith("Home/Room/"))
            {
                request = request.Substring(5, request.Length - 5);
                if (!request.StartsWith("MyIcaile.aspx?SubPage="))
                {
                    HttpContext.Current.Response.Write("<script language='javascript'>window.top.location.href='Home/Room/MyIcaile.aspx?SubPage=" + HttpUtility.UrlEncode(request) + "'</script>");
                }
                else
                {
                    HttpContext.Current.Response.Write("<script language='javascript'>window.top.location.href='Home/Room/" + request + "'</script>");
                }
            }
            else
            {
                HttpContext.Current.Response.Redirect(request, true);
            }
        }
        else if (DefaultPage.Trim() != "")
        {
            HttpContext.Current.Response.Redirect(DefaultPage, true);
        }
    }
Example #12
0
        private void SetPageAttribution()
        {
            hfCategory.Value      = "Home";
            hfPageID.Value        = pageID;
            hfUserID.Value        = WorkingProfile.UserId;
            hfUserLoginRole.Value = WorkingProfile.UserRoleLogin;
            hfUserRole.Value      = WorkingProfile.UserRole;
            hfRunningModel.Value  = WebConfig.RunningModel();
            Session["HomePage"]   = "Loading.aspx?pID=" + pageID;

            var para = new
            {
                Operate    = "SchoolYearDate",
                UserID     = WorkingProfile.UserId,
                SchoolCode = WorkingProfile.SchoolCode,
                SchoolYear = WorkingProfile.SchoolYear,
            };
            var myDate = ManagePageList <SchoolDateStr, SchoolDateStr> .GetList(DataSource, "ClassCall", para);

            hfSchoolyearStartDate.Value = myDate[0].StartDate.ToString();
            hfSchoolyearEndDate.Value   = myDate[0].EndDate.ToString();
            dateStart.Value             = myDate[0].TodayDate.ToString();
            dateEnd.Value = myDate[0].EndDate.ToString();
        }
Example #13
0
        /// <summary>
        /// 更新门店信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool UpdateShopInfo(ShopModel model)
        {
            string strSql = @"update BM_ShopManage set ShopName=@ShopName,ShopProv=@ShopProv,ShopCity=@ShopCity,ShopArea=@ShopArea,ShopAddress=@ShopAddress,Contacts=@Contacts,ContactWay=@ContactWay";

            if (!string.IsNullOrEmpty(model.LoginPassword))
            {
                strSql += ",LoginPassword=@LoginPassword";
            }

            strSql += " where ShopID=@ShopID";
            var param = new[] {
                new SqlParameter("@ShopName", model.ShopName),
                new SqlParameter("@ShopProv", model.ShopProv),
                new SqlParameter("@ShopCity", model.ShopCity),
                new SqlParameter("@ShopArea", model.ShopArea),
                new SqlParameter("@ShopAddress", model.ShopAddress),
                new SqlParameter("@Contacts", model.Contacts),
                new SqlParameter("@ContactWay", model.ContactWay),
                new SqlParameter("@LoginPassword", EncryptHelper.MD5_8(model.LoginPassword)),
                new SqlParameter("@ShopID", model.ShopID)
            };

            return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql, param) > 0);
        }
Example #14
0
        /// <summary>
        /// 添加资讯
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int AddArticle(ArticleModel model)
        {
            string strSql = @"insert into BM_ArticleList(AuthorId,AuthorName,AuthorIdentity,SendTargetId,SendType,ArticleSort,ArticleType,ArticleClassify
                                ,ArticleTitle,ArticleIntro,ArticleCover,ArticleBody,EnableTop,EnablePublish,ArticleStatus,TopTime,PublishTime)
                                values(@AuthorId,@AuthorName,@AuthorIdentity,@SendTargetId,@SendType,@ArticleSort,@ArticleType,@ArticleClassify
                                ,@ArticleTitle,@ArticleIntro,@ArticleCover,@ArticleBody,@EnableTop,@EnablePublish,@ArticleStatus,@TopTime,@PublishTime);select @@IDENTITY";
            var    param  = new[] {
                new SqlParameter("@AuthorId", model.AuthorId),
                new SqlParameter("@AuthorName", model.AuthorName),
                new SqlParameter("@AuthorIdentity", model.AuthorIdentity),
                new SqlParameter("@SendTargetId", model.SendTargetId),
                new SqlParameter("@SendType", model.SendType),
                new SqlParameter("@ArticleSort", model.ArticleSort),
                new SqlParameter("@ArticleType", model.ArticleType),
                new SqlParameter("@ArticleClassify", model.ArticleClassify),
                new SqlParameter("@ArticleTitle", model.ArticleTitle),
                new SqlParameter("@ArticleIntro", model.ArticleIntro),
                new SqlParameter("@ArticleCover", model.ArticleCover),
                new SqlParameter("@ArticleBody", model.ArticleBody),
                new SqlParameter("@EnableTop", model.EnableTop),
                new SqlParameter("@EnablePublish", model.EnablePublish),
                new SqlParameter("@ArticleStatus", model.ArticleStatus),
                new SqlParameter("@TopTime", model.TopTime),
                new SqlParameter("@PublishTime", model.PublishTime)
            };
            object obj = DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql.ToString(), param);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Example #15
0
        /// <summary>
        /// 获取置顶资讯数据
        /// </summary>
        /// <param name="AuthorIdentity">The author identity.</param>
        /// <returns>List&lt;ArticleBaseModel&gt;.</returns>
        public List <ArticleBaseModel> GetAppTopArticleList(int AuthorIdentity)
        {
            string strSql = @"select A.ArticleId,a.ArticleTitle,a.ArticleIntro,a.ArticleCover,a.BrowseAmount,a.PublishTime
                                 from BM_ArticleList A with(nolock)
                                where a.IsDel=0 and a.EnableTop=1 and A.ArticleStatus=1  and A.AuthorIdentity=@AuthorIdentity  order by A.ArticleSort desc";

            var param = new[] {
                new SqlParameter("@AuthorIdentity", AuthorIdentity),
            };

            using (SqlDataReader dr = DbHelperSQLP.ExecuteReader(WebConfig.getConnectionString(), CommandType.Text, strSql, param))
            {
                List <ArticleBaseModel> data = DbHelperSQLP.GetEntityList <ArticleBaseModel>(dr);
                if (data != null)
                {
                    data.ForEach((item) =>
                    {
                        item.ArticleUrl   = WebConfig.articleDetailsDomain() + "/article/details.html?articleId=" + item.ArticleId;
                        item.ArticleCover = WebConfig.reswebsite() + item.ArticleCover;
                    });
                }
                return(data);
            }
        }
Example #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        switch (WebConfig.GetValues("SiteStatus"))
        {
        case "Running":
            Response.Redirect("Guest/Home.aspx");
            break;

        case "Stoped":
            //show message
            Img_Error.ImageUrl = "~/Resources/img_temp.gif";
            //L_Message.Text = WebConfig.GetValues("SiteStatus");
            break;

        case "Setup":
            //show mwssage
            Img_Error.ImageUrl = "~/Resources/img_sitecon.gif";
            L_Message.Text     = WebConfig.GetValues("SiteStatus");
            break;

        default:
            break;
        }
    }   // Page_load
Example #17
0
        /// <summary>
        /// SAEA WebServer
        /// </summary>
        /// <param name="httpContentType">处理对象</param>
        /// <param name="root">根目录</param>
        /// <param name="port">监听端口</param>
        /// <param name="isStaticsCached">是否启用静态缓存</param>
        /// <param name="isZiped">是压启用内容压缩</param>
        /// <param name="bufferSize">http处理数据缓存大小</param>
        /// <param name="count">http连接数上限</param>
        /// <param name="timeOut">超时</param>
        /// <param name="isDebug">测试模式</param>
        public WebHost(Type httpContentType = null, string root = "wwwroot", int port = 39654, bool isStaticsCached = true, bool isZiped = true, int bufferSize = 1024 * 10, int count = 10000, int timeOut = 120 * 1000, bool isDebug = false)
        {
            if (httpContentType != null && _httpContentType.GetInterface("SAEA.Http.Model.IHttpContext", true) != null)
            {
                _httpContentType = httpContentType;
            }
            else
            {
                _httpContentType = typeof(HttpContext);
            }

            WebConfig = new WebConfig()
            {
                Root             = root,
                Port             = port,
                IsStaticsCached  = isStaticsCached,
                IsZiped          = isZiped,
                HandleBufferSize = bufferSize,
                ClientCounts     = count
            };

            HttpUtility = new HttpUtility(WebConfig.Root);

            if (isDebug)
            {
                _serverSocket = new HttpSocketDebug(port, bufferSize, count, timeOut);
            }

            else
            {
                _serverSocket = new HttpSocket(port, bufferSize, count, timeOut);
            }

            _serverSocket.OnRequested += _serverSocket_OnRequested;
            _serverSocket.OnError     += (e) => OnException?.Invoke(HttpContext.Current, e);
        }
Example #18
0
    public static string CreateFromEmailAddress(string User)
    {
        WebConfig wc = new WebConfig();

        string[] Names        = wc.Str("Email Users").Split('|');
        string   AdjustedName = null;

        foreach (string Name in Names)
        {
            string[] Parts = Name.Split('>');
            if (AdjustedName == null)
            {
                AdjustedName = Parts[1];
            }
            if (User.ToLower() == Parts[0].ToLower())
            {
                AdjustedName = Parts[1];
                break;
            }
        }

        AdjustedName += wc.Str("Email From");
        return(AdjustedName);
    }
        public MainWindow()
        {
            WebConfig webC = new WebConfig();
            webC.RemoteDebuggingPort = 8001;
            webC.RemoteDebuggingHost = "127.0.0.1";
            WebCore.Initialize(webC);

            InitializeComponent();

            HTMLWindow.UseINavigable = true;
            SetUpRoute(HTMLWindow.NavigationBuilder);

            var datacontext = new MVVMAwesomium.ViewModel.Example.ForNavigation.Couple();
            var my = new MVVMAwesomium.ViewModel.Example.ForNavigation.Person()
            {
                Name = "O Monstro",
                LastName = "Desmaisons",
                Local = new MVVMAwesomium.ViewModel.Example.Local() { City = "Florianopolis", Region = "SC" }
            };
            my.Couple = datacontext;
            datacontext.One = my;

            HTMLWindow.NavigateAsync(datacontext);
        }
Example #20
0
        /// <summary>
        /// 更新信息
        /// </summary>
        /// <param name="model">The model.</param>
        /// <returns>true if XXXX, false otherwise.</returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public bool Update(AdminLoginModel model)
        {
            string strSql = "update BM_Manager set LoginName=@LoginName,RoleId=@RoleId,UserName=@UserName,UserMobile=@UserMobile,UserEmail=@UserEmail";

            if (!string.IsNullOrEmpty(model.LoginPassword))
            {
                strSql += ",LoginPassword=@LoginPassword ";
            }


            strSql += " where ID=@ID ";

            SqlParameter[] param =
            {
                new SqlParameter("@ID",            model.ID),
                new SqlParameter("@LoginName",     model.LoginName),
                new SqlParameter("@LoginPassword", model.LoginPassword),
                new SqlParameter("@RoleId",        model.RoleId),
                new SqlParameter("@UserName",      model.UserName),
                new SqlParameter("@UserMobile",    model.UserMobile),
                new SqlParameter("@UserEmail",     model.UserEmail)
            };
            return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql, param) > 0);
        }
Example #21
0
        //载入权限菜单
        public override UserRoleMenuInfo LoadUserRoleMenuInfo(EHECD_SystemUserDTO t)
        {
            //用户的权限和菜单、菜单按钮信息
            UserRoleMenuInfo ret = new UserRoleMenuInfo();

            //从配置中查看启不启用权限
            if (WebConfig.LoadElement("UseUserRole") == "1")
            {
                //获取用户和用户角色下的菜单
                ret.UserMenu = LoadUserAndRolesMenu(t.ID);

                //获取用户的角色
                ret.UserRole = query.QueryList <UserRole>(@"SELECT
	                                                            r.ID,
	                                                            r.sRoleName,
	                                                            r.dModifyTime,
	                                                            r.iOrder
                                                            FROM
	                                                            EHECD_SystemUser_R_Role srr,
	                                                            EHECD_Role r
                                                            WHERE
	                                                            srr.sRoleID = r.ID
                                                            AND r.bIsDeleted = 0
                                                            AND srr.bIsDeleted = 0
                                                            AND r.bEnable = 1
                                                            AND srr.sUserID = @id ORDER BY r.iOrder;", new { id = t.ID });

                //判断是否开启绑定到菜单按钮
                if (WebConfig.LoadElement("UseMenuBottn") == "1")
                {
                    //获取这个用户所有的角色ID
                    string userRoles = string.Join(",", ret.UserRole.Select(m => string.Concat("'", m.ID, "'")));

                    //获取用户和用户角色的菜单按钮
                    for (int i = 0; i < ret.UserMenu.Count; i++)
                    {
                        ret.UserMenu[i].Buttons = LoadUserAndRolesMenuButton(userRoles, ret.UserMenu[i].ID, t.ID);
                    }
                }
                else
                {
                    //如果不启用菜单按钮和角色与客户绑定的话,则获取每个菜单的按钮
                    for (int i = 0; i < ret.UserMenu.Count; i++)
                    {
                        ret.UserMenu[i].Buttons = query.QueryList <UserMenuButton>(@"SELECT
	                                                                                        *
                                                                                        FROM
	                                                                                        EHECD_MenuButton
                                                                                        WHERE
	                                                                                        ID IN (
		                                                                                        SELECT DISTINCT
			                                                                                        sPrivilegeAccessValue
		                                                                                        FROM
			                                                                                        EHECD_Privilege
		                                                                                        WHERE
			                                                                                        sBelong = 'menu'
		                                                                                        AND sBelongValue = @ID
                                                                                                AND sPrivilegeMaster = 'menu'
                                                                                                AND sPrivilegeMasterValue = @ID
		                                                                                        AND sPrivilegeAccess = 'button'
	                                                                                        )
                                                                                        AND bIsDeleted = 0
                                                                                        ORDER BY iOrder;", new { ID = ret.UserMenu[i].ID });
                    }
                }
                ret.AllMenu = ret.UserMenu;
                //初始化菜单使其具有层级关系
                ret.UserMenu = InitMenu(ret.UserMenu);

                ret.LoadSuccess = true;
            }
            else
            {
                //如果不启用权限,就获取所有菜单
                ret.UserMenu = query.QueryList <UserMenu>("SELECT ID,sMenuName,sPID,sUrl,iOrder from EHECD_FunctionMenu WHERE bIsDeleted = 0 ORDER BY iOrder;", null);

                //判断是否开启菜单按钮配置:在不开启权限的情况下,这里的菜单按钮只获取绑定到个人身上的,不再获取绑定到权限的
                if (WebConfig.LoadElement("UseMenuBottn") == "1")
                {
                    //获取用户菜单按钮
                    for (int i = 0; i < ret.UserMenu.Count; i++)
                    {
                        ret.UserMenu[i].Buttons = LoadUserMenuButton(ret.UserMenu[i].ID, t.ID);
                    }
                }
                else
                {
                    //获取所有菜单按钮
                    for (int i = 0; i < ret.UserMenu.Count; i++)
                    {
                        ret.UserMenu[i].Buttons = query.QueryList <UserMenuButton>(@"SELECT
	                                                                                        *
                                                                                        FROM
	                                                                                        EHECD_MenuButton
                                                                                        WHERE
	                                                                                        ID IN (
		                                                                                        SELECT DISTINCT
			                                                                                        sPrivilegeAccessValue
		                                                                                        FROM
			                                                                                        EHECD_Privilege
		                                                                                        WHERE
			                                                                                        sBelong = 'menu'
		                                                                                        AND sBelongValue = @ID
                                                                                                AND sPrivilegeMaster = 'menu'
                                                                                                AND sPrivilegeMasterValue = @ID
		                                                                                        AND sPrivilegeAccess = 'button'
	                                                                                        )
                                                                                        AND bIsDeleted = 0
                                                                                        ORDER BY iOrder;", new { ID = ret.UserMenu[i].ID });
                    }
                }

                ret.AllMenu = ret.UserMenu;
                //初始化菜单使其具有层级关系
                ret.UserMenu = InitMenu(ret.UserMenu);

                ret.LoadSuccess = true;
            }

            return(ret);
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            // Adding meta Discription
            HtmlMeta objMeta = new HtmlMeta();
            objMeta.Name    = "Description";
            objMeta.Content = WebConfig.GetValues("MetaDiscription");
            this.Header.Controls.Add(objMeta);

            // Adding meta KeyWords
            objMeta         = new HtmlMeta();
            objMeta.Name    = "keywords";
            objMeta.Content = WebConfig.GetValues("MetaKeword");
            this.Header.Controls.Add(objMeta);

            //Loading Controls

            // ----------------------------------------------------------------------------------------------
            DDL_Education.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Education);
            DDL_Education.DataTextField  = "Item";
            DDL_Education.DataValueField = "Value";
            DDL_Education.DataBind();
            // ----------------------------------------------------------------------------------------------
            DDL_EduDetails.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.EduDetails);
            DDL_EduDetails.DataTextField  = "Item";
            DDL_EduDetails.DataValueField = "Value";
            DDL_EduDetails.DataBind();
            // ----------------------------------------------------------------------------------------------
            DDL_AnnualIncome.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.AnnualIncomeRange);
            DDL_AnnualIncome.DataTextField  = "Item";
            DDL_AnnualIncome.DataValueField = "Value";
            DDL_AnnualIncome.DataBind();
            // ----------------------------------------------------------------------------------------------
            DDL_Currency.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Currency);
            DDL_Currency.DataTextField  = "Item";
            DDL_Currency.DataValueField = "Value";
            DDL_Currency.DataBind();
            // ----------------------------------------------------------------------------------------------
            DDL_Occupation.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Occupation);
            DDL_Occupation.DataTextField  = "Item";
            DDL_Occupation.DataValueField = "Value";
            DDL_Occupation.DataBind();
            // ----------------------------------------------------------------------------------------------
            DDL_EmpIn.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.EmployedIn);
            DDL_EmpIn.DataTextField  = "Item";
            DDL_EmpIn.DataValueField = "Value";
            DDL_EmpIn.DataBind();
            // ----------------------------------------------------------------------------------------------
            DDL_BGroup.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.BloodGroup);
            DDL_BGroup.DataTextField  = "Item";
            DDL_BGroup.DataValueField = "Value";
            DDL_BGroup.DataBind();

            DDL_Diet.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Diet);
            DDL_Diet.DataTextField  = "Item";
            DDL_Diet.DataValueField = "Value";
            DDL_Diet.DataBind();
            // ----------------------------------------------------------------------------------------------
            DDL_Country.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Country);;
            DDL_Country.DataTextField  = "Item";
            DDL_Country.DataValueField = "Value";
            DDL_Country.DataBind();
            // ----------------------------------------------------------------------------------------------
            DDL_ResidenceIn.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Country);;
            DDL_ResidenceIn.DataTextField  = "Item";
            DDL_ResidenceIn.DataValueField = "Value";
            DDL_ResidenceIn.DataBind();
            // ----------------------------------------------------------------------------------------------
            DDL_State.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.State);;
            DDL_State.DataTextField  = "Item";
            DDL_State.DataValueField = "Value";
            DDL_State.DataBind();
            // ----------------------------------------------------------------------------------------------
            DDL_ResidentialStatus.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.ResidenceStatus);;
            DDL_ResidentialStatus.DataTextField  = "Item";
            DDL_ResidentialStatus.DataValueField = "Value";
            DDL_ResidentialStatus.DataBind();
            // ----------------------------------------------------------------------------------------------
            short shortCounter;
            DDL_Weight.Items.Insert(0, "-- Select --");
            for (shortCounter = 40; shortCounter <= 140; ++shortCounter)
            {
                DDL_Weight.Items.Add(shortCounter + " KG");
            }


            // ----------------------------------------------------------------------------------------------
            // Lodig selections
            // ----------------------------------------------------------------------------------------------
            // Getting applicationID from Cookie
            HttpCookieCollection objHttpCookieCollection = Request.Cookies;
            HttpCookie           objHttpCookie           = objHttpCookieCollection.Get("MatCookie5639sb");

            string strApplicationID = Crypto.DeCrypto(objHttpCookie.Values["ApplicationID"]);
            //If Cookie is working
            if (strApplicationID != null)
            {
                //Get Member Informations
                MatMember objMember = new MatMember(true, strApplicationID, false, false, false, true, true, true, false, false, false, false);
                DDL_Education.SelectedIndex    = objMember.Education;
                DDL_EduDetails.SelectedIndex   = objMember.EduDetails;
                DDL_AnnualIncome.SelectedIndex = objMember.AnualIncome;
                DDL_Currency.SelectedIndex     = objMember.IncomeIn;
                DDL_Occupation.SelectedIndex   = objMember.Occupation;
                DDL_EmpIn.SelectedIndex        = objMember.EmployedIn;
                // ----------------------------------------------------------------------------------------------
                L_Height.Text            = objMember.Height.ToString() + " Cm";;
                DDL_Weight.SelectedIndex = objMember.Weight - 40;
                DDL_BGroup.SelectedIndex = objMember.BloodGroup;
                L_Complexion.Text        = ControlDataLoader.GetIndexValue(ControlDataLoader.ControlType.Complexion, objMember.Complexion);
                switch (objMember.BodyType)
                {
                case 1:
                    RB_BType_Slim.Checked = true;
                    break;

                case 2:
                    RB_BType_Avg.Checked = true;
                    break;

                case 3:
                    RB_BType_Ath.Checked = true;
                    break;

                case 4:
                    RB_BType_Heavy.Checked = true;
                    break;

                default:
                    break;
                }
                // ----------------------------------------------------------------------------------------------
                DDL_Diet.SelectedIndex = objMember.Diet;

                switch (objMember.Smoke)
                {
                case 1:
                    RB_Smoke_no.Checked = true;
                    break;

                case 2:
                    RB_Smoke_Yes.Checked = true;
                    break;

                case 3:
                    RB_Smoke_Occ.Checked = true;
                    break;

                default:
                    break;
                }
                // ----------------------------------------------------------------------------------------------
                switch (objMember.Drink)
                {
                case 1:
                    RB_Drink_No.Checked = true;
                    break;

                case 2:
                    RB_Drink_Yes.Checked = true;
                    break;

                case 3:
                    RB_Drink_Occ.Checked = true;
                    break;

                default:
                    break;
                }
                // ----------------------------------------------------------------------------------------------
                //Contact Details
                // ----------------------------------------------------------------------------------------------
                TB_Address.Text = objMember.Address;

                DDL_Country.SelectedIndex = objMember.Country;

                DDL_State.SelectedIndex = objMember.State;

                TB_City.Text = objMember.City;

                DDL_ResidenceIn.SelectedIndex = objMember.Residence;

                DDL_ResidentialStatus.SelectedIndex = objMember.ResidenceType;

                TB_Phone_ISD.Text = "+" + objMember.ISDCode.ToString();
                TB_Phone_STD.Text = objMember.AreaCode.ToString();
                TB_Phone_NO.Text  = objMember.PhoneNo.ToString();

                TB_Phone_Mobile.Text = objMember.MobileNO.ToString();

                TB_RCity.Text = objMember.ResidenceCity;

                objMember = null;
                // ----------------------------------------------------------------------------------------------
            }//If StrApplicationID != Null
        }   //if
        else
        {
            sbyte  sbyteFlag = 0;
            string strApplicationID;
            try
            {
                HttpCookieCollection objHttpCookieCollection = Request.Cookies;
                HttpCookie           objHttpCookie           = objHttpCookieCollection.Get("MatCookie5639sb");

                strApplicationID = Crypto.DeCrypto(objHttpCookie.Values["ApplicationID"]);
                if (strApplicationID != null)
                {
                    //Inserting  Education and Occupation
                    sbyteFlag = MatrimonialProfileManager.UpdateEducationalInfo(strApplicationID, (sbyte)DDL_Education.SelectedIndex,
                                                                                (sbyte)DDL_EduDetails.SelectedIndex, (sbyte)DDL_AnnualIncome.SelectedIndex,
                                                                                (short)DDL_Currency.SelectedIndex, (sbyte)DDL_Occupation.SelectedIndex,
                                                                                (sbyte)DDL_EmpIn.SelectedIndex);

                    // setting Physical Attributes

                    sbyte sbyteBodyType = 0;
                    sbyte sbyteSmoke    = 0;
                    sbyte sbyteDrink    = 0;

                    if (RB_BType_Slim.Checked)
                    {
                        sbyteBodyType = 1;
                    }
                    else if (RB_BType_Avg.Checked)
                    {
                        sbyteBodyType = 2;
                    }
                    else if (RB_BType_Ath.Checked)
                    {
                        sbyteBodyType = 3;
                    }
                    else if (RB_BType_Heavy.Checked)
                    {
                        sbyteBodyType = 4;
                    }

                    //Smoking Habite
                    if (RB_Smoke_no.Checked)
                    {
                        sbyteSmoke = 1;
                    }
                    else if (RB_Smoke_Yes.Checked)
                    {
                        sbyteSmoke = 2;
                    }
                    else if (RB_Smoke_Occ.Checked)
                    {
                        sbyteSmoke = 3;
                    }

                    //Drinking Habit
                    if (RB_Drink_No.Checked)
                    {
                        sbyteDrink = 1;
                    }
                    else if (RB_Drink_Yes.Checked)
                    {
                        sbyteDrink = 2;
                    }
                    else if (RB_Drink_Occ.Checked)
                    {
                        sbyteDrink = 3;
                    }

                    // ----------------------------------------------------------------------------------------------
                    //Inserting Physical Attributes
                    sbyteFlag += MatrimonialProfileManager.UpdatePhysicalInfo(strApplicationID,
                                                                              (short)DDL_Weight.SelectedIndex, (sbyte)DDL_BGroup.SelectedIndex, sbyteBodyType,
                                                                              (sbyte)DDL_Diet.SelectedIndex, sbyteSmoke, sbyteDrink);
                    // ----------------------------------------------------------------------------------------------
                    //Setting Contact Details
                    sbyteFlag += MatrimonialProfileManager.UpdateContactInfo(strApplicationID, TB_Address.Text, (short)DDL_Country.SelectedIndex,
                                                                             (sbyte)DDL_State.SelectedIndex, TB_City.Text, TB_Phone_NO.Text, TB_Phone_STD.Text, TB_Phone_ISD.Text,
                                                                             TB_Phone_Mobile.Text, (sbyte)DDL_ResidenceIn.SelectedIndex, (sbyte)DDL_ResidentialStatus.SelectedIndex,
                                                                             TB_RCity.Text);
                    // ----------------------------------------------------------------------------------------------
                }

                if (sbyteFlag == 3)// Every module is updated correctly
                {
                    Response.Redirect("EditProfile-S3.aspx");
                }
                else// Some have some error
                {
                    Server.Transfer("../Extras/ErrorReport.aspx");
                }
            }
            catch (Exception Ex)//Oops Some Error Happend
            {
                ErrorLog.WriteErrorLog("Member-EditProfile S2-PB", Ex);
                Server.Transfer("../Extras/ErrorReport.aspx?id=Cookie");
            }
        }//postbak
    }
Example #23
0
    private void IsuseOpenNotice(string Transmessage)
    {
        XmlDocument document          = new XmlDocument();
        XmlNodeList elementsByTagName = null;
        XmlNodeList list2             = null;
        XmlNodeList list3             = null;

        try
        {
            document.Load(new StringReader(Transmessage));
            elementsByTagName = document.GetElementsByTagName("*");
            list2             = document.GetElementsByTagName("bonusItem");
            list3             = document.GetElementsByTagName("issue");
        }
        catch
        {
        }
        if (elementsByTagName != null)
        {
            string winNumber = "";
            for (int i = 0; i < elementsByTagName.Count; i++)
            {
                if ((elementsByTagName[i].Name.ToUpper() == "BODY") && (elementsByTagName[i].FirstChild.Name.ToUpper() == "BONUSNOTIFY"))
                {
                    winNumber = elementsByTagName[i].FirstChild.Attributes["bonusNumber"].InnerText;
                }
            }
            if (list3 == null)
            {
                base.Response.End();
            }
            else
            {
                string    messageID   = elementsByTagName[0].Attributes["id"].Value;
                string    input       = list3[0].Attributes["number"].Value;
                string    lotteryName = list3[0].Attributes["gameName"].Value;
                int       LotteryID   = this.GetLotteryID(lotteryName);
                string    str5        = this.GetWinNumber(LotteryID, winNumber);
                DataTable table       = new Tables.T_Isuses().Open("", " [Name] = '" + Utility.FilteSqlInfusion(input) + "' and LotteryID = " + LotteryID.ToString() + " and IsOpened = 0", "");
                if ((table == null) || (table.Rows.Count < 1))
                {
                    base.Response.End();
                }
                else
                {
                    string str = table.Rows[0]["ID"].ToString();
                    new Tables.T_Isuses {
                        WinLotteryNumber = { Value = str5 }, OpenOperatorID = { Value = 1 }
                    }.Update(" ID = " + str);
                    string bonusXML      = "<Schemes>";
                    string agentBonusXML = "<Schemes>";
                    if ((list2 != null) && (list2.Count > 0))
                    {
                        string  s   = Transmessage.Substring(Transmessage.IndexOf("<bonusNotify"), Transmessage.LastIndexOf("</body>") - Transmessage.IndexOf("<bonusNotify"));
                        DataSet set = new DataSet();
                        try
                        {
                            set.ReadXml(new StringReader(s));
                        }
                        catch (Exception exception)
                        {
                            new Log(@"ElectronTicket\HPSH").Write("电子票开奖,第 " + input + " 期解析开奖数据错误:" + exception.Message);
                            base.Response.End();
                            return;
                        }
                        if ((set == null) || (set.Tables.Count < 3))
                        {
                            new Log(@"ElectronTicket\HPSH").Write("电子票开奖,第 " + input + " 期开奖数据格式不符合要求。");
                            base.Response.End();
                            return;
                        }
                        DataTable source = set.Tables[2];
                        DataTable table3 = MSSQL.Select("SELECT SchemeID, AgentID, SchemesMultiple as Multiple, Identifiers FROM V_ElectronTicketAgentSchemesSendToCenter WHERE (IsuseID = " + str + ") UNION ALL SELECT SchemeID, 0 AS AgentID, SchemesMultiple as Multiple, Identifiers FROM V_SchemesSendToCenter WHERE (IsuseID = " + str + ")", new MSSQL.Parameter[0]);
                        if (table3 == null)
                        {
                            new Log(@"ElectronTicket\HPSH").Write("电子票开奖,第 " + input + " 期,读取本地方案错误。");
                            base.Response.End();
                            return;
                        }
                        try
                        {
                            foreach (var type in from NewDt in
                                     (from NewDt in
                                      (from NewDtTickets in source.AsEnumerable()
                                       join NewdtScheme in table3.AsEnumerable() on NewDtTickets.Field <string>("ticketID") equals NewdtScheme.Field <string>("Identifiers")
                                       select new { ID = NewdtScheme.Field <long>("SchemeID"), AgentID = NewdtScheme.Field <long>("AgentID"), Multiple = NewdtScheme.Field <int>("Multiple"), Bonus = _Convert.StrToDouble(NewDtTickets.Field <string>("money"), 0.0), BonusLevel = NewDtTickets.Field <string>("bonusLevel"), Size = _Convert.StrToInt(NewDtTickets.Field <string>("size"), 1) }).AsQueryable()
                                      group NewDt by new { NewDt.ID, NewDt.BonusLevel, NewDt.AgentID, NewDt.Multiple } into gg
                                      select new { ID = gg.Key.ID, AgentID = gg.Key.AgentID, Multiple = gg.Key.Multiple, Bonus = gg.Sum(NewDt => NewDt.Bonus), BonusLevel = this.GetSchemeWinDescription(gg.Key.BonusLevel, LotteryID, gg.Sum(NewDt => NewDt.Size) / gg.Key.Multiple) }).AsQueryable()
                                     group NewDt by new { ID = NewDt.ID, Multiple = NewDt.Multiple, AgentID = NewDt.AgentID } into t_dtSchemes
                                     select new { SchemeID = t_dtSchemes.Key.ID, AgentID = t_dtSchemes.Key.AgentID, Multiple = t_dtSchemes.Key.Multiple, Bonus = t_dtSchemes.Sum(NewDt => NewDt.Bonus), BonusLevel = t_dtSchemes.Merge(NewDt => NewDt.BonusLevel) + ((t_dtSchemes.Key.Multiple != 1) ? ("(" + t_dtSchemes.Key.Multiple.ToString() + "倍)") : "") })
                            {
                                string str10;
                                if (type.AgentID == 0L)
                                {
                                    str10    = bonusXML;
                                    bonusXML = str10 + "<Scheme SchemeID=\"" + type.SchemeID.ToString() + "\" WinMoney=\"" + type.Bonus.ToString() + "\" WinDescription=\"" + type.BonusLevel + "\" />";
                                }
                                else
                                {
                                    str10         = agentBonusXML;
                                    agentBonusXML = str10 + "<Scheme SchemeID=\"" + type.SchemeID.ToString() + "\" WinMoney=\"" + type.Bonus.ToString() + "\" WinDescription=\"" + type.BonusLevel + "\" />";
                                }
                            }
                        }
                        catch (Exception exception2)
                        {
                            new Log(@"ElectronTicket\HPSH").Write("电子票开奖,第 " + input + " 期详细中奖数据解析错误:" + exception2.Message);
                            base.Response.End();
                            return;
                        }
                    }
                    bonusXML      = bonusXML + "</Schemes>";
                    agentBonusXML = agentBonusXML + "</Schemes>";
                    table         = new Tables.T_Isuses().Open("", "[ID] = " + str + " and IsOpened = 0", "");
                    if ((table == null) || (table.Rows.Count < 1))
                    {
                        base.Response.End();
                    }
                    else
                    {
                        int     returnValue       = 0;
                        string  returnDescription = "";
                        DataSet ds   = null;
                        int     num5 = 0;
                        int     num6 = -1;
                        string  appSettingsString = WebConfig.GetAppSettingsString("ConnectionString");
                        if (appSettingsString.StartsWith("0x78AD"))
                        {
                            appSettingsString = Encrypt.Decrypt3DES(PF.GetCallCert(), appSettingsString.Substring(6), PF.DesKey);
                        }
                        SqlConnection conn = MSSQL.CreateDataConnection(appSettingsString + ";Connect Timeout=150;");
                        if (conn != null)
                        {
                            while ((num6 < 0) && (num5 < 5))
                            {
                                returnValue       = 0;
                                returnDescription = "";
                                num6 = this.P_ElectronTicketWin(conn, ref ds, _Convert.StrToLong(str, 0L), bonusXML, agentBonusXML, ref returnValue, ref returnDescription);
                                if (num6 < 0)
                                {
                                    string[] strArray = new string[] { "电子票第 ", (num5 + 1).ToString(), " 次派奖出现错误(IsuseOpenNotice) 期号为: ", input, ",彩种为: ", LotteryID.ToString() };
                                    new Log(@"ElectronTicket\HPSH").Write(string.Concat(strArray));
                                    num5++;
                                    if (num5 < 5)
                                    {
                                        Thread.Sleep(0x2710);
                                    }
                                }
                            }
                            if (returnValue < 0)
                            {
                                new Log(@"ElectronTicket\HPSH").Write("电子票派奖出现错误(IsuseOpenNotice) 期号为: " + input + ",彩种为: " + LotteryID.ToString() + ",错误:" + returnDescription);
                                base.Response.End();
                            }
                            else
                            {
                                PF.SendWinNotification(ds);
                                DataTable table4 = new Tables.T_WinTypes().Open("", " LotteryID =" + LotteryID.ToString(), "");
                                if ((table4 != null) && (table4.Rows.Count > 0))
                                {
                                    double[] winMoneyList = new double[table4.Rows.Count * 2];
                                    double   num8         = 0.0;
                                    double   num9         = 0.0;
                                    for (int j = 0; j < table4.Rows.Count; j++)
                                    {
                                        num8 = _Convert.StrToDouble(table4.Rows[j]["DefaultMoney"].ToString(), 0.0);
                                        num9 = _Convert.StrToDouble(table4.Rows[j]["DefaultMoneyNoWithTax"].ToString(), 0.0);
                                        winMoneyList[j * 2]       = (num8 == 0.0) ? 1.0 : num9;
                                        winMoneyList[(j * 2) + 1] = (num9 == 0.0) ? 1.0 : num9;
                                    }
                                    DataTable           table5            = new Views.V_Schemes().Open("", " IsuseName = '" + Utility.FilteSqlInfusion(input) + "' and LotteryID = " + LotteryID.ToString() + " and WinMoney = 0  and Buyed = 0 and ID in ( select ID from V_ChaseTaskDetails where IsuseName = '" + Utility.FilteSqlInfusion(input) + "' and LotteryID = " + LotteryID.ToString() + ")", "");
                                    string              number            = "";
                                    Lottery.LotteryBase base2             = new Lottery()[LotteryID];
                                    string              description       = "";
                                    double              winMoneyNoWithTax = 0.0;
                                    for (int k = 0; k < table5.Rows.Count; k++)
                                    {
                                        number            = table5.Rows[k]["LotteryNumber"].ToString();
                                        description       = "";
                                        winMoneyNoWithTax = 0.0;
                                        double winMoney = base2.ComputeWin(number, str5.Trim(), ref description, ref winMoneyNoWithTax, int.Parse(table5.Rows[k]["PlayTypeID"].ToString()), winMoneyList);
                                        if ((winMoney > 0.0) && (Procedures.P_ChaseTaskStopWhenWin(_Convert.StrToLong(table5.Rows[k]["SiteID"].ToString(), 0L), _Convert.StrToLong(table5.Rows[k]["ID"].ToString(), 0L), winMoney, ref returnValue, ref returnDescription) < 0))
                                        {
                                            new Log(@"ElectronTicket\HPSH").Write("执行电子票--判断是否停止追号的时候出现错误");
                                        }
                                    }
                                }
                                messageID = elementsByTagName[0].Attributes["id"].Value;
                                this.ReNotice(messageID, "508");
                            }
                        }
                        else
                        {
                            base.Response.End();
                        }
                    }
                }
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //-------------------------------------------------------------------------------------------------------------------
            // Adding meta Discription
            HtmlMeta objMeta = new HtmlMeta();
            objMeta.Name    = "Description";
            objMeta.Content = WebConfig.GetValues("MetaDiscription");
            this.Header.Controls.Add(objMeta);
            //-------------------------------------------------------------------------------------------------------------------
            // Adding meta KeyWords
            objMeta         = new HtmlMeta();
            objMeta.Name    = "keywords";
            objMeta.Content = WebConfig.GetValues("MetaKeword");
            this.Header.Controls.Add(objMeta);
            //-------------------------------------------------------------------------------------------------------------------
            //Connect To database
            //Laod Religion
            //-------------------------------------------------------------------------------------------------------------------
            LB_Religion.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Religion);;
            LB_Religion.DataTextField  = "Item";
            LB_Religion.DataValueField = "Value";
            LB_Religion.DataBind();
            LB_Religion.Items.RemoveAt(0);
            //Laod Caste
            //-------------------------------------------------------------------------------------------------------------------
            LB_Caste.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Cast);;
            LB_Caste.DataTextField  = "Item";
            LB_Caste.DataValueField = "Value";
            LB_Caste.DataBind();
            LB_Caste.Items.RemoveAt(0);
            //Load Education
            //-------------------------------------------------------------------------------------------------------------------
            LB_Education.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Education);;
            LB_Education.DataTextField  = "Item";
            LB_Education.DataValueField = "Value";
            LB_Education.DataBind();
            LB_Education.Items.RemoveAt(0);
            //Load Occupation
            //-------------------------------------------------------------------------------------------------------------------
            LB_Occupation.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Occupation);;
            LB_Occupation.DataTextField  = "Item";
            LB_Occupation.DataValueField = "Value";
            LB_Occupation.DataBind();
            LB_Occupation.Items.RemoveAt(0);
            //Load Country
            //-------------------------------------------------------------------------------------------------------------------
            LB_Country.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Country);;
            LB_Country.DataTextField  = "Item";
            LB_Country.DataValueField = "Value";
            LB_Country.DataBind();
            LB_Country.Items.RemoveAt(0);
            //-------------------------------------------------------------------------------------------------------------------
            Int16 Int16Counter;
            DDL_Height_Min.Items.Insert(0, "-- Select --");
            DDL_Height_Max.Items.Insert(0, "-- Select --");
            for (Int16Counter = 90; Int16Counter <= 185; ++Int16Counter)
            {
                DDL_Height_Min.Items.Insert(Int16Counter - 89, Int16Counter + " CM");
                DDL_Height_Max.Items.Insert(Int16Counter - 89, Int16Counter + 1 + " CM");
            }
            //-------------------------------------------------------------------------------------------------------------------
        }
        else
        {
            //Adding Select
            //-------------------------------------------------------------------------------------------------------------------
            string strSQL = "SELECT MatrimonialMemberShip.MatrimonialID ";
            //-------------------------------------------------------------------------------------------------------------------
            // Adding Innerjoining statment depending on Photo
            //-------------------------------------------------------------------------------------------------------------------
            if (CB_needPhoto.Checked)
            {
                strSQL += "   FROM  UserAuthentication INNER JOIN "
                          + " UserBasicInformation ON MatrimonialMemberShip.ApplicationID = UserBasicInformation.ApplicationID INNER JOIN"
                          + " UserContactInformations ON MatrimonialMemberShip.ApplicationID = UserContactInformations.ApplicationID INNER JOIN"
                          + " UserEducationAndOccupation ON MatrimonialMemberShip.ApplicationID = UserEducationAndOccupation.ApplicationID INNER JOIN"
                          + " UserPhysicalAttributes ON MatrimonialMemberShip.ApplicationID = UserPhysicalAttributes.ApplicationID INNER JOIN"
                          + " UserAlbum ON MatrimonialMemberShip.ApplicationID = UserAlbum.ApplicationID";
            }
            else//-------------------------------------------------------------------------------------------------------------------
            {
                strSQL += "    FROM  UserAuthentication INNER JOIN"
                          + " UserBasicInformation ON MatrimonialMemberShip.ApplicationID = UserBasicInformation.ApplicationID INNER JOIN"
                          + " UserContactInformations ON MatrimonialMemberShip.ApplicationID = UserContactInformations.ApplicationID INNER JOIN"
                          + " UserEducationAndOccupation ON MatrimonialMemberShip.ApplicationID = UserEducationAndOccupation.ApplicationID INNER JOIN"
                          + " UserPhysicalAttributes ON MatrimonialMemberShip.ApplicationID = UserPhysicalAttributes.ApplicationID";
            }
            //-------------------------------------------------------------------------------------------------------------------
            // Adding Filter
            //-------------------------------------------------------------------------------------------------------------------
            string SQLWHERE = " WHERE (";
            //-------------------------------------------------------------------------------------------------------------------
            SQLWHERE += " ( ";
            //-------------------------------------------------------------------------------------------------------------------
            // Basic Deteils
            //-------------------------------------------------------------------------------------------------------------------
            SQLWHERE += " (( MatrimonialMemberShip.Membership = 5)OR(MatrimonialMemberShip.Membership = 6 ))  AND (MatrimonialMemberShip.Hidden IS NULL) ";
            //-------------------------------------------------------------------------------------------------------------------
            if (RB_Looking_male.Checked)
            {
                SQLWHERE += " AND ( UserBasicInformation.Gender = 1) ";
            }
            else
            {
                SQLWHERE += " AND ( UserBasicInformation.Gender = 0) ";
            }
            //-------------------------------------------------------------------------------------------------------------------
            SQLWHERE += " AND (DATEDIFF(year,UserBasicInformation.DOB, getdate()) BETWEEN " + TB_Age_Min.Text + " AND " + TB_Age_Max.Text + ") ";

            //-------------------------------------------------------------------------------------------------------------------
            SQLWHERE += " )"
                        + " AND";
            //-------------------------------------------------------------------------------------------------------------------

            // NonBasic Details
            SQLWHERE += " ( ";
            //-------------------------------------------------------------------------------------------------------------------
            //Height
            //-------------------------------------------------------------------------------------------------------------------
            string strOptionalAnd = " ";
            if (DDL_Height_Max.SelectedIndex > 0)
            {
                SQLWHERE      += "( UserPhysicalAttributes.Height BETWEEN " + (DDL_Height_Min.SelectedIndex + 90).ToString() + " AND " + (DDL_Height_Max.SelectedIndex + 90).ToString() + " )";
                strOptionalAnd = " AND "; //Setting Flag
            }
            //-------------------------------------------------------------------------------------------------------------------
            //          Maritals Status
            //-------------------------------------------------------------------------------------------------------------------
            if ((CB_MaritalStatus_UM.Checked) || (CB_MaritalStatus_Div.Checked) || (CB_MaritalStatus_WW.Checked) || (CB_MaritalStatus_Sep.Checked))
            {
                //Setting Flag
                string strOptionalOr = " ";
                SQLWHERE += strOptionalAnd + " ( ";
                if (CB_MaritalStatus_UM.Checked)
                {
                    SQLWHERE     += " UserBasicInformation.MaritalStatus = 1 ";
                    strOptionalOr = " OR ";//Setting Flag
                }
                if (CB_MaritalStatus_WW.Checked)
                {
                    SQLWHERE     += strOptionalOr + " UserBasicInformation.MaritalStatus = 2 ";
                    strOptionalOr = " OR ";//Setting Flag
                }
                if (CB_MaritalStatus_Div.Checked)
                {
                    SQLWHERE     += strOptionalOr + " UserBasicInformation.MaritalStatus = 3 ";
                    strOptionalOr = " OR ";//Setting Flag
                }
                if (CB_MaritalStatus_Sep.Checked)
                {
                    SQLWHERE += strOptionalOr + " UserBasicInformation.MaritalStatus = 4 ";
                }
                SQLWHERE      += " ) ";
                strOptionalAnd = " AND ";
            } //End OF MaritalStatus
            //-------------------------------------------------------------------------------------------------------------------
            //          SubCast
            //-------------------------------------------------------------------------------------------------------------------
            if (TB_Subcast.Text == null)
            {
                SQLWHERE      += " AND ( FREETEXT(UserBasicInformation.SubCast,'" + TB_Subcast.Text + "' )";
                strOptionalAnd = " AND "; //Setting Flag
            }
            //-------------------------------------------------------------------------------------------------------------------
            //Adding Religion
            //-------------------------------------------------------------------------------------------------------------------
            if (!CB_Religion_Any.Checked)
            {
                SQLWHERE += strOptionalAnd;
                SQLWHERE += " ( ";
                string strOptionalOr = " ";
                foreach (ListItem listItem in LB_Religion.Items)
                {
                    if (listItem.Selected)
                    {
                        strOptionalAnd = " AND ";
                        SQLWHERE      += strOptionalOr + " UserBasicInformation.Religion = " + listItem.Value;
                        strOptionalOr  = " OR ";
                    }
                }
                SQLWHERE += " ) ";
            }
            //-------------------------------------------------------------------------------------------------------------------
            //   Caste
            //-------------------------------------------------------------------------------------------------------------------
            if (!CB_Caste_Any.Checked)
            {
                SQLWHERE += strOptionalAnd;
                SQLWHERE += " ( ";
                string strOptionalOr = " ";
                foreach (ListItem listItem in LB_Caste.Items)
                {
                    if (listItem.Selected)
                    {
                        strOptionalAnd = " AND ";
                        SQLWHERE      += strOptionalOr + " UserBasicInformation.Cast = " + listItem.Value;
                        strOptionalOr  = " OR ";
                    }
                }
                SQLWHERE += " ) ";
            }

            //-------------------------------------------------------------------------------------------------------------------
            //      Education
            //-------------------------------------------------------------------------------------------------------------------

            if (!CB_Education_Any.Checked)
            {
                SQLWHERE += strOptionalAnd;
                SQLWHERE += " ( ";
                string strOptionalOr = " ";
                foreach (ListItem listItem in LB_Education.Items)
                {
                    if (listItem.Selected)
                    {
                        strOptionalAnd = " AND ";
                        SQLWHERE      += strOptionalOr + " UserEducationAndOccupation.Education = " + listItem.Value;
                        strOptionalOr  = " OR ";
                    }
                }
                SQLWHERE += " ) ";
            }
            //-------------------------------------------------------------------------------------------------------------------
            //  Occupation
            //-------------------------------------------------------------------------------------------------------------------
            if (!CB_Occupation_any.Checked)
            {
                SQLWHERE += strOptionalAnd;
                SQLWHERE += " ( ";
                string strOptionalOr = " ";
                foreach (ListItem listItem in LB_Occupation.Items)
                {
                    if (listItem.Selected)
                    {
                        strOptionalAnd = " AND ";
                        SQLWHERE      += strOptionalOr + "  UserEducationAndOccupation.Occupation = " + listItem.Value;
                        strOptionalOr  = " OR ";
                    }
                }
                SQLWHERE += " ) ";
            }
            //-------------------------------------------------------------------------------------------------------------------
            //      Country
            //-------------------------------------------------------------------------------------------------------------------
            if (!CB_Country_Any.Checked)
            {
                SQLWHERE += strOptionalAnd;
                SQLWHERE += " ( ";
                string strOptionalOr = " ";
                foreach (ListItem listItem in LB_Country.Items)
                {
                    if (listItem.Selected)
                    {
                        strOptionalAnd = " AND ";
                        SQLWHERE      += strOptionalOr + "  UserContactInformations.Country = " + listItem.Value;
                        strOptionalOr  = " OR ";
                    }
                }
                SQLWHERE += " ) ";
            }
            //-------------------------------------------------------------------------------------------------------------------
            //      Closing Query
            //-------------------------------------------------------------------------------------------------------------------
            SQLWHERE += " ) ) ";
            strSQL   += SQLWHERE;
            //-------------------------------------------------------------------------------------------------------------------
            string strRandom = RandomString.Generate(5, 7);
            Session.Add(strRandom, strSQL);
            //-------------------------------------------------------------------------------------------------------------------
            //Server.Transfer("" + strRandom);
            Response.Redirect("SearchResult.aspx?typ=5&str=" + strRandom);
            //-------------------------------------------------------------------------------------------------------------------
        }
    }
Example #25
0
        // --------------------------------------------------
        // Run
        // --------------------------------------------------
        public void Run(String scriptFile)
        {
            // Setup our configuration
            WebConfig config = new WebConfig() {
                LogLevel   = LogLevel.None,
                UserScript = File.ReadAllText("assets/UserScript.js"),
                RemoteDebuggingPort = 8001,
            };
            // Initialize the Awesomium WebCore
            WebCore.Initialize(config);
            // Make an in-memory session for working with multiple instances
            WebSession session = WebCore.CreateWebSession(new WebPreferences() {});
            // Add the scrape datasource to the session
            session.AddDataSource("scrape", new DirectoryDataSource("assets"));
            // Create our browser
            this.browser = new Browser(session);
            // Create the bridge
            Bridge = browser.CreateGlobalJavascriptObject("Scrape");
            // Make the back function
            Bridge.Bind("back", true, (o,e) => Command_GoBack(""));
            // Make the click function
            Bridge.Bind("click", true, (o,e) => Click(e.Arguments[0]));
            // Make a function for writing data
            Bridge.Bind("dumptext", true, (o,e) => DumpText(e.Arguments[0], e.Arguments[1]));
            // Make the include function (with no return value)
            Bridge.Bind("include", true, (o,e)=>Include(e.Arguments[0]));
            // Make the loadtext function
            Bridge.Bind("loadtext", true, (o,e) => e.Result = LoadText(e.Arguments[0]));
            // Make the log function
            Bridge.Bind("log", true, (o,e) =>log.Info(e.Arguments[0]));
            // Make the screenshot function
            Bridge.Bind("screenshot", true, (o,e) => Command_Screenshot(""));
            // Add a user agent interceptor
            WebCore.ResourceInterceptor = new ResourceInterceptor();
            // If a scriptFile was passed, then setup a line for that
            if(scriptFile != null) lines.Enqueue("scrape " + scriptFile);

            Thread repl = new Thread(() => {
                try {
                    while(Running) {
                        // Get a line of input from the user
                        String line = Readline.ReadLine("> ");
                        // Handle CTRL-D
                        if(line == null) Quit();
                        else {
                            // Trim whitespace
                            line = line.Trim();
                            // Add the line to the history
                            History.AddHistory(line);
                            // Add this line to the queue
                            lines.Enqueue(line);
                        }
                    }
                } catch(ThreadInterruptedException) {
                }
            });
            repl.Start();

            // The input loop
            while(Running) {
                Thread.Sleep(200);
                WebCore.Update();
                if(lines.Count > 0) ProcessLine(lines.Dequeue());
            }

            // Force quite the repl thread
            // FIXME: TODO: Change this to interrupt
            repl.Abort();
            // WebCore isn't smart enough to clean itself up
            WebCore.Shutdown();
        }
Example #26
0
 public override void AdjustWebConfig(WebConfig wc) { }
Example #27
0
 /// <summary>
 /// 构造方法
 /// </summary>
 public ExpRateHelper()
 {
     user = WebConfig.GetSession();
     bll  = new YDS6000.BLL.Exp.Syscont.ExpRateBLL(user.Ledger, user.Uid);
     WebConfig.GetSysConfig();
 }
Example #28
0
 public override void AdjustWebConfig(WebConfig wc)
 {
     wc._AssemblyDomain = "Microsoft";
     wc._AssemblyDomainVersion = DataFxAssemblyRef.DataFxAssemblyVersion;
     wc._AssemblyPublicKeyToken = DataFxAssemblyRef.SharedLibPublicKeyToken;
     wc._AssemblyVersion = "4.0.0.0";
     wc._CompilerAssemblyVersion = "4.0.0.0";
     wc._CompilerVersion = "4.0";
 }
Example #29
0
        public string GetSLMEncryptPassword()
        {
            var paramEntity = this.GetCacheParamByName(WebConfig.GetSLMEncryptPassword());

            return((paramEntity != null) ? paramEntity.ParamValue : string.Empty);
        }
Example #30
0
 private static async Task GetMailboxJobAsync()
 {
     using (var client = new CSMMailServiceClient())
     {
         Task <JobTaskResponse> t      = client.GetMailboxAsync(WebConfig.GetWebUsername(), WebConfig.GetWebPassword());
         JobTaskResponse        result = await t;
     }
 }
Example #31
0
        public DWARFLoader()
        {
            List <String> args = Environment.GetCommandLineArgs().ToList();

            //args.Add("C:\\Users\\Kevin\\Documents\\Visual Studio 2013\\Projects\\DWARF\\DWARF\\examples\\Hello World\\helloworld.dwarf");
            //args.Add("C:\\Users\\Kevin\\Desktop\\Projects\\syndycate\\syndycate.dwarf");
            //args.Add("C:\\Users\\Kevin\\AppData\\Roaming\\Azuru\\DWARF\\Applications\\Solid Design\\app_info.dwarf");
            //args.Add(@"C:\Users\Kevin\AppData\Roaming\Azuru\DWARF\Applications\Foundry\app_info.dwarf");
            //args.Add(@"C:\Users\Kevin\Desktop\FileTrans\app_info.dwarf");


            if (args.Count < 2)
            {
                MessageBox.Show("Error: Please specify a DWARF project configuration file path.");
                Environment.Exit(0);
            }
            else if (args.Count > 2)
            {
                MessageBox.Show("Error: Only 1 argument is required.  If the path includes spaces, please encase it in double quotes.");
                Environment.Exit(0);
            }

            this.dwarf_conf_file = args[1];

            dynamic appInfo = DynamicJson.Parse(File.ReadAllText(dwarf_conf_file));

            //An aggregate catalog that combines multiple catalogs
            var catalog = new AggregateCatalog();

            //Adds all the parts found in the same assembly as the ApplicationForm class
            catalog.Catalogs.Add(new AssemblyCatalog(typeof(ApplicationForm).Assembly));

            if (appInfo.IsDefined("plugins"))
            {
                string[] pluginList = appInfo.plugins;

                foreach (string pluginn in pluginList)
                {
                    try
                    {
                        // TODO: finish this
                        if (File.Exists(Consts.AppData + "Plugins\\" + pluginn + "\\" + pluginn + ".dll"))
                        {
                            catalog.Catalogs.Add(new AssemblyCatalog(Assembly.LoadFile(Consts.AppData + "Plugins\\" + pluginn + "\\" + pluginn + ".dll")));
                        }
                        else
                        {
                            MessageBox.Show("Error!  Missing plugin: " + pluginn + "\n\nPlease install that plugin before running this application!\n\nError code 0x0001");
                            Environment.Exit(0);
                        }
                    }
                    catch
                    {
                        MessageBox.Show("Unable to load plugin: " + pluginn + "\n\n0x0003");
                    }

                    try
                    {
                        if (File.Exists(Consts.AppData + "Plugins\\" + pluginn + "\\" + pluginn + ".js"))
                        {
                            this.PluginJavascript += File.ReadAllText(Consts.AppData + "Plugins\\" + pluginn + "\\" + pluginn + ".js") + "\n";
                        }
                        else
                        {
                            MessageBox.Show("Error!  Missing plugin: " + pluginn + "\n\nPlease install that plugin before running this application!\n\nError code 0x0002");
                            Environment.Exit(0);
                        }
                    }
                    catch
                    {
                        MessageBox.Show("Unable to load plugin: " + pluginn + "\n\nError code 0x0004");
                    }
                }
            }

            //Create the CompositionContainer with the parts in the catalog
            _container = new CompositionContainer(catalog);

            //Fill the imports of this object
            try
            {
                this._container.ComposeParts(this);
            }
            catch (CompositionException compositionException)
            {
                Console.WriteLine(compositionException.ToString());
            }

            Directory.SetCurrentDirectory(new FileInfo(dwarf_conf_file).DirectoryName);

            AppName = appInfo.name;
            Author  = appInfo.author;

            WebConfig wc = new WebConfig();

            int frmlen = ((dynamic[])appInfo.forms).Length;

            if (appInfo.IsDefined("debugging") && ((bool)appInfo.debugging) == true)
            {
                DebugEnabled = true;

                appInfo.forms[frmlen] = new { name = "debug", title = "DWARF Debug Tool", file = "dwarf://debug", width = 780, height = 467, defaultwindowborder = true, canresize = true };
                frmlen++;

                //formsjson = newfrmarr;

                if (appInfo.IsDefined("debughost"))
                {
                    wc.RemoteDebuggingHost = appInfo.debughost;
                }
                else
                {
                    wc.RemoteDebuggingHost = "127.0.0.1";
                }

                if (appInfo.IsDefined("debugport"))
                {
                    wc.RemoteDebuggingPort = Convert.ToInt32(appInfo.debugport);
                }
                else
                {
                    wc.RemoteDebuggingPort = 7778;
                }

                //wc.AutoUpdatePeriod = 1;
            }
            else
            {
                wc.RemoteDebuggingHost = "";
                wc.RemoteDebuggingPort = 0;
            }

            //wc.UserAgent += " Azuru DWARF (AppName=" + AppName + ", v=" + System.Windows.Application.ResourceAssembly.ImageRuntimeVersion + ")";
            this.Dispatcher.Invoke(() => {
                WebCore.Initialize(wc);
            });


            if (File.Exists(new FileInfo(dwarf_conf_file).DirectoryName + "/forms/dwarf.assets/dwarf.controls.html"))
            {
                WindowControlsHTML = File.ReadAllText("forms/dwarf.assets/dwarf.controls.html").Replace("\n", "");
            }

            if (File.Exists(new FileInfo(dwarf_conf_file).DirectoryName + "/forms/dwarf.assets/dwarf.controls.css"))
            {
                WindowControlsCSS = File.ReadAllText("forms/dwarf.assets/dwarf.controls.css");
            }

            instance = this;

            //DynamicJson test = appInfo;

            for (int i = 0; i < frmlen; i++)
            {
                string name  = appInfo.forms[i].name;
                string title = appInfo.forms[i].title;
                string file  = appInfo.forms[i].file;

                bool windowctrls = true;

                if (appInfo.forms[i].IsDefined("windowcontrols"))
                {
                    windowctrls = appInfo.forms[i].windowcontrols;
                }

                ApplicationForm form = new ApplicationForm(file, false, windowctrls);

                if (appInfo.forms[i].IsDefined("defaultwindowborder") && (bool)(appInfo.forms[i].defaultwindowborder) == true)
                {
                    form.WindowStyle        = System.Windows.WindowStyle.SingleBorderWindow;
                    form.webView.ViewType   = WebViewType.Window;
                    form.AllowsTransparency = false;
                    form.UsesWindowControls = false;
                    form.border1.Margin     = new Thickness(0);
                    form.ResizeMode         = System.Windows.ResizeMode.CanMinimize;
                }

                if (appInfo.forms[i].IsDefined("startposition"))
                {
                    if (appInfo.forms[i].startposition == "center")
                    {
                        form.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
                    }
                    else if (appInfo.forms[i].startposition == "centerowner")
                    {
                        form.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
                    }
                    else if (appInfo.forms[i].startposition == "manual")
                    {
                        form.WindowStartupLocation = System.Windows.WindowStartupLocation.Manual;
                    }
                }

                if (appInfo.forms[i].IsDefined("canresize"))
                {
                    if (!(bool)appInfo.forms[i].canresize)
                    {
                        if (form.ResizeMode != System.Windows.ResizeMode.CanMinimize)
                        {
                            form.ResizeMode = System.Windows.ResizeMode.NoResize;
                        }
                        form.Left_Resize.Visibility        = System.Windows.Visibility.Hidden;
                        form.Right_Resize.Visibility       = System.Windows.Visibility.Hidden;
                        form.Bottom_Resize.Visibility      = System.Windows.Visibility.Hidden;
                        form.Top_Resize.Visibility         = System.Windows.Visibility.Hidden;
                        form.BottomLeft_Resize.Visibility  = System.Windows.Visibility.Hidden;
                        form.BottomRight_Resize.Visibility = System.Windows.Visibility.Hidden;
                        form.TopLeft_Resize.Visibility     = System.Windows.Visibility.Hidden;
                        form.TopRight_Resize.Visibility    = System.Windows.Visibility.Hidden;
                    }
                    else
                    {
                        form.ResizeMode = System.Windows.ResizeMode.CanResize;
                    }
                }

                if (appInfo.forms[i].IsDefined("width"))
                {
                    form.Width = appInfo.forms[i].width + 40;
                }

                if (appInfo.forms[i].IsDefined("height"))
                {
                    form.Height = appInfo.forms[i].height + 40;
                }

                if (appInfo.forms[i].IsDefined("position"))
                {
                    if (form.WindowStartupLocation == System.Windows.WindowStartupLocation.Manual)
                    {
                        form.Left = appInfo.forms[i].position[0];
                        form.Top  = appInfo.forms[i].position[1];
                    }
                }

                if (appInfo.forms[i].IsDefined("startupstate"))
                {
                    if (appInfo.forms[i].startupstate == "normal")
                    {
                        form.WindowState = System.Windows.WindowState.Normal;
                    }
                    else if (appInfo.forms[i].startupstate == "maximized")
                    {
                        form.WindowState = System.Windows.WindowState.Maximized;
                    }
                    else if (appInfo.forms[i].startupstate == "minimized")
                    {
                        form.WindowState = System.Windows.WindowState.Minimized;
                    }
                }

                if (appInfo.forms[i].IsDefined("opacity"))
                {
                    form.window.Opacity = appInfo.forms[i].opacity;
                }
                else
                {
                    form.window.Opacity = 1;
                }

                form.Title    = title;
                form.FormName = name;
                ChildForms.Add(name, form);
            }

            AppForm                = new ApplicationForm("", true, false);
            AppForm.FormName       = AppName;
            AppForm.Title          = AppName;
            AppForm.window.Opacity = 0;
            AppForm.Title          = "";
            AppForm.ShowInTaskbar  = false;
            AppForm.Visibility     = System.Windows.Visibility.Hidden;
            AppForm.WindowState    = WindowState.Minimized;
            AppForm.WindowStyle    = WindowStyle.None;

            AppForm.Show();

            if (DebugEnabled)
            {
                ChildForms["debug"].Show();
            }
        }
Example #32
0
 public MonitorHelper()
 {
     user = WebConfig.GetSession();
     bll  = new YDS6000.BLL.PDU.Monitor.MonitorBLL(user.Ledger, user.Uid);
 }
Example #33
0
 /// <summary>
 /// InitializeAwesomiumDebug performs necessary config for opening Awesomium
 /// developer tools in another chrome browser -
 /// conosle may not be printing as if real world
 /// </summary>
 private void intializeAwesomiumDebug()
 {
     //ReInitializeWebKitControl();
     WebConfig webC = new WebConfig();
     webC.RemoteDebuggingPort = 12345;
     webC.RemoteDebuggingHost = "127.0.0.1";
     WebCore.Initialize(webC);
 }
Example #34
0
        static void Main(string[] args)
        {
            bool help = false;
            bool screens = false;
            string user = null, pass = null;
            string chatUrl = null, scriptUrl = null;
            string sessionPath = null;
            // http://geekswithblogs.net/robz/archive/2009/11/22/command-line-parsing-with-mono.options.aspx
            OptionSet options = new OptionSet()
                .Add("?|h|help", "Print this message", option => help = option != null)
                .Add("u=|user=|username="******"Required: StackExchange username or email", option => user = option)
                .Add("p=|pass=|password="******"Required: StackExchange password", option => pass = option)
                .Add("c=|chat-url=", "Required: Chatroom URL", option => chatUrl = option)
                .Add("b=|bot-script=|script-url=", "Required: The URL of a bot script", option => scriptUrl = option)
                .Add("s|screens|screenshot", "Display screenshots at checkpoints", option => screens = option != null)
                .Add("session-path=", "Path to browser session (profile), where settings are saved", option => sessionPath = option);

            #if DEBUG
            string[] lines = File.ReadAllLines("account.txt");
            user = lines[0];
            pass = lines[1];
            chatUrl = "http://chat.stackexchange.com/rooms/118/root-access";
            scriptUrl = "https://raw.github.com/allquixotic/SO-ChatBot/master/master.js";
            screens = true;
            sessionPath = "session";
            #else
            try
            {
                options.Parse(args);
            }
            catch (OptionException)
            {
                ShowHelp(options, "Error - usage is:");
            }

            if (help)
            {
                ShowHelp(options, "Usage:");
            }

            if (user == null)
            {
                ShowHelp(options, "Error: A username is required");
            }

            if (pass == null)
            {
                ShowHelp(options, "Error: A password is required");
            }

            if (chatUrl == null)
            {
                ShowHelp(options, "Error: A chat URL is required");
            }

            if (scriptUrl == null)
            {
                ShowHelp(options, "Error: A bot script is required");
            }

            if (sessionPath == null)
            {
                sessionPath = "session";
            }
            #endif

            try
            {
                WebConfig config = new WebConfig();
                WebCore.Initialize(config);

                WebPreferences prefs = new WebPreferences();
                prefs.LoadImagesAutomatically = true;
                prefs.RemoteFonts = false;
                prefs.WebAudio = false;
                prefs.Dart = false;
                prefs.CanScriptsCloseWindows = false;
                prefs.CanScriptsOpenWindows = false;
                prefs.WebSecurity = false;
                prefs.Javascript = true;
                prefs.LocalStorage = true;
                prefs.Databases = false;            // ?

                aweSession = WebCore.CreateWebSession(sessionPath, prefs);
                aweSession.ClearCookies();
                aweView = WebCore.CreateWebView(1024, 768, aweSession);
                aweView.ResponsiveChanged += aweView_ResponsiveChanged;
                aweView.Crashed += aweView_Crashed;
                aweView.ConsoleMessage += aweView_ConsoleMessage;
                eView.WebView = aweView;
                eView.AutoScreenshot = true;
                eView.ScreenshotsEnabled = screens;

                go(user, pass, scriptUrl, chatUrl);
            }
            finally
            {
                if (aweView != null && aweView.IsResponsive)
                    aweView.Dispose();
                WebCore.Shutdown();
            }
        }
    protected override void OnLoad(EventArgs e)
    {
        if (!base.IsPostBack)
        {
            new FirstUrl().Save();
        }
        this.PageUrl = base.Request.Url.AbsoluteUri;
        this._Site   = new Sites()[1L];
        if (this._Site == null)
        {
            PF.GoError(1, "域名无效,限制访问", base.GetType().FullName);
        }
        else
        {
            this._User = Users.GetCurrentUser(this._Site.ID);
            if (this.isRequestLogin && (this._User == null))
            {
                PF.GoLogin(this.RequestLoginPage);
            }
            else
            {
                try
                {
                    PlaceHolder holder = this.Page.FindControl("phHead") as PlaceHolder;
                    if (holder != null)
                    {
                        UserControl child = this.Page.LoadControl("~/Home/Room/UserControls/WebHead.ascx") as UserControl;
                        holder.Controls.Add(child);
                    }
                    PlaceHolder holder2 = this.Page.FindControl("phFoot") as PlaceHolder;
                    if (holder2 != null)
                    {
                        UserControl control2 = this.Page.LoadControl("~/Home/Room/UserControls/WebFoot.ascx") as UserControl;
                        holder2.Controls.Add(control2);
                    }
                }
                catch
                {
                }
                string str = ((base.Request.Url.Query == "") ? base.Request.Url.AbsoluteUri : base.Request.Url.AbsoluteUri.Replace(base.Request.Url.Query, "")).Replace(Utility.GetUrl(), "").Replace("/", "_").Replace(".aspx", "");
                if (str.StartsWith("_"))
                {
                    str = str.Remove(0, 1);
                }
                if (FloatNotifyPageList.IndexOf("," + str + ",") > -1)
                {
                    StringBuilder builder          = new StringBuilder();
                    string        key              = "FloatNotifyContent";
                    DataTable     cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key);
                    if (cacheAsDataTable == null)
                    {
                        cacheAsDataTable = new Tables.T_FloatNotify().Open("", "", "[Order] asc,[DateTime] desc");
                        if ((cacheAsDataTable != null) && (cacheAsDataTable.Rows.Count > 0))
                        {
                            Shove._Web.Cache.SetCache(key, cacheAsDataTable, 0xea60);
                        }
                    }
                    bool   flag = false;
                    int    num  = this._Site.SiteOptions["Opt_FloatNotifiesTime"].ToInt(3);
                    string name = "LastLoginShowFloatNotifyUserID";
                    switch (num)
                    {
                    case 1:
                    {
                        HttpCookie cookie = base.Request.Cookies[name];
                        if ((cookie != null) && !string.IsNullOrEmpty(cookie.Value))
                        {
                            flag = true;
                        }
                        break;
                    }

                    case 2:
                        flag = DateTime.Now.Minute == 0;
                        break;

                    case 3:
                        flag = true;
                        break;
                    }
                    if (((cacheAsDataTable != null) && (cacheAsDataTable.Rows.Count > 0)) && flag)
                    {
                        DataRow[] rowArray = cacheAsDataTable.Select("isShow=1");
                        for (int i = 0; i < rowArray.Length; i++)
                        {
                            if (i == 2)
                            {
                                break;
                            }
                            int num4 = i + 1;
                            builder.Append("<font color='" + rowArray[i]["Color"].ToString() + "'>").Append(num4.ToString()).Append(".</font>").Append("<a href='").Append(rowArray[i]["Url"].ToString()).Append("' target='_blank' style='text-decoration: none;color:").Append(rowArray[i]["Color"].ToString()).Append(";' onmouseover=\"this.style.color='#ff6600';\" onmouseout=\"this.style.color='").Append(rowArray[i]["Color"].ToString()).Append("';\">").Append(rowArray[i]["Title"].ToString()).Append("</a><br />");
                        }
                        string html  = HmtlManage.GetHtml(AppDomain.CurrentDomain.BaseDirectory + "Home/Web/Template/FloatNotify.html");
                        Label  label = new Label();
                        int    num5  = FloatNotifyTimeOut * 100;
                        label.Text = html.Replace("$FloatNotifyTimeOut$", num5.ToString()).Replace("$FloatNotifyContent$", builder.ToString());
                        try
                        {
                            base.Form.Controls.AddAt(0, label);
                        }
                        catch (Exception exception)
                        {
                            new Log("Page").Write(str + exception.Message);
                        }
                        HttpCookie cookie2 = new HttpCookie(name)
                        {
                            Value   = "",
                            Expires = DateTime.Now.AddYears(-20)
                        };
                        try
                        {
                            HttpContext.Current.Response.Cookies.Add(cookie2);
                        }
                        catch
                        {
                        }
                    }
                }
                string fullName = base.GetType().FullName;
                try
                {
                    fullName = fullName.Substring(4, fullName.Length - 9);
                }
                catch
                {
                }
                int appSettingsInt = WebConfig.GetAppSettingsInt(fullName, -1);
                if (appSettingsInt > 0)
                {
                    base.Response.Cache.SetExpires(DateTime.Now.AddSeconds((double)appSettingsInt));
                    base.Response.Cache.SetCacheability(HttpCacheability.Server);
                    base.Response.Cache.VaryByParams["*"] = true;
                    base.Response.Cache.SetValidUntilExpires(true);
                    base.Response.Cache.SetVaryByCustom("SitePage");
                }
                base.OnLoad(e);
            }
        }
    }
Example #36
0
 public WebConfigFixture()
 {
     //Web configed is copied as a linked file to this test project.
     _sut = new WebConfig();
 }
Example #37
0
 public RoleService(IWorkContext workContext, HttpContextBase httpContextBase, ICacheManager cacheManager, WebConfig webConfig, ITypeFinder typeFinder)
 {
     _workContext     = workContext;
     _httpContextBase = httpContextBase;
     _cacheManager    = cacheManager;
     _webConfig       = webConfig;
     _typeFinder      = typeFinder;
 }
Example #38
0
 public override void AdjustWebConfig(WebConfig wc)
 {
     wc._AssemblyDomain = "System";
     wc._AssemblyDomainVersion = DataFxAssemblyRef.FXAssemblyVersion;
     wc._AssemblyPublicKeyToken = DataFxAssemblyRef.EcmaPublicKeyToken;
     wc._AssemblyVersion = "4.0.0.0";
     wc._CompilerAssemblyVersion = "4.0.0.0";
     wc._CompilerVersion = "4.0";
 }
Example #39
0
        private void ReloadWebCore()
        {
            //if (WebCore.IsRunning)
            //    WebCore.Shutdown();

            if (_aweWebView != null && _aweWebView.Surface != null && !((BitmapSurface)_aweWebView.Surface).IsDisposed)
            {
                ((BitmapSurface)_aweWebView.Surface).Dispose();
            }

            if (_aweWebView != null && !_aweWebView.IsDisposed)
            {
                _aweWebView.Dispose();
                _aweWebView = null;
            }

            if (!WebCore.IsRunning)
            {
                // webcore moze da se iniciajlizuje samo jednom u okviru procesa. cak ni shutdown ne pomaze.

                // awesomium setup
                var cnfg = new WebConfig();
                cnfg.AdditionalOptions = new string[]
                                             {
                                                 "--enable-accelerated-filters"
                                                 , "--enable-accelerated-painting"
                                                 , "--enable-accelerated-plugins"
                                                 , "--enable-threaded-compositing"
                                                 , "--gpu-startup-dialog"
                                             };
                cnfg.UserAgent = Settings.BrowserUserAgent;
                //cnfg.AutoUpdatePeriod = 50;

                WebCore.Initialize(cnfg);

                WebPreferences webPreferences = WebPreferences.Default;
                webPreferences.ProxyConfig = "auto";
                _aweWebSession = WebCore.CreateWebSession(
                    String.Format("{0}{1}Cache", Path.GetDirectoryName(Application.ExecutablePath),
                                  Path.DirectorySeparatorChar),
                    webPreferences);
            }
        }
Example #40
0
 private static async Task GetFileHpJobAsync()
 {
     using (var client = new CSMFileServiceClient())
     {
         Task <ImportHpTaskResponse> t      = client.GetFileHPAsync(WebConfig.GetWebUsername(), WebConfig.GetWebPassword());
         ImportHpTaskResponse        result = await t;
     }
 }
Example #41
0
 private static async Task ReSubmitActivityToCBSHPSystem()
 {
     using (var client = new CSMSRServiceClient())
     {
         Task <ReSubmitActivityToCBSHPSystemTaskResponse> t      = client.ReSubmitActivityToCBSHPSystemAsync(WebConfig.GetWebUsername(), WebConfig.GetWebPassword());
         ReSubmitActivityToCBSHPSystemTaskResponse        result = await t;
     }
 }
Example #42
0
 public LivroController(WebConfig webconfig)
 {
     webConfig = webconfig;
     objLivro  = new LivroDataAccessLayer(webConfig);
 }
Example #43
0
 private static async Task ExportFileNCBJobAsync()
 {
     using (var client = new CSMFileServiceClient())
     {
         Task <ExportNCBTaskResponse> t      = client.ExportFileNCBAsync(WebConfig.GetWebUsername(), WebConfig.GetWebPassword());
         ExportNCBTaskResponse        result = await t;
     }
 }
Example #44
0
 public abstract void AdjustWebConfig(WebConfig wc);
Example #45
0
 private static async Task CreateSRActivityFromReplyEmail()
 {
     using (var client = new CSMSRServiceClient())
     {
         Task <CreateSrFromReplyEmailTaskResponse> t      = client.CreateSRActivityFromReplyEmailAsync(WebConfig.GetWebUsername(), WebConfig.GetWebPassword());
         CreateSrFromReplyEmailTaskResponse        result = await t;
     }
 }
 public SystemWebConfiguration(string path)
 {
     _webConfig = new WebConfig(path);
     _sessionState = new Lazy<SessionStateSection>(() => _webConfig.GetSection<SessionStateSection>("system.web/sessionState"));
 }
Example #47
0
 public ReportHelper()
 {
     user = WebConfig.GetSession();
     bll = new YDS6000.BLL.PDU.Report.ReportBLL(user.Ledger, user.Uid);
 }
Example #48
0
        public static void InitializeAwesomium()
        {
            WebConfig config = new WebConfig();
              config.HomeURL = new Uri("http://w1.dwar.ru");
              WebCore.Initialize(config);

              WebPreferences preferences = new WebPreferences();
              WebSession session = WebCore.CreateWebSession(preferences);
        }
Example #49
0
 private void AssemblePage()
 {
     string BoardRole = WebConfig.getValuebyKey("BoardAccessRole");
 }
 public void Should_Read_Existing_Value_From_Web_Config()
 {
     var webConfig = new WebConfig(Environment.CurrentDirectory);
     var sessionConfig = webConfig.GetSection<SessionStateSection>("system.web/sessionState");
     sessionConfig.SqlConnectionString.ShouldEqual("server=localhost;database=ASPNetSessionState;Integrated Security=SSPI");
 }
Example #51
0
    private void ProcessPostBack()
    {
        string id = Request.Params["id"];

        if (id.Length > 0)
        {
            int    JobRno    = 0;
            string FromEmail = string.Empty;

            string Sql = "Select JobRno, Email From mcJobs j Inner Join Contacts c on j.ContactRno = c.ContactRno Where Guid = @Guid";
            try
            {
                DataRow dr = db.DataRow(Sql, "@Guid", id);
                if (dr != null)
                {
                    JobRno    = DB.Int32(dr["JobRno"]);
                    FromEmail = DB.Str(dr["Email"]);
                }
            }
            catch (Exception Ex)
            {
                Err Err = new Err(Ex, Sql);
                Response.Write(Err.Html());
                goto AllDone;
            }

            SectionInfo[] Sections =
            {
                new SectionInfo()
                {
                    id = "Job", Desc = "Job"
                },
                new SectionInfo()
                {
                    id = "Menu", Desc = "Menu"
                },
                new SectionInfo()
                {
                    id = "Prices", Desc = "Prices"
                },
                new SectionInfo()
                {
                    id = "Fees", Desc = "Fees"
                },
                new SectionInfo()
                {
                    id = "Total", Desc = "Total"
                }
            };

            bool fConfirmed = true;
            foreach (SectionInfo section in Sections)
            {
                fConfirmed = fConfirmed && Request.Params["rdo" + section.id + "Confirm"] == "Yes";
            }

            DateTime Tm = DateTime.Now;
            Sql =
                "Update mcJobs Set " +
                "FinishConfirmDtTm = " + DB.Put(Tm) + ", " +
                (fConfirmed ? "ConfirmedDtTm = " + DB.Put(Tm) + ", " : string.Empty) +
                (fConfirmed ? "ConfirmedBy = 'Customer', " : string.Empty) +
                "UpdatedDtTm = " + DB.PutDtTm(Tm) + ", " +
                "UpdatedUser = '******' " +
                "Where Guid = @Guid";
            try
            {
                db.Exec(Sql, "@Guid", id);
            }
            catch (Exception Ex)
            {
                Err Err = new Err(Ex, Sql);
                Response.Write(Err.Html());
                goto AllDone;
            }

            string Subject = string.Format("Event #{0} {1}Confirmed", JobRno, (fConfirmed ? string.Empty : "NOT "));
            string Body    = string.Empty;

            Sql = string.Format(
                "Select JobRno, JobDate, Coalesce(cu.Name, c.Name) as Customer, Location, GuestArrivalTime, MealTime, EndTime, " +
                "NumMenServing, NumWomenServing, NumChildServing, ServicePropDesc, DeliveryPropDesc, " +
                "ChinaPropDesc, AddServicePropDesc, FuelTravelPropDesc, FacilityPropDesc, RentalsPropDesc, " +
                "Adj1PropDesc, Adj2PropDesc, cu.TaxExemptFlg, SubTotTaxPct, EstTotPropDesc, DepositPropDesc, " +
                "ConfirmedDtTm " +
                "From mcJobs j " +
                "Inner Join Contacts c on j.ContactRno = c.ContactRno " +
                "Left Join Customers cu on c.CustomerRno = cu.CustomerRno " +
                "Where JobRno = {0}", JobRno);
            try
            {
                DataRow dr = db.DataRow(Sql);
                if (dr != null)
                {
                    if (fConfirmed)
                    {
                        Body = string.Format("<h1>Event #{0} Confirmed</h1>", JobRno);
                    }
                    else
                    {
                        Body += string.Format("<h1>Event #{0} Not Confimed</h1>", JobRno);
                    }

                    // info
                    //------------------------------------------------------------
                    DateTime dtJob     = DB.DtTm(dr["JobDate"]);
                    string   Customer  = DB.Str(dr["Customer"]);
                    string   Location  = DB.Str(dr["Location"]);
                    DateTime GuestTime = DB.DtTm(dr["GuestArrivalTime"]);
                    DateTime BegTime   = DB.DtTm(dr["MealTime"]);
                    DateTime EndTime   = DB.DtTm(dr["EndTime"]);

                    if (GuestTime != DateTime.MinValue && GuestTime < BegTime)
                    {
                        BegTime = GuestTime;
                    }

                    string EventTime;
                    if (EndTime == DateTime.MinValue)
                    {
                        EventTime = BegTime.ToString("h:mm tt").ToLower();
                    }
                    else
                    {
                        EventTime = string.Format("{0} - {1}", BegTime.ToString("h:mm tt"), EndTime.ToString("h:mm tt")).ToLower();
                    }

                    int NumServings = DB.Int32(dr["NumMenServing"]) + DB.Int32(dr["NumWomenServing"]) + DB.Int32(dr["NumChildServing"]);

                    string SectionConfirmed = Request.Params["rdoJobConfirm"];
                    Body += string.Format(
                        "<table border=\"0\">" +
                        "<tr><td colspan=\"2\"><h2>Job Information</h2></td></tr>" +
                        "<tr>" +
                        "<td>" +
                        "Event: #{0}<br />" +
                        "Customer: {1}<br />" +
                        "Date: {2}" +
                        "</td>" +
                        "<td>" +
                        "Location: {3}<br />" +
                        "Event Time: {4}<br />" +
                        "Guest Count: {5}" +
                        "</td>" +
                        "</tr></table>" +
                        "<p>Confirm: <b>{6}</b></p>",
                        JobRno,
                        Customer,
                        Fmt.DtNth(dtJob),
                        Location,
                        EventTime,
                        NumServings,
                        SectionConfirmed);
                    if (SectionConfirmed != "Yes")
                    {
                        Body += "<p><b>Notes:</b><br />" + Request.Params["txtJob"].Replace("\r\n\r\n", "</p><p>").Replace("\n\n", "</p><p>") + "</p>";
                    }

                    // menu
                    //------------------------------------------------------------
                    Sql = string.Format(
                        "Select * " +
                        "From mcJobFood " +
                        "Where JobRno = {0} And ProposalHideFlg = 0 " +
                        "Order By ProposalSeq, FoodSeq",
                        JobRno);
                    DataTable dt = db.DataTable(Sql);
                    if (dt.Rows.Count > 0)
                    {
                        Body +=
                            "<table border=\"0\">" +
                            "<tr><td colspan=\"2\"><h2>Food</h2></td></tr>";

                        foreach (DataRow drMenu in dt.Rows)
                        {
                            string ProposalMenuItem = DB.Str(drMenu["ProposalMenuItem"]);
                            bool   fProposalTitle   = DB.Bool(drMenu["ProposalTitleFlg"]);

                            if (fProposalTitle)
                            {
                                Body += string.Format("<tr><td colspan=\"2\"><b>{0}</b></td></tr>", ProposalMenuItem);
                            }
                            else
                            {
                                Body += string.Format("<tr><td width=\"20\">&nbsp;</td><td>{0}</td></tr>", (ProposalMenuItem.Length > 0 ? ProposalMenuItem : "&nbspc;"));
                            }
                        }

                        SectionConfirmed = Request.Params["rdoMenuConfirm"];
                        Body            += string.Format(
                            "</table>" +
                            "<p>Confirm: <b>{0}</b></p>",
                            SectionConfirmed);
                        if (SectionConfirmed != "Yes")
                        {
                            Body += "<p><b>Notes:</b><br />" + Request.Params["txtMenu"].Replace("\r\n\r\n", "</p><p>").Replace("\n\n", "</p><p>") + "</p>";
                        }
                    }

                    // prices
                    //------------------------------------------------------------
                    Sql = string.Format("Select * From JobInvoicePrices Where JobRno = {0} Order By Seq", JobRno);
                    dt  = db.DataTable(Sql);
                    if (dt.Rows.Count > 0)
                    {
                        Body +=
                            "<table border=\"0\">" +
                            "<tr><td><h2>Pricing</h2></td></tr>";
                        foreach (DataRow drPrice in dt.Rows)
                        {
                            string PriceType = DB.Str(drPrice["PriceType"]);
                            string Desc      = string.Empty;

                            switch (PriceType)
                            {
                            case Misc.cnPerPerson:
                                Desc = DB.Str(drPrice["PropPerPersonDesc"]);
                                break;

                            case Misc.cnPerItem:
                                Desc = DB.Str(drPrice["PropPerItemDesc"]);
                                break;

                            case Misc.cnAllIncl:
                                Desc = DB.Str(drPrice["PropAllInclDesc"]);
                                break;
                            }

                            if (Desc.Length > 0)
                            {
                                Body += string.Format("<tr><td>{0}</td></tr>", Desc);
                            }
                        }

                        SectionConfirmed = Request.Params["rdoPricesConfirm"];
                        Body            += string.Format(
                            "</table>" +
                            "<p>Confirm: <b>{0}</b></p>",
                            SectionConfirmed);
                        if (SectionConfirmed != "Yes")
                        {
                            Body += "<p><b>Notes:</b><br />" + Request.Params["txtPrices"].Replace("\r\n\r\n", "</p><p>").Replace("\n\n", "</p><p>") + "</p>";
                        }
                    }

                    // fees
                    //------------------------------------------------------------

                    Body +=
                        "<table border=\"0\">" +
                        "<tr><td><h2>Additional Servics</h2></td></tr>";

                    // services
                    string Fee = DB.Str(dr["ServicePropDesc"]);
                    if (Fee.Length > 0)
                    {
                        Body += string.Format("<p class=\"card-text\">{0}</p>", Fee);
                    }

                    // delivery
                    Fee = DB.Str(dr["DeliveryPropDesc"]);
                    if (Fee.Length > 0)
                    {
                        Body += string.Format("<p class=\"card-text\">{0}</p>", Fee);
                    }

                    // china
                    Fee = DB.Str(dr["ChinaPropDesc"]);
                    if (Fee.Length > 0)
                    {
                        Body += string.Format("<p class=\"card-text\">{0}</p>", Fee);
                    }

                    // additional services
                    Fee = DB.Str(dr["AddServicePropDesc"]);
                    if (Fee.Length > 0)
                    {
                        Body += string.Format("<p class=\"card-text\">{0}</p>", Fee);
                    }

                    // fuel & travel
                    Fee = DB.Str(dr["FuelTravelPropDesc"]);
                    if (Fee.Length > 0)
                    {
                        Body += string.Format("<p class=\"card-text\">{0}</p>", Fee);
                    }

                    // facility
                    Fee = DB.Str(dr["FacilityPropDesc"]);
                    if (Fee.Length > 0)
                    {
                        Body += string.Format("<p class=\"card-text\">{0}</p>", Fee);
                    }

                    // rentals
                    Fee = DB.Str(dr["RentalsPropDesc"]);
                    if (Fee.Length > 0)
                    {
                        Body += string.Format("<p class=\"card-text\">{0}</p>", Fee);
                    }

                    // adjustment 1
                    Fee = DB.Str(dr["Adj1PropDesc"]);
                    if (Fee.Length > 0)
                    {
                        Body += string.Format("<p class=\"card-text\">{0}</p>", Fee);
                    }

                    // adjustment 2
                    Fee = DB.Str(dr["Adj2PropDesc"]);
                    if (Fee.Length > 0)
                    {
                        Body += string.Format("<p class=\"card-text\">{0}</p>", Fee);
                    }

                    SectionConfirmed = Request.Params["rdoFeesConfirm"];
                    Body            += string.Format(
                        "</table>" +
                        "<p>Confirm: <b>{0}</b></p>",
                        SectionConfirmed);
                    if (SectionConfirmed != "Yes")
                    {
                        Body += "<p><b>Notes:</b><br />" + Request.Params["txtFees"].Replace("\r\n\r\n", "</p><p>").Replace("\n\n", "</p><p>") + "</p>";
                    }


                    Body +=
                        "<table border=\"0\">" +
                        "<tr><td><h2>Total</h2></td></tr>";

                    // sales tax
                    //------------------------------------------------------------
                    bool fTaxExempt = DB.Bool(dr["TaxExemptFlg"]);
                    if (!fTaxExempt)
                    {
                        string Tax = string.Format("Utah Food Sales Tax {0:0.00}%", DB.Dec(dr["SubTotTaxPct"]));
                        Body += string.Format("<tr><td>{0}</td></tr>", Tax);
                    }

                    // total
                    //------------------------------------------------------------
                    string TotalDesc = string.Format("\n{0}", DB.Str(dr["EstTotPropDesc"]));
                    Body += string.Format("<tr><td>{0}</td></tr>", TotalDesc);

                    // deposit
                    //------------------------------------------------------------
                    string DepositDesc = DB.Str(dr["DepositPropDesc"]);
                    if (DepositDesc.Length > 0)
                    {
                        Body += string.Format("<tr><td>{0}</td></tr>", DepositDesc);
                    }

                    SectionConfirmed = Request.Params["rdoTotalConfirm"];
                    Body            += string.Format(
                        "</table>" +
                        "<p>Confirm: <b>{0}</b></p>",
                        SectionConfirmed);
                    if (SectionConfirmed != "Yes")
                    {
                        Body += "<p><b>Notes:</b><br />" + Request.Params["txtTotal"].Replace("\r\n\r\n", "</p><p>").Replace("\n\n", "</p><p>") + "</p>";
                    }

                    // tables & linens
                    //------------------------------------------------------------
                    string LinensProvidedBy = Request.Params["ddlLinensProvidedBy"];
                    Body +=
                        "<table border=\"0\">" +
                        "<tr><td colspan=\"2\"><h2>Tables &amp; Linens</h2></td></tr>" +
                        "<tr><td colspan=\"2\">Buffet tables provided by <b>" + Request.Params["ddlTables"] + "</b></td></tr>" +
                        "<tr><td colspan=\"2\">Buffet linen color <b>" + Request.Params["ddlLinenColor"] + "</b></td></tr>" +
                        "<tr><td colspan=\"2\">Linen color for guest tables <b>" + Request.Params["txtGuestTableColor"] + "</b></td></tr>" +
                        "<tr><td colspan=\"2\">Guest linens provided by <b>" + LinensProvidedBy + "</b></td></tr>" +
                        (LinensProvidedBy == Globals.g.Company.Name ?
                         "<tr><td colspan=\"2\">&nbsp;</td></tr>" +
                         "<tr><td align=\"center\"><u>Table Size &amp; Shape</u></td><td align=\"center\"><u>Count</u></td></tr>" +
                         "<tr><td align=\"center\">" + Request.Params["txtTableSizeShape1"] + "</td><td align=\"center\">" + Request.Params["txtTableCount1"] + "</td></tr>" +
                         "<tr><td align=\"center\">" + Request.Params["txtTableSizeShape2"] + "</td><td align=\"center\">" + Request.Params["txtTableCount2"] + "</td></tr>" +
                         "<tr><td align=\"center\">" + Request.Params["txtTableSizeShape3"] + "</td><td align=\"center\">" + Request.Params["txtTableCount3"] + "</td></tr>" +
                         "<tr><td align=\"center\">" + Request.Params["txtTableSizeShape4"] + "</td><td align=\"center\">" + Request.Params["txtTableCount4"] + "</td></tr>"
                        :
                         string.Empty) +
                        "</table>" +
                        "<p><b>Notes:</b><br />" + Request.Params["txtTables"].Replace("\r\n\r\n", "</p><p>").Replace("\n\n", "</p><p>") + "</p>";
                }

                int nTrys = 0;

TryAgain:

                nTrys++;

                try
                {
                    WebConfig   wc  = new WebConfig();
                    MailMessage Msg = new MailMessage(FromEmail, Misc.PrimaryEmailAddress());
                    Msg.CC.Add(wc.Str("Email CC"));
                    Msg.Subject    = Misc.EnvSubject() + Subject;
                    Msg.IsBodyHtml = true;
                    Msg.Body       = Body;

                    SmtpClient Smtp = new SmtpClient();
                    Smtp.Send(Msg);
                }
                catch (Exception Ex)
                {
                    if (nTrys <= 3)
                    {
                        Thread.Sleep(1500);     // 1 1/2 seconds
                        goto TryAgain;
                    }
                    Err Err = new Err(Ex, Sql);
                    Response.Write(Err.Html());
                    goto AllDone;
                }
            }
            catch (Exception Ex)
            {
                Err Err = new Err(Ex, Sql);
                Response.Write(Err.Html());
            }
        }

AllDone:

        return;
    }
 public void Should_Read_Missing_Value_From_Web_Config()
 {
     var webConfig = new WebConfig(Environment.CurrentDirectory);
     var sessionConfig = webConfig.GetSection<SessionStateSection>("system.web/sessionState");
     sessionConfig.StateNetworkTimeout.ShouldEqual(new TimeSpan(0, 0, 10));
 }