Exemplo n.º 1
0
        private void SaveFonts()
        {
            try
            {
                clsCustomer dalCustomer = new clsCustomer(Session["DBName"].ToString());
                int         custId = int.Parse(Session["CustomerID"].ToString());
                string      headerFontName = "", headerFontSize = "", footerFontName = "", footerFontSize = "", sidebarFontName = "", sidebarFontSize = "";
                if (ddlHeaderFontNames.SelectedIndex > 0)
                {
                    headerFontName = ddlHeaderFontNames.SelectedItem.Text;
                }
                if (ddlFooterFontNames.SelectedIndex > 0)
                {
                    footerFontName = ddlFooterFontNames.SelectedItem.Text;
                }
                if (ddlSideBarFontNames.SelectedIndex > 0)
                {
                    sidebarFontName = ddlSideBarFontNames.SelectedItem.Text;
                }

                if (rblHeaderFontSizeByName.Checked == true)
                {
                    if (ddlHeaderFontSizes.SelectedIndex > 0)
                    {
                        headerFontSize = ddlHeaderFontSizes.SelectedValue;
                    }
                }
                else
                {
                    if (txtHeaderFontSize.Text.Trim() != "")
                    {
                        headerFontSize = txtHeaderFontSize.Text;
                    }
                }

                if (rblFooterFontSizeByName.Checked == true)
                {
                    if (ddlFooterFontSizes.SelectedIndex > 0)
                    {
                        footerFontSize = ddlFooterFontSizes.SelectedValue;
                    }
                }
                else
                {
                    if (txtFooterFontSize.Text.Trim() != "")
                    {
                        footerFontSize = txtFooterFontSize.Text;
                    }
                }

                if (rblSideBarFontSizeByName.Checked == true)
                {
                    if (ddlSideBarFontSizes.SelectedIndex > 0)
                    {
                        sidebarFontSize = ddlSideBarFontSizes.SelectedValue;
                    }
                }
                else
                {
                    if (txtSideBarFontSize.Text.Trim() != "")
                    {
                        sidebarFontSize = txtSideBarFontSize.Text;
                    }
                }


                dalCustomer.InsertCustomerUISettings(custId, txtHeaderBGColor.Text.Trim(), headerFontName, headerFontSize, txtHeaderFontColor.Text.Trim(),
                                                     txtFooterBGColor.Text.Trim(), footerFontName, footerFontSize, txtFooterFontColor.Text.Trim(),
                                                     txtSideBarBGColor.Text.Trim(), sidebarFontName, sidebarFontSize, txtSideBarFontColor.Text.Trim());
                lblErr.Text = "UI Settings Are Updated";
            }
            catch (Exception ex)
            {
                lblErr.Text = ex.Message;
            }
        }