Ejemplo n.º 1
0
    private void GetDataFromServer()
    {
        try
        {
            string LastEdndent      = "....";
            int    MaxNumberofPosts = 30;
            int    MaxDescriptions  = 500;
            string strBlogURL       = string.Empty;

            RSSReaderSettingValueController  con         = new RSSReaderSettingValueController();
            List <RSSReaderSettingValueInfo> objSettings = con.GetAllRssSettings(GetPortalID, Int32.Parse(SageUserModuleID), GetCurrentCultureName);
            if (objSettings != null)
            {
                int i = 0;
                foreach (RSSReaderSettingValueInfo rsSeting in objSettings)
                {
                    switch (rsSeting.SettingKey)
                    {
                    case "DisplayTitle":
                        litTitle.Text = rsSeting.SettingValue;
                        break;

                    case "LastEdndent":
                        LastEdndent = rsSeting.SettingValue;
                        break;

                    case "MaxNumberofPosts":
                        if (rsSeting.SettingValue != string.Empty)
                        {
                            MaxNumberofPosts = Int32.Parse(rsSeting.SettingValue);
                        }
                        break;

                    case "MaxDescriptionsLength":
                        if (rsSeting.SettingValue != string.Empty)
                        {
                            MaxDescriptions = Int32.Parse(rsSeting.SettingValue);
                        }
                        break;

                    case "RssURL":
                        strBlogURL = rsSeting.SettingValue;
                        break;
                    }
                    i++;
                    if (i > 5)
                    {
                        break;
                    }
                }
            }

            string strRssContent = ProcessRSSItem(strBlogURL, MaxNumberofPosts, MaxDescriptions, LastEdndent);
            litBlogContnent.Text = strRssContent;
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
Ejemplo n.º 2
0
    private void GetDataFromServer()
    {
        try
        {
            string LastEdndent = "....";
            int MaxNumberofPosts = 30;
            int MaxDescriptions = 500;
            string strBlogURL = string.Empty;

            RSSReaderSettingValueController con = new RSSReaderSettingValueController();
            List<RSSReaderSettingValueInfo> objSettings = con.GetAllRssSettings(GetPortalID, Int32.Parse(SageUserModuleID), GetCurrentCultureName);
            if (objSettings != null)
            {
                int i = 0;
                foreach (RSSReaderSettingValueInfo rsSeting in objSettings)
                {
                    switch (rsSeting.SettingKey)
                    {
                        case "DisplayTitle":
                            litTitle.Text = rsSeting.SettingValue;
                            break;
                        case "LastEdndent":
                            LastEdndent = rsSeting.SettingValue;
                            break;
                        case "MaxNumberofPosts":
                            if (rsSeting.SettingValue != string.Empty)
                            {
                                MaxNumberofPosts = Int32.Parse(rsSeting.SettingValue);
                            }
                            break;
                        case "MaxDescriptionsLength":
                            if (rsSeting.SettingValue != string.Empty)
                            {
                                MaxDescriptions = Int32.Parse(rsSeting.SettingValue);
                            }
                            break;
                        case "RssURL":
                            strBlogURL = rsSeting.SettingValue;
                            break;
                    }
                    i++;
                    if (i > 5)
                    {
                        break;
                    }
                }
            }

            string strRssContent = ProcessRSSItem(strBlogURL, MaxNumberofPosts, MaxDescriptions, LastEdndent);
            litBlogContnent.Text = strRssContent;
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
Ejemplo n.º 3
0
    private void LoadAllSettings()
    {
        try
        {
            RSSReaderSettingValueController  con         = new RSSReaderSettingValueController();
            List <RSSReaderSettingValueInfo> objSettings = con.GetAllRssSettings(GetPortalID, Int32.Parse(SageUserModuleID), GetCurrentCultureName);
            if (objSettings != null)
            {
                foreach (RSSReaderSettingValueInfo rsSeting in objSettings)
                {
                    switch (rsSeting.SettingKey)
                    {
                    case "DisplayTitle":
                        txtDisplayTitle.Text    = rsSeting.SettingValue;
                        hdnDisplayTitleID.Value = rsSeting.RSSReaderSettingValueID.ToString();
                        break;

                    case "LastEdndent":
                        txtLastEdndent.Text    = rsSeting.SettingValue;
                        hdnLastEdndentID.Value = rsSeting.RSSReaderSettingValueID.ToString();
                        break;

                    case "MaxNumberofPosts":
                        txtMaxNumberofPosts.Text    = rsSeting.SettingValue;
                        hdnMaxNumberofPostsID.Value = rsSeting.RSSReaderSettingValueID.ToString();
                        break;

                    case "MaxDescriptionsLength":
                        txtMaxDescriptionsLength.Text    = rsSeting.SettingValue;
                        hdnMaxDescriptionsLengthID.Value = rsSeting.RSSReaderSettingValueID.ToString();
                        break;

                    case "RssURL":
                        txtRssURL.Text    = rsSeting.SettingValue;
                        hdnRssURLID.Value = rsSeting.RSSReaderSettingValueID.ToString();
                        break;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
Ejemplo n.º 4
0
    private void Save()
    {
        try
        {
            if (txtDisplayTitle.Text.Trim() != string.Empty && txtLastEdndent.Text.Trim() != string.Empty && txtMaxDescriptionsLength.Text.Trim() != string.Empty && txtMaxNumberofPosts.Text.Trim() != string.Empty && txtRssURL.Text.Trim() != string.Empty)
            {
                if (hdnRssURLID.Value != string.Empty && hdnMaxNumberofPostsID.Value != string.Empty && hdnMaxDescriptionsLengthID.Value != string.Empty && hdnLastEdndentID.Value != string.Empty && hdnDisplayTitleID.Value != string.Empty)
                {
                    int URLID = Int32.Parse(hdnRssURLID.Value);
                    int MaxNumberofPostsID = Int32.Parse(hdnMaxNumberofPostsID.Value);
                    int MaxDescriptionsLengthID = Int32.Parse(hdnMaxDescriptionsLengthID.Value);
                    int LastEdndentID = Int32.Parse(hdnLastEdndentID.Value);
                    int DisplayTitleID = Int32.Parse(hdnDisplayTitleID.Value);
                    int UserModuleID = Int32.Parse(hdnUserModuleID.Value);

                    RSSReaderSettingValueInfo objRssSetingInfo = new RSSReaderSettingValueInfo();
                    objRssSetingInfo.PortalID = GetPortalID;
                    objRssSetingInfo.CultureName = GetCurrentCultureName;
                    objRssSetingInfo.UserModuleID = UserModuleID;
                    objRssSetingInfo.AddedOn = DateTime.Now;
                    objRssSetingInfo.UpdatedOn = DateTime.Now;
                    objRssSetingInfo.AddedBy = GetUsername;
                    objRssSetingInfo.UpdatedBy = GetUsername;

                    #region "Save Logic"
                    RSSReaderSettingValueController con = new RSSReaderSettingValueController();
                    //for 1                    
                    objRssSetingInfo.RSSReaderSettingValueID = URLID;
                    objRssSetingInfo.SettingValue = txtRssURL.Text.Trim();
                    con.SaveRssSettings(objRssSetingInfo);

                    //for 2                    
                    objRssSetingInfo.RSSReaderSettingValueID = MaxNumberofPostsID;
                    objRssSetingInfo.SettingValue = txtMaxNumberofPosts.Text.Trim();
                    con.SaveRssSettings(objRssSetingInfo);

                    //for 3                    
                    objRssSetingInfo.RSSReaderSettingValueID = MaxDescriptionsLengthID;
                    objRssSetingInfo.SettingValue = txtMaxDescriptionsLength.Text.Trim();
                    con.SaveRssSettings(objRssSetingInfo);

                    //for 4                    
                    objRssSetingInfo.RSSReaderSettingValueID = LastEdndentID;
                    objRssSetingInfo.SettingValue = txtLastEdndent.Text.Trim();
                    con.SaveRssSettings(objRssSetingInfo);

                    //for 5                    
                    objRssSetingInfo.RSSReaderSettingValueID = DisplayTitleID;
                    objRssSetingInfo.SettingValue = txtDisplayTitle.Text.Trim();
                    con.SaveRssSettings(objRssSetingInfo); 
                    #endregion

                    ShowMessage(SageMessageTitle.Information.ToString(), SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/SageRssReader/ModuleLocalText", "SettingSavedSuccessfully"), "", SageMessageType.Success);

                }
            }
            else
            {
                //Show message
                ShowMessage(SageMessageTitle.Notification.ToString(), SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/SageRssReader/ModuleLocalText", "PleaseFillSettingValues"), "", SageMessageType.Error);
            }
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
Ejemplo n.º 5
0
    private void LoadAllSettings()
    {
        try
        {
            RSSReaderSettingValueController con = new RSSReaderSettingValueController();
            List<RSSReaderSettingValueInfo> objSettings = con.GetAllRssSettings(GetPortalID, Int32.Parse(SageUserModuleID), GetCurrentCultureName);
            if (objSettings != null)
            {
                foreach (RSSReaderSettingValueInfo rsSeting in objSettings)
                {
                    switch (rsSeting.SettingKey)
                    {
                        case "DisplayTitle":
                            txtDisplayTitle.Text = rsSeting.SettingValue;
                            hdnDisplayTitleID.Value = rsSeting.RSSReaderSettingValueID.ToString();
                            break;
                        case "LastEdndent":
                            txtLastEdndent.Text = rsSeting.SettingValue;
                            hdnLastEdndentID.Value = rsSeting.RSSReaderSettingValueID.ToString();
                            break;
                        case "MaxNumberofPosts":
                            txtMaxNumberofPosts.Text = rsSeting.SettingValue;
                            hdnMaxNumberofPostsID.Value = rsSeting.RSSReaderSettingValueID.ToString();
                            break;
                        case "MaxDescriptionsLength":
                            txtMaxDescriptionsLength.Text = rsSeting.SettingValue;
                            hdnMaxDescriptionsLengthID.Value = rsSeting.RSSReaderSettingValueID.ToString();
                            break;
                        case "RssURL":
                            txtRssURL.Text = rsSeting.SettingValue;
                            hdnRssURLID.Value = rsSeting.RSSReaderSettingValueID.ToString();
                            break;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }

    }
Ejemplo n.º 6
0
    private void Save()
    {
        try
        {
            if (txtDisplayTitle.Text.Trim() != string.Empty && txtLastEdndent.Text.Trim() != string.Empty && txtMaxDescriptionsLength.Text.Trim() != string.Empty && txtMaxNumberofPosts.Text.Trim() != string.Empty && txtRssURL.Text.Trim() != string.Empty)
            {
                if (hdnRssURLID.Value != string.Empty && hdnMaxNumberofPostsID.Value != string.Empty && hdnMaxDescriptionsLengthID.Value != string.Empty && hdnLastEdndentID.Value != string.Empty && hdnDisplayTitleID.Value != string.Empty)
                {
                    int URLID = Int32.Parse(hdnRssURLID.Value);
                    int MaxNumberofPostsID      = Int32.Parse(hdnMaxNumberofPostsID.Value);
                    int MaxDescriptionsLengthID = Int32.Parse(hdnMaxDescriptionsLengthID.Value);
                    int LastEdndentID           = Int32.Parse(hdnLastEdndentID.Value);
                    int DisplayTitleID          = Int32.Parse(hdnDisplayTitleID.Value);
                    int UserModuleID            = Int32.Parse(hdnUserModuleID.Value);

                    RSSReaderSettingValueInfo objRssSetingInfo = new RSSReaderSettingValueInfo();
                    objRssSetingInfo.PortalID     = GetPortalID;
                    objRssSetingInfo.CultureName  = GetCurrentCultureName;
                    objRssSetingInfo.UserModuleID = UserModuleID;
                    objRssSetingInfo.AddedOn      = DateTime.Now;
                    objRssSetingInfo.UpdatedOn    = DateTime.Now;
                    objRssSetingInfo.AddedBy      = GetUsername;
                    objRssSetingInfo.UpdatedBy    = GetUsername;

                    #region "Save Logic"
                    RSSReaderSettingValueController con = new RSSReaderSettingValueController();
                    //for 1
                    objRssSetingInfo.RSSReaderSettingValueID = URLID;
                    objRssSetingInfo.SettingValue            = txtRssURL.Text.Trim();
                    con.SaveRssSettings(objRssSetingInfo);

                    //for 2
                    objRssSetingInfo.RSSReaderSettingValueID = MaxNumberofPostsID;
                    objRssSetingInfo.SettingValue            = txtMaxNumberofPosts.Text.Trim();
                    con.SaveRssSettings(objRssSetingInfo);

                    //for 3
                    objRssSetingInfo.RSSReaderSettingValueID = MaxDescriptionsLengthID;
                    objRssSetingInfo.SettingValue            = txtMaxDescriptionsLength.Text.Trim();
                    con.SaveRssSettings(objRssSetingInfo);

                    //for 4
                    objRssSetingInfo.RSSReaderSettingValueID = LastEdndentID;
                    objRssSetingInfo.SettingValue            = txtLastEdndent.Text.Trim();
                    con.SaveRssSettings(objRssSetingInfo);

                    //for 5
                    objRssSetingInfo.RSSReaderSettingValueID = DisplayTitleID;
                    objRssSetingInfo.SettingValue            = txtDisplayTitle.Text.Trim();
                    con.SaveRssSettings(objRssSetingInfo);
                    #endregion

                    ShowMessage(SageMessageTitle.Information.ToString(), SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/SageRssReader/ModuleLocalText", "SettingSavedSuccessfully"), "", SageMessageType.Success);
                }
            }
            else
            {
                //Show message
                ShowMessage(SageMessageTitle.Notification.ToString(), SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/SageRssReader/ModuleLocalText", "PleaseFillSettingValues"), "", SageMessageType.Error);
            }
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }