protected void Page_PreInit(object sender, EventArgs e)
        {
            GeneralConfigurationVo generalconfigurationvo = new GeneralConfigurationVo();
            GeneralConfigurationBo generalvonfigurationbo = new GeneralConfigurationBo();

            if (!IsPostBack)
            {
                generalconfigurationvo = generalvonfigurationbo.GetHostGeneralConfiguration(0);
                Session[SessionContents.SAC_HostGeneralDetails] = generalconfigurationvo;
                if (Session[SessionContents.SAC_HostGeneralDetails] != null)
                {
                    generalconfigurationvo = (GeneralConfigurationVo)Session[SessionContents.SAC_HostGeneralDetails];

                    if (!string.IsNullOrEmpty(generalconfigurationvo.DefaultTheme))
                    {
                        if (Session["Theme"] == null || Session["Theme"].ToString() == string.Empty)
                        {
                            Session["Theme"] = generalconfigurationvo.DefaultTheme;
                        }
                        Page.Theme = Session["Theme"].ToString();
                    }
                    if (!string.IsNullOrEmpty(generalconfigurationvo.ApplicationName))
                    {
                        Page.Title = generalconfigurationvo.ApplicationName;
                    }
                }
            }
            //if (Session["Theme"] == null || Session["Theme"].ToString() == string.Empty)
            //{
            //    Session["Theme"] = "Maroon";
            //}

            //Page.Theme = Session["Theme"].ToString();
        }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //uplLogoUpload.TargetFolder = Server.MapPath(@"~/Images/");
     ////uplLogoUpload.TemporaryFolder = Server.MapPath(@"/Images/");
     //uplLogoUpload.TargetPhysicalFolder = Server.MapPath(@"~/Images/");
     if (!IsPostBack)
     {
         GeneralConfigurationBo generalconfigurationbo = new GeneralConfigurationBo();
         GeneralConfigurationVo generalconfigurationvo = new GeneralConfigurationVo();
         UserVo uservo  = (UserVo)Session["UserVo"];
         string xmlPath = "";
         xmlPath = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"]).ToString();
         generalconfigurationvo = generalconfigurationbo.GetHostGeneralConfiguration(xmlPath, 1000);
         if (!String.IsNullOrEmpty(generalconfigurationvo.DefaultTheme))
         {
             ddlApplyTheme.SelectedValue = generalconfigurationvo.DefaultTheme;
         }
         if (!String.IsNullOrEmpty(generalconfigurationvo.AdviserLogoPlacement))
         {
             ddlPickAdvisorLogoPosition.SelectedValue = generalconfigurationvo.AdviserLogoPlacement;
         }
         if (!String.IsNullOrEmpty(generalconfigurationvo.HostLogoPlacement))
         {
             ddlPickHostLogoPosition.SelectedValue = generalconfigurationvo.HostLogoPlacement;
         }
         if (!String.IsNullOrEmpty(generalconfigurationvo.ApplicationName))
         {
             txtApplicationName.Text = generalconfigurationvo.ApplicationName;
         }
         if (!String.IsNullOrEmpty(generalconfigurationvo.ContactPersonName))
         {
             txtContactPerson.Text = generalconfigurationvo.ContactPersonName;
         }
         if (generalconfigurationvo.ContactPersonTelephoneNumber != 0)
         {
             txtTelephoneNo.Text = generalconfigurationvo.ContactPersonTelephoneNumber.ToString();
         }
         if (!String.IsNullOrEmpty(generalconfigurationvo.Email))
         {
             txtEmailId.Text = generalconfigurationvo.Email;
         }
         if (!String.IsNullOrEmpty(generalconfigurationvo.LoginPageContent))
         {
             txtLoginPageContent.Text = generalconfigurationvo.LoginPageContent;
         }
         //Binary image needed to be here
         if (!String.IsNullOrEmpty(generalconfigurationvo.HostLogo))
         {
             lblFileUploaded.Visible = true;
             lblFileUploaded.Text    = generalconfigurationvo.HostLogo;
             //hdnUplFileName.Value = generalconfigurationvo.HostLogo;
         }
     }
 }
Exemplo n.º 3
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         GeneralConfigurationVo generalconfigurationvo = new GeneralConfigurationVo();
         GeneralConfigurationBo generalconfigurationbo = new GeneralConfigurationBo();
         bool   recordstatus = true;
         UserVo uservo       = (UserVo)Session["UserVo"];
         generalconfigurationvo.AdviserLogoPlacement = ddlPickAdvisorLogoPosition.SelectedValue;
         generalconfigurationvo.ApplicationName      = txtApplicationName.Text;
         generalconfigurationvo.ContactPersonName    = txtContactPerson.Text;
         if (txtTelephoneNo.Text != string.Empty)
         {
             generalconfigurationvo.ContactPersonTelephoneNumber = Int64.Parse(txtTelephoneNo.Text);
         }
         generalconfigurationvo.DefaultTheme      = ddlApplyTheme.SelectedValue;
         generalconfigurationvo.Email             = txtEmailId.Text;
         generalconfigurationvo.HostLogoPlacement = ddlPickHostLogoPosition.SelectedValue;
         generalconfigurationvo.LoginPageContent  = txtLoginPageContent.Text;
         //if (Session["UploadFileName"] != null && Session["UploadFileName"] != string.Empty)
         //{
         //    generalconfigurationvo.HostLogo = Session["UploadFileName"].ToString();
         //}
         if (RadUpload1.UploadedFiles != null && RadUpload1.UploadedFiles.Count > 0)
         {
             if (!string.IsNullOrEmpty(RadUpload1.UploadedFiles[0].FileName.ToString()))
             {
                 generalconfigurationvo.HostLogo = RadUpload1.UploadedFiles[0].FileName.ToString();;
             }
         }
         else
         {
             generalconfigurationvo.HostLogo = lblFileUploaded.Text;
         }
         recordstatus = generalconfigurationbo.AddHostGeneralConfiguration(uservo.UserId, generalconfigurationvo);
         if (recordstatus)
         {
             msgRecordStatus.Visible = true;
             if (RadUpload1.UploadedFiles != null && RadUpload1.UploadedFiles.Count > 0)
             {
                 lblFileUploaded.Text = RadUpload1.UploadedFiles[0].FileName.ToString();
             }
         }
         else
         {
             ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", @"alert('Something Went Wrong \n Record Status: Unsuccessful');", true);
         }
     }
 }
Exemplo n.º 4
0
        protected void Page_PreInit(object sender, EventArgs e)
        {
            GeneralConfigurationVo generalconfigurationvo = new GeneralConfigurationVo();
            GeneralConfigurationBo generalvonfigurationbo = new GeneralConfigurationBo();
            HttpCookie             UserPreference;
            string userTheme = string.Empty;
            string url       = HttpContext.Current.Request.Url.AbsoluteUri;


            if (url == "http://122.166.49.40:86/" || url == "http://192.168.0.1:86/" || ConfigurationManager.AppSettings["Website_ADVISER"].ToString() != "1021")
            {
                PCGLabel.Text = "2015 @ Ampsys Consulting Pvt. Ltd.";
            }
            if (Request.Cookies["UserPreference"] != null)
            {
                // get the cookie
                HttpCookie cookie = Request.Cookies["UserPreference"];
                // get the cookie value
                userTheme           = Request.Cookies["UserPreference"].Values["UserTheme"];
                Page.Theme          = userTheme;
                lnkBrowserIcon.Href = Request.Cookies["UserPreference"].Values["UserICOFilePath"];
            }

            if (Session["advisorVo"] != null)
            {
                advisorVo = (AdvisorVo)Session["advisorVo"];
            }
            xmlPath = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"]).ToString();
            if (advisorVo.HostId != 0)
            {
                generalconfigurationvo = generalvonfigurationbo.GetHostGeneralConfiguration(xmlPath, advisorVo.HostId);
            }
            else
            {
                generalconfigurationvo = generalvonfigurationbo.GetHostGeneralConfiguration(xmlPath, 1000);
            }

            Session[SessionContents.SAC_HostGeneralDetails] = generalconfigurationvo;
            if (Session[SessionContents.SAC_HostGeneralDetails] != null)
            {
                generalconfigurationvo = (GeneralConfigurationVo)Session[SessionContents.SAC_HostGeneralDetails];

                if (!string.IsNullOrEmpty(generalconfigurationvo.DefaultTheme))
                {
                    if (Session["Theme"] == null || Session["Theme"].ToString() == string.Empty)
                    {
                        if (string.IsNullOrEmpty(userTheme))
                        {
                            userTheme = generalconfigurationvo.DefaultTheme;
                        }
                    }
                    else if (Session["Theme"] != null)
                    {
                        userTheme = Session["Theme"].ToString();
                    }
                }
                if (!string.IsNullOrEmpty(generalconfigurationvo.ApplicationName))
                {
                    Page.Title = generalconfigurationvo.ApplicationName;
                }
            }
            //SET THE THEME FROM USER COOKIES OR DEFAULT
            Page.Theme       = userTheme;
            Session["Theme"] = userTheme;


            //if (Session["Theme"] == null || Session["Theme"].ToString() == string.Empty)
            //{
            //    Session["Theme"] = "Maroon";
            //}

            //Page.Theme = Session["Theme"].ToString();
            if (Session["AdvisorPreferenceVo"] != null)
            {
                advisorPreferenceVo        = (AdvisorPreferenceVo)Session["AdvisorPreferenceVo"];
                Page.Title                 = advisorPreferenceVo.BrowserTitleBarName;
                lnkBrowserIcon.Href        = "~//Images//favicon//" + advisorPreferenceVo.BrowserTitleBarIconImageName;
                hidUserLogOutPageUrl.Value = advisorPreferenceVo.LoginWidgetLogOutPageURL;

                UserPreference = new HttpCookie("UserPreference");
                UserPreference.Values["UserLoginPageURL"] = advisorPreferenceVo.WebSiteDomainName;
                if (!string.IsNullOrEmpty(Page.Theme))
                {
                    UserPreference.Values["UserTheme"] = Page.Theme.ToString();
                }
                UserPreference.Values["UserICOFilePath"] = lnkBrowserIcon.Href.ToString();
                UserPreference.Expires = DateTime.Now.AddDays(1);
                Response.Cookies.Add(UserPreference);
            }
        }