Exemplo n.º 1
0
    protected void BindNotificationRequest()
    {
        hdnCurrentPage.Value = "1";
        hdnTotalItem.Value   = "500";

        if (Convert.ToString(Session["ExternalUserId"]) != "" && Session["ExternalUserId"] != null)
        {
            DataTable dtSearch = objdanetwork.GetUserSearch(Convert.ToInt32(hdnCurrentPage.Value), Convert.ToInt32(hdnTotalItem.Value), Convert.ToInt32(Session["ExternalUserId"]), DA_Networks.NetworkDetails.SingleRecord);
            dt.Clear();
            objRegistration.RegistrationId = Convert.ToInt32(ViewState["UserID"]);
            dt = objRegistrationDB.GetDataTable(objRegistration, DA_Registrationdetails.RegistrationDetails.SingleRecord);
            if (dtSearch.Rows.Count > 0)
            {
                hdnNotificationcount.Value = Convert.ToString(dtSearch.Rows[0]["Maxcount"]);

                if (dt.Rows.Count > 0)
                {
                    if (!string.IsNullOrEmpty(Convert.ToString(dt.Rows[0]["intNotificationCount"])))
                    {
                        int Ncount    = Convert.ToInt32(Convert.ToString(dt.Rows[0]["intNotificationCount"]));
                        int MaxNCount = Convert.ToInt32(hdnNotificationcount.Value);

                        if (MaxNCount > Ncount)
                        {
                            lblNotifyCount.Text = Convert.ToString(dtSearch.Rows[0]["Maxcount"]);
                            lblNotifyCount.Text = Convert.ToString(MaxNCount - Ncount);
                        }
                        else
                        {
                            lblNotifyCount.Text = "0";
                        }
                    }
                    else
                    {
                        lblNotifyCount.Text = "0";
                    }
                }
                else
                {
                    lblNotifyCount.Text = Convert.ToString(dtSearch.Rows[0]["Maxcount"]);
                }
            }
            else
            {
                lblNotifyCount.Text        = "0";
                hdnNotificationcount.Value = "0";
            }
        }
    }
Exemplo n.º 2
0
    //public void GetNotifications()
    //{
    //    BindTopNotifcations();
    //}

    //protected void ImgNotification_Click(object sender, System.Web.UI.ImageClickEventArgs e)
    //{
    //    if (lblNotifyCount.Text != "0")
    //    {
    //        dvNotification.Style.Add("display", "block");
    //        BindTopNotifcations();
    //    }
    //}

    //protected void BindTopNotifcations()
    //{
    //    if (Convert.ToString(Session["ExternalUserId"]) != "" && Session["ExternalUserId"] != null)
    //    {
    //        hdnCurrentPage.Value = "1";
    //        hdnTotalItem.Value = "500";

    //        DataTable dtSearch = objdanetwork.GetUserSearch(Convert.ToInt32(hdnCurrentPage.Value), Convert.ToInt32(hdnTotalItem.Value), Convert.ToInt32(Session["ExternalUserId"]), DA_Networks.NetworkDetails.GetTopNotifications);
    //        if (dtSearch.Rows.Count > 0)
    //        {
    //            dvAllNotifi.Style.Add("display", "block");
    //            lstNotification.DataSource = dtSearch;
    //            lstNotification.DataBind();
    //        }
    //        else
    //        {
    //            lstNotification.DataSource = null;
    //            lstNotification.DataBind();
    //        }
    //        if (dtSearch.Rows.Count >= 5)
    //        {
    //            dvAllNotifi.Style.Add("display", "block");
    //        }
    //    }
    //    else
    //    {
    //        lstNotification.DataSource = null;
    //        lstNotification.DataBind();
    //    }
    //}

    protected void GetLoginUserDetails()
    {
        DataTable dtDetails = new DataTable();

        objRegistration.AddedBy = Convert.ToInt32(ViewState["UserID"]);
        dtDetails = objRegistrationDB.GetDataTable(objRegistration, DA_Registrationdetails.RegistrationDetails.GetApprovedStudentByInstitute);
        if (dtDetails.Rows.Count > 0)
        {
            if (!string.IsNullOrEmpty(Convert.ToString(dtDetails.Rows[0]["vchrPhotoPath"])))
            {
                string imgPathPhysical = Server.MapPath("~/CroppedPhoto/" + dtDetails.Rows[0]["vchrPhotoPath"].ToString());
                if (File.Exists(imgPathPhysical))
                {
                    imgProfilePic.Src = "CroppedPhoto/" + dtDetails.Rows[0]["vchrPhotoPath"].ToString();
                }
                else
                {
                    imgProfilePic.Src = "images/profile-photo.png";
                }
            }
            else
            {
                imgProfilePic.Src = "images/profile-photo.png";
            }
        }
    }
