Esempio n. 1
0
        private void BindPage()
        {
            try
            {
                UISettingsDAL dalCustomer = new UISettingsDAL();

                DataSet pageUISettings = dalCustomer.GetCustomerUIsettings();

                if (pageUISettings != null)
                {
                    if (pageUISettings.Tables[0].Rows.Count > 0)
                    {
                        trHeader.BgColor       = pageUISettings.Tables[0].Rows[0]["HeaderBGColor"].ToString();
                        lblHeader.Font.Name    = pageUISettings.Tables[0].Rows[0]["HeaderFontName"].ToString();
                        lblHeader.Font.Size    = FontUnit.Parse(pageUISettings.Tables[0].Rows[0]["HeaderFontSize"].ToString());
                        lblHeader.ForeColor    = Color.FromArgb(int.Parse(pageUISettings.Tables[0].Rows[0]["HeaderForeColor"].ToString(), System.Globalization.NumberStyles.HexNumber));
                        trFooter.BgColor       = pageUISettings.Tables[0].Rows[0]["FooterBGColor"].ToString();
                        lblFooter.Font.Name    = pageUISettings.Tables[0].Rows[0]["FooterFontName"].ToString();
                        lblFooter.Font.Size    = FontUnit.Parse(pageUISettings.Tables[0].Rows[0]["FooterFontSize"].ToString());
                        lblFooter.ForeColor    = Color.FromArgb(int.Parse(pageUISettings.Tables[0].Rows[0]["FooterForeColor"].ToString(), System.Globalization.NumberStyles.HexNumber));
                        tdSideBarLeft.BgColor  = pageUISettings.Tables[0].Rows[0]["SideBarBGColor"].ToString();
                        tdSideBarRight.BgColor = pageUISettings.Tables[0].Rows[0]["SideBarBGColor"].ToString();
                        //lblSideBar.Font.Name = pageUISettings.Tables[0].Rows[0]["SideBarFontName"].ToString();
                        //lblSideBar.Font.Size = FontUnit.Parse(pageUISettings.Tables[0].Rows[0]["SideBarFontSize"].ToString());
                        //lblSideBar.ForeColor = Color.FromArgb(int.Parse(pageUISettings.Tables[0].Rows[0]["SideBarForeColor"].ToString(), System.Globalization.NumberStyles.HexNumber));

                        if (Convert.ToBoolean(pageUISettings.Tables[0].Rows[0]["HasHeaderLogo"]) == true)
                        {
                            imgHeader.ImageUrl = "~/ShowImage.ashx?Type=Header";
                        }
                        else
                        {
                            imgHeader.Visible = false;
                        }

                        if (Convert.ToBoolean(pageUISettings.Tables[0].Rows[0]["HasFooterLogo"]) == true)
                        {
                            imgFooter.ImageUrl = "~/ShowImage.ashx?Type=Footer";
                        }
                        else
                        {
                            imgFooter.Visible = false;
                        }
                    }

                    if (pageUISettings.Tables[1].Rows.Count > 0)
                    {
                        lblHeader.Text = pageUISettings.Tables[1].Rows[0]["HeaderMsg"].ToString();
                        lblFooter.Text = pageUISettings.Tables[1].Rows[0]["FooterMsg"].ToString();
                        //lblSideBar.Text = pageUISettings.Tables[1].Rows[0]["SideBarMsg"].ToString();
                        lblWelcome.Text = pageUISettings.Tables[1].Rows[0]["WelcomeMsg"].ToString().Replace("\n", "<br />");

                        if (pageUISettings.Tables[1].Rows[0]["HeaderMsg"].ToString() == string.Empty)
                        {
                            Page.Header.Title = pageUISettings.Tables[1].Rows[0]["HeaderMsg"].ToString();
                        }
                    }

                    SaveCustomerUISettings(pageUISettings);
                }
            }
            catch (Exception ex)
            {
                string strErrCode = ERROR_DISPLAY_MESSAGE + "," + (new Error_Log()).LogErrorIntoDB(ex, "BindPage");
                lblErrMessage.Text = strErrCode;
            }
        }
Esempio n. 2
0
        private void BindPage()
        {
            UISettingsDAL dalCustomer = new UISettingsDAL();
            DataSet       pageMsgs    = dalCustomer.GetCustomerMessages();

            if (pageMsgs != null && pageMsgs.Tables[0].Rows.Count > 0)
            {
                lblHeader.Text = pageMsgs.Tables[0].Rows[0]["HeaderMsg"].ToString();
                lblFooter.Text = pageMsgs.Tables[0].Rows[0]["FooterMsg"].ToString();
                //lblSideBar.Text = pageMsgs.Tables[0].Rows[0]["SideBarMsg"].ToString();
                //lblWelcome.Text = pageMsgs.Tables[0].Rows[0]["WelcomeMsg"].ToString().Replace("\n", "<br />");
            }

            DataSet pageUISettings = dalCustomer.GetCustomerUIsettings();

            if (pageUISettings != null && pageUISettings.Tables[0].Rows.Count > 0)
            {
                trHeader.BgColor    = pageUISettings.Tables[0].Rows[0]["HeaderBGColor"].ToString();
                lblHeader.Font.Name = pageUISettings.Tables[0].Rows[0]["HeaderFontName"].ToString();
                lblHeader.Font.Size = FontUnit.Parse(pageUISettings.Tables[0].Rows[0]["HeaderFontSize"].ToString());
                lblHeader.ForeColor = Color.FromArgb(int.Parse(pageUISettings.Tables[0].Rows[0]["HeaderForeColor"].ToString(), System.Globalization.NumberStyles.HexNumber));
                trFooter.BgColor    = pageUISettings.Tables[0].Rows[0]["FooterBGColor"].ToString();
                lblFooter.Font.Name = pageUISettings.Tables[0].Rows[0]["FooterFontName"].ToString();
                lblFooter.Font.Size = FontUnit.Parse(pageUISettings.Tables[0].Rows[0]["FooterFontSize"].ToString());
                lblFooter.ForeColor = Color.FromArgb(int.Parse(pageUISettings.Tables[0].Rows[0]["FooterForeColor"].ToString(), System.Globalization.NumberStyles.HexNumber));

                //divHeader.Style["background-color"] = "#" + pageUISettings.Tables[0].Rows[0]["HeaderBGColor"].ToString();
                //divHeader.Style["font-family"] = pageUISettings.Tables[0].Rows[0]["HeaderFontName"].ToString();
                //divHeader.Style["font-size"] = pageUISettings.Tables[0].Rows[0]["HeaderFontSize"].ToString();
                //divHeader.Style["color"] = "#" + pageUISettings.Tables[0].Rows[0]["HeaderForeColor"].ToString();
                //divFooter.Style["background-color"] = "#" + pageUISettings.Tables[0].Rows[0]["FooterBGColor"].ToString();
                //divFooter.Style["font-family"] = pageUISettings.Tables[0].Rows[0]["FooterFontName"].ToString();
                //divFooter.Style["font-size"] = pageUISettings.Tables[0].Rows[0]["FooterFontSize"].ToString();
                //divFooter.Style["color"] = "#" + pageUISettings.Tables[0].Rows[0]["FooterForeColor"].ToString();
                //divHeader.Style["background-color"] = "pageUISettings.Tables[0].Rows[0]["SideBarBGColor"].ToString();
                //divHeader.Style["font-family"] = pageUISettings.Tables[0].Rows[0]["SideBarFontName"].ToString();
                //divHeader.Style["font-size"] = pageUISettings.Tables[0].Rows[0]["SideBarFontSize"].ToString();
                //divHeader.Style["color"] = "#" + pageUISettings.Tables[0].Rows[0]["SideBarForeColor"].ToString();

                if (Convert.ToBoolean(pageUISettings.Tables[0].Rows[0]["HasHeaderLogo"]) == true)
                {
                    imgHeader.ImageUrl = "~/ShowImage.ashx?Type=Header";
                }
                else
                {
                    imgHeader.Visible = false;
                }

                if (Convert.ToBoolean(pageUISettings.Tables[0].Rows[0]["HasFooterLogo"]) == true)
                {
                    imgFooter.ImageUrl = "~/ShowImage.ashx?Type=Footer";
                }
                else
                {
                    imgFooter.Visible = false;
                }

                //if (Convert.ToBoolean(pageUISettings.Tables[0].Rows[0]["HasSideBarLogo"]) == true)
                //    imgSideBar.ImageUrl = "~/ShowImage.ashx?Type=SideBar";
                //else
                //    imgSideBar.Visible = false;
            }
        }