예제 #1
0
        public List <DTOEmotionGroup> GetRateableemotionPlugin(string rateabletagId, string websiteName, string premalink, long currentUserId)
        {
            _lstEmotions = new List <DTOEmotionGroup>();

            try
            {
                sqlparameter    = new SqlParameter[4];
                sqlparameter[0] = new SqlParameter("@RateabletagId", rateabletagId);
                sqlparameter[1] = new SqlParameter("@websiteName", websiteName);
                sqlparameter[2] = new SqlParameter("@Premalink", premalink);
                sqlparameter[3] = new SqlParameter("@CurrentUserId", currentUserId);

                OpenConnection();
                datareader = ExecuteReader(StoredProcedure.Names.GetRateableemotionPlugin.ToString());

                if (!datareader.HasRows)
                {
                    return(null);
                }
                while (datareader.Read())
                {
                    _dtoemotions = new DTOEmotionGroup
                    {
                        Id             = Convert.ToInt64(datareader["Id"]),
                        EmotionName    = datareader["Name"].ToString(),
                        WebsiteId      = Convert.ToInt32(datareader["Counts"]),
                        EmotionGroupId = Convert.ToInt32(datareader["flag"])
                    };

                    _lstEmotions.Add(_dtoemotions);
                }
            }
            catch (Exception error)
            {
                throw error;
            }
            finally
            {
                CloseConnection();
            }
            return(_lstEmotions);
        }
예제 #2
0
        protected void btnGenerateScript_Click(object sender, EventArgs e)
        {
            if (Request.QueryString["id"] != null && Convert.ToInt64(Request.QueryString["id"]) != 0)
            {
                var groupid = Convert.ToInt64(Request.QueryString["id"]);
                _bllEmotionGroup = new BLLEmotionGroup();
                _dtoEmotionGroup = new DTOEmotionGroup();
                _dtoEmotionGroup = _bllEmotionGroup.GetGenerateScript(groupid, UserId);

                if (_dtoEmotionGroup != null)
                {
                    var script =
                        "<div id='taghead'></div><script type ='text/javascript' language='javascript'>" +
                        "var Websitename_shortname = '" + _dtoEmotionGroup.EmotionName + "';var RateabletagId = '" +
                        _dtoEmotionGroup.UniqueId + "'</script>" +
                        "<script src='http://www.glozzary.com/Script/NewJScript.js' type='text/javascript'></script>";
                    txtscript.InnerText = script;
                }
            }
        }
예제 #3
0
        protected void GridPremalinkTags_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            try
            {
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    _dtoEmotions = new DTOEmotionGroup();
                    _dtoEmotions = (DTOEmotionGroup)e.Row.DataItem;

                    var lnkTagName = ((Label)e.Row.FindControl("lbltagname"));
                    lnkTagName.Text = _dtoEmotions.GroupName;

                    var action = (HyperLink)e.Row.FindControl("lnkedit");
                    action.NavigateUrl = "EditRateableTag.aspx?id=" + _dtoEmotions.Id;
                }
            }
            catch (Exception ex)
            {
                ex.ToExceptionless().Submit();
            }
        }
예제 #4
0
        public List <DTOEmotionGroup> GetRateableEmotionByEmotionGroupId(long emotionGroupId)
        {
            _lstEmotions = new List <DTOEmotionGroup>();

            try
            {
                sqlparameter    = new SqlParameter[1];
                sqlparameter[0] = new SqlParameter("@EmotionGroupId ", emotionGroupId);

                OpenConnection();
                datareader = ExecuteReader(StoredProcedure.Names.spGetRateableEmotionByEmotionGroupId.ToString());

                if (!datareader.HasRows)
                {
                    return(null);
                }
                while (datareader.Read())
                {
                    _dtoemotions = new DTOEmotionGroup
                    {
                        Id             = Convert.ToInt64(datareader["Id"]),
                        EmotionName    = datareader["Name"].ToString(),
                        EmotionGroupId = Convert.ToInt64(datareader["EmotionGroupId"].ToString()),
                        GroupName      = datareader["GroupName"].ToString()
                    };

                    _lstEmotions.Add(_dtoemotions);
                }
                return(_lstEmotions);
            }
            catch (Exception error)
            {
                throw error;
            }
            finally
            {
                CloseConnection();
            }
        }
예제 #5
0
        public DTOEmotionGroup GetGenerateScript(long groupId, long userid)
        {
            try
            {
                sqlparameter    = new SqlParameter[2];
                sqlparameter[0] = new SqlParameter("@GroupId ", groupId);
                sqlparameter[1] = new SqlParameter("@userId ", userid);

                OpenConnection();
                datareader = ExecuteReader(StoredProcedure.Names.GetGenerateScript.ToString());

                if (!datareader.HasRows)
                {
                    return(null);
                }
                while (datareader.Read())
                {
                    _dtoemotions = new DTOEmotionGroup
                    {
                        UniqueId    = Guid.Parse(datareader["UniqueID"].ToString()),
                        EmotionName = datareader["Name"].ToString()
                    };

                    return(_dtoemotions);
                }
            }
            catch (Exception error)
            {
                throw error;
            }
            finally
            {
                CloseConnection();
            }
            return(null);
        }