protected void GVNewsLetter_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName.Equals("AddToFavorite"))
        {
            LinkButton lnkBtnFavorite = (LinkButton)e.CommandSource;
            Entity.UserInfo oUserInfo = new Entity.UserInfo();
            oUserInfo.IntFavoriteTypeId = 0;
            oUserInfo.IntFavoriteId = 0;
            if (lnkBtnFavorite.Text == "Remove from Favorite")
                oUserInfo.IntFavoriteId = Convert.ToInt32(e.CommandArgument);

            oUserInfo.StrUserId = AppLib.GetLoggedInUserName();
            oUserInfo.StrTitle = "";
            oUserInfo.StrFavoriteType = "Newsletter";
            oUserInfo.DtCreatedOn = DateTime.Now;
            oUserInfo.IntFavoriteTypeId = Convert.ToInt32(e.CommandArgument);
            BLL.UserLib oUserLib = new BLL.UserLib();
            oUserLib.NewsletterAddToFavorite(oUserInfo);

            oUserInfo = null;
            oUserLib = null;
            BindNewsLetters();
        }
        else if (e.CommandName.Equals("PathNewslettersFile"))
        {
            Entity.NewsInfo oNewsInfo = new Entity.NewsInfo();
            BLL.NewsLib oNewsLib = new BLL.NewsLib();

            oNewsInfo = oNewsLib.GetNewsLettersById(Convert.ToInt32(e.CommandArgument));
            if (oNewsInfo != null)
            {

                GridViewRow row = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
                LinkButton lnkNewslettes = (LinkButton)row.FindControl("lnkNewsletters");
                ViewState["strOldFileName"] = oNewsInfo.StrPDFFilename;
                string Path = AppConfig.GetBaseSiteUrl() + AppConfig.GetNewsLettersPDFPath() + oNewsInfo.StrPDFFilename;
                Response.Write("<script type='text/javascript'>detailedresults=window.open('" + Path + "', 'popUpWindow', 'height=700,width=900,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');</script>");
            }
        }
    }
    protected void GVNewsLetter_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName.Equals("AddToFavorite"))
        {
            LinkButton lnkBtnFavorite = (LinkButton)e.CommandSource;
            Entity.UserInfo oUserInfo = new Entity.UserInfo();
            oUserInfo.IntFavoriteTypeId = 0;
            oUserInfo.IntFavoriteId = 0;
            if (lnkBtnFavorite.Text == "Remove from Favorite")
                oUserInfo.IntFavoriteId = Convert.ToInt32(e.CommandArgument);

            oUserInfo.StrUserId = AppLib.GetLoggedInUserName();
            oUserInfo.StrTitle = "";
            oUserInfo.StrFavoriteType = "Newsletter";
            oUserInfo.DtCreatedOn = DateTime.Now;
            oUserInfo.IntFavoriteTypeId = Convert.ToInt32(e.CommandArgument);
            BLL.UserLib oUserLib = new BLL.UserLib();
            oUserLib.NewsletterAddToFavorite(oUserInfo);

            oUserInfo = null;
            oUserLib = null;
            //BindNewsLetters();
        }
    }