Exemplo n.º 3
0
    private void activate()
    {
        DataTable dtReq = new DataTable();

        if (Convert.ToInt32(ViewState["RegOutId"]) != 0)
        {
            objRegistration.RegistrationId = Convert.ToInt32(ViewState["RegOutId"]);
        }

        objRegistrationDB.AddEditDel_Profile(objRegistration, DA_Registrationdetails.RegistrationDetails.InstituteNameStuProfList);

        dtReq = objRegistrationDB.GetDataTable(objRegistration, DA_Registrationdetails.RegistrationDetails.SingleRecord);

        SendMail(dtReq.Rows[0]["vchrUserName"].ToString());
    }
Exemplo n.º 4
0
    protected void lstReplyForum_ItemDatabound(object sender, ListViewItemEventArgs e)
    {
        Label       lblTotallike    = (Label)e.Item.FindControl("lblTotallike");
        Label       lblReplyComment = (Label)e.Item.FindControl("lblReplyComment");
        HtmlImage   imgprofile      = (HtmlImage)e.Item.FindControl("imgprofile");
        HiddenField hdnimgprofile   = e.Item.FindControl("hdnimgprofile") as HiddenField;
        HiddenField hdnRegid        = (HiddenField)e.Item.FindControl("hdnRegid");
        LinkButton  lnkDelete       = (LinkButton)e.Item.FindControl("lnkDelete");
        LinkButton  lnkEdit         = (LinkButton)e.Item.FindControl("lnkEdit");

        string UserID = ViewState["UserID"].ToString();

        if (hdnRegid.Value == UserID)
        {
            lnkEdit.Visible   = true;
            lnkDelete.Visible = true;
        }
        else
        {
            lnkEdit.Visible   = false;
            lnkDelete.Visible = false;
        }

        if (imgprofile.Src == "" || imgprofile.Src == null || imgprofile.Src == "CroppedPhoto/")
        {
            imgprofile.Src = "images/photo2.jpg";
        }
        else
        {
            string imgPathPhysical = Server.MapPath("~/CroppedPhoto/" + hdnimgprofile.Value);
            if (File.Exists(imgPathPhysical))
            {
            }
            else
            {
                imgprofile.Src = "images/comment-profile.jpg";
            }
        }

        string filtertext = "";

        string ReplyComment  = lblReplyComment.Text;
        string filterComment = lblReplyComment.Text.Trim().Replace("#", "");

        string[] SubCatID = ReplyComment.Split('#');

        String[] val = ReplyComment.Split(new Char[] { ' ' });
        String   userid1;

        for (int i = 0; i < val.Length; i++)
        {
            if (val[i].StartsWith("#", StringComparison.CurrentCultureIgnoreCase))
            {
                userid1 = val[i].Split(new char[] { '#' })[1];

                if (!string.IsNullOrEmpty(userid1))
                {
                    objdoreg.AddedBy = Convert.ToInt32(userid1);
                    DataTable dtReq = new DataTable();
                    dtReq = objdareg.GetDataTable(objdoreg, DA_Registrationdetails.RegistrationDetails.GetApprovedStudentByInstitute);
                    if (dtReq.Rows.Count > 0)
                    {
                        string url = "Home.aspx?RegId=" + userid1;

                        if (String.IsNullOrEmpty(filtertext))
                        {
                            filtertext = Regex.Replace(filterComment, userid1, "<a href='" + url + "'>" + dtReq.Rows[0]["FullName"] + "</a>");
                        }
                        else
                        {
                            filtertext = Regex.Replace(filtertext, userid1, "<a href='" + url + "'>" + dtReq.Rows[0]["FullName"] + "</a>");
                        }
                        lblReplyComment.Text = filtertext;
                    }
                }
            }
        }

        HiddenField hdnForumPostId = (HiddenField)e.Item.FindControl("hdnForumPostId");
        LinkButton  btnLike        = (LinkButton)e.Item.FindControl("btnLike");

        objDOBForumPosting.intForumPostingId     = Convert.ToInt32(Request.QueryString["ForumId"]);;
        objDOBForumPosting.ForumReplyLikeShareId = Convert.ToInt32(hdnForumPostId.Value);
        objDOBForumPosting.intAddedBy            = Convert.ToInt32(ViewState["UserID"]);
        dt = objDAForumPosting.GetDataTable(objDOBForumPosting, DA_Scrl_UserForumPosting.Scrl_UseForumPosting.GetChildLikeCount);
        if (dt.Rows.Count > 0)
        {
            int TotalLike = Convert.ToInt32(dt.Rows[0]["TotalLike"]);
            lblTotallike.Text = Convert.ToString(TotalLike);
            if (dt.Rows[0]["LIKEUSERID"].ToString() == ViewState["UserID"].ToString())
            {
                btnLike.Text = "Unlike";
            }
        }
        else
        {
            lblTotallike.Text = "";
        }
    }