Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            User user = (User)Session["LoggedUser"];
            if (!IsPostBack)
            {
                if (user == null)
                    Response.Redirect("/Default.aspx");

                else
                {

                    RssFeedsRepository rssFeedsRepo = new RssFeedsRepository();
                    List<RssFeeds> lstrssfeeds = rssFeedsRepo.getAllActiveRssFeeds(user.Id);
                    TwitterAccountRepository twtAccountRepo = new TwitterAccountRepository();
                    ArrayList arrTwtAcc = twtAccountRepo.getAllTwitterAccountsOfUser(user.Id);
                    //ddlSendFrom.DataSource = arrTwtAcc;
                    //ddlSendFrom.DataTextField = "TwitterScreenName";
                    //ddlSendFrom.DataValueField = "TwitterUserId";
                    //ddlSendFrom.DataBind();

                    if (lstrssfeeds != null)
                    {
                        if (lstrssfeeds.Count != 0)
                        {
                            int rssCount = 0;
                            string rssData = string.Empty;
                            rssData += "<h2 class=\"league section-ttl rss_header\">Active RSS Feeds</h2>";
                            foreach (RssFeeds item in lstrssfeeds)
                            {
                                TwitterAccount twtAccount = twtAccountRepo.getUserInformation(item.ProfileScreenName, user.Id);
                                string picurl = string.Empty;

                                if (string.IsNullOrEmpty(twtAccount.ProfileUrl))
                                {
                                    picurl = "../Contents/img/blank_img.png";

                                }
                                else
                                {
                                    picurl = twtAccount.ProfileUrl;

                                }
                                rssData += " <section id=\"" + item.Id + "\" class=\"publishing\">" +
                                        "<section class=\"twothird\">" +
                                            "<article class=\"quarter\">" +
                                                "<div href=\"#\" class=\"avatar_link view_profile\" title=\"\">" +
                                                    "<img title=\"" + item.ProfileScreenName + "\" src=\"" + picurl + "\" data-src=\"\" class=\"avatar sm\">" +
                                                    "<article class=\"rss_ava_icon\"><span title=\"Twitter\" class=\"icon twitter_16\"></span></article>" +
                                                "</div>" +
                                            "</article>" +
                                            "<article class=\"threefourth\">" +
                                                "<ul>" +
                                                    "<li>" + item.FeedUrl + "</li>" +
                                                    "<li>Prefix: </li>" +
                                                    "<li class=\"freq\" title=\"New items from this feed will be posted at most once every hour\">Max Frequency: " + item.Duration + "</li>" +
                                                "</ul>" +
                                            "</article>" +
                                        "</section>" +
                                        "<section class=\"third\">" +
                                            "<ul class=\"rss_action_buttons\">" +
                                                "<li onclick=\"pauseFunction('" + item.Id + "');\" class=\"\"><a id=\"pause_" + item.Id + "\" href=\"#\" title=\"Pause\" class=\"small_pause icon pause\"></a></li>" +
                                                "<li onclick=\"deleteRssFunction('" + item.Id + "');\" class=\"show-on-hover\"><a id=\"delete_" + item.Id + "\" href=\"#\" title=\"Delete\" class=\"small_remove icon delete\"></a></li>" +
                                            "</ul>" +
                                        "</section>" +
                                     "</section>";
                            }

                            rss.InnerHtml = rssData;
                            rss.Style.Add("display", "block");
                            rdata.Style.Add("display", "none");

                        }
                }
                    try
                    {
                        if (Session["IncomingTasks"] != null)
                        {
                            incom_tasks.InnerHtml = Convert.ToString((int)Session["IncomingTasks"]);
                            incomTasks.InnerHtml = Convert.ToString((int)Session["IncomingTasks"]);
                        }
                        else
                        {
                            TaskRepository taskRepo = new TaskRepository();
                            ArrayList alst = taskRepo.getAllIncompleteTasksOfUser(user.Id);
                            Session["IncomingTasks"] = alst.Count;
                        }
                    }
                    catch (Exception es)
                    {
                        logger.Error(es.StackTrace);
                        Console.WriteLine(es.StackTrace);
                    }
                    if (Session["CountMessages"] != null)
                    {
                        incom_messages.InnerHtml = Convert.ToString((int)Session["CountMessages"]);
                        incomMessages.InnerHtml = Convert.ToString((int)Session["CountMessages"]);
                    }
                    else
                    {
                        incom_messages.InnerHtml = "0";
                        incomMessages.InnerHtml = "0";
                    }
                    //usernm.InnerHtml = "Hello, <a href=\"../Settings/PersonalSettings.aspx\"> " + user.UserName + "</a>";
                    usernm.InnerHtml = "Hello, <a href=\"../Settings/PersonalSettings.aspx\"> " + user.UserName + "</a>";
                    //usernm.InnerHtml = "Hello, <a href=\"../Settings/PersonalSettings.aspx\"> " + user.UserName + "</a>";

                    usernm.InnerHtml = "Hello, <a href=\"../Settings/PersonalSettings.aspx\"> " + user.UserName + "</a>";
                    //usernm.InnerHtml = "Hello, <a href=\"../Settings/PersonalSettings.aspx\"> " + user.UserName + "</a>";
                    if (!string.IsNullOrEmpty(user.ProfileUrl))
                    {
                        Datetime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToLongDateString() + " " + TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToShortTimeString() + " (" + user.TimeZone + ")";
                        userimg.InnerHtml = "<a href=\"../Settings/PersonalSettings.aspx\"><img id=\"loggeduserimg\" src=\"" + user.ProfileUrl + "\" alt=\"" + user.UserName + "\" height=\"100\" width=\"100\"/></a>";

                        userinf.InnerHtml = Datetime;

                        if (user.TimeZone != null)
                        {
                            Datetime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToLongDateString() + " " + TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToShortTimeString() + " (" + user.TimeZone + ")";
                            userinf.InnerHtml = Datetime;
                        }
                        if (user.TimeZone == null)
                        {
                            Datetime = DateTime.Now.ToString();
                            userinf.InnerHtml = Datetime;
                        }
                    }
                    else
                    {
                        Datetime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToLongDateString() + " " + TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToShortTimeString() + " (" + user.TimeZone + ")";
                        userimg.InnerHtml = "<a href=\"../Settings/PersonalSettings.aspx\"><img id=\"loggeduserimg\" src=\"../Contents/img/blank_img.png\" alt=\"" + user.UserName + "\"/></a>";

                        userinf.InnerHtml = Datetime;

                        if (user.TimeZone != null)
                        {
                            Datetime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToLongDateString() + " " + TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToShortTimeString() + " (" + user.TimeZone + ")";
                            userinf.InnerHtml = Datetime;
                        }
                        if (user.TimeZone == null)
                        {
                            Datetime = DateTime.Now.ToString();
                            userinf.InnerHtml = Datetime;
                        }
                    }

                    try
                    {

                        GroupRepository grouprepo = new GroupRepository();
                        List<Groups> lstgroups = grouprepo.getAllGroups(user.Id);
                        string totgroups = string.Empty;
                        if (lstgroups.Count != 0)
                        {
                            foreach (Groups item in lstgroups)
                            {
                                totgroups += "<li><a href=\"../Settings/InviteMember.aspx?q=" + item.Id + "\" id=\"group_" + item.Id + "\"><img src=\"../Contents/img/groups_.png\"  alt=\"\"  style=\" margin-right:5px;\"/>" + item.GroupName + "</a></li>";
                            }
                            inviteRedirect.InnerHtml = totgroups;
                        }

                    }
                    catch (Exception ex)
                    {
                        logger.Error(ex.StackTrace);
                        Console.WriteLine(ex.StackTrace);
                    }
                }

            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            User user = (User)Session["LoggedUser"];

            if (!IsPostBack)
            {

                if (user == null)
                    Response.Redirect("/Default.aspx");
                else
                {

                    try
                    {
                        if (Session["IncomingTasks"] != null)
                        {
                            incom_tasks.InnerHtml = Convert.ToString((int)Session["IncomingTasks"]);
                            incomTasks.InnerHtml = Convert.ToString((int)Session["IncomingTasks"]);
                        }
                        else
                        {
                            TaskRepository taskRepo = new TaskRepository();
                            ArrayList alst = taskRepo.getAllIncompleteTasksOfUser(user.Id);
                            Session["IncomingTasks"] = alst.Count;
                        }
                    }
                    catch (Exception es)
                    {
                        logger.Error(es.Message);
                        Console.WriteLine(es.Message);
                    }
                    try
                    {
                        if (Session["CountMessages"] != null)
                        {
                            incom_messages.InnerHtml = Convert.ToString((int)Session["CountMessages"]);
                            incomMessages.InnerHtml = Convert.ToString((int)Session["CountMessages"]);
                        }
                        else
                        {
                            incom_messages.InnerHtml = "0";
                            incomMessages.InnerHtml = "0";
                        }
                    }
                    catch (Exception sx)
                    {
                        logger.Error(sx.Message);
                        Console.WriteLine(sx.Message);
                    }

                    usernm.InnerHtml = "Hello, <a href=\"../Settings/PersonalSettings.aspx\"> " + user.UserName + "</a> ";
                    if (!string.IsNullOrEmpty(user.ProfileUrl))
                    {
                        Datetime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToLongDateString() + " " + TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToShortTimeString() + " (" + user.TimeZone + ")";
                        userimg.InnerHtml = "<a href=\"../Settings/PersonalSettings.aspx\"><img id=\"loggeduserimg\" src=\"" + user.ProfileUrl + "\" alt=\"" + user.UserName + "\" height=\"100\" width=\"100\"/></a></a>";
                        userinf.InnerHtml = Datetime;
                    //{
                    //    userimg.InnerHtml = "<a href=\"../Settings/PersonalSettings.aspx\"><img id=\"loggeduserimg\" src=\"" + user.ProfileUrl + "\" alt=\"" + user.UserName + "\" height=\"100\" width=\"100\"/></a></a>";
                        if (user.TimeZone != null)
                        {
                            Datetime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToLongDateString() + " " + TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToShortTimeString() + " (" + user.TimeZone + ")";
                            userinf.InnerHtml = Datetime;
                        }
                        if (user.TimeZone == null)
                        {
                            Datetime = DateTime.Now.ToString();
                            userinf.InnerHtml = Datetime;
                        }
                    }
                    else
                    {
                        Datetime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToLongDateString() + " " + TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToShortTimeString() + " (" + user.TimeZone + ")";
                        userimg.InnerHtml = "<a href=\"../Settings/PersonalSettings.aspx\"><img id=\"loggeduserimg\" src=\"../Contents/img/blank_img.png\" alt=\"" + user.UserName + "\"/></a>";

                        userinf.InnerHtml = Datetime;
                        if (user.TimeZone != null)
                        {
                            Datetime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToLongDateString() + " " + TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToShortTimeString() + " (" + user.TimeZone + ")";
                            userinf.InnerHtml = Datetime;
                        }
                        if (user.TimeZone == null)
                        {
                            Datetime = DateTime.Now.ToString();
                            userinf.InnerHtml = Datetime;
                        }
                    }

                    try
                    {

                        GroupRepository grouprepo = new GroupRepository();
                        List<Groups> lstgroups = grouprepo.getAllGroups(user.Id);
                        string totgroups = string.Empty;
                        if (lstgroups.Count != 0)
                        {
                            foreach (Groups item in lstgroups)
                            {
                                totgroups += "<li><a href=\"../Settings/InviteMember.aspx?q=" + item.Id + "\" id=\"group_" + item.Id + "\"><img src=\"../Contents/img/groups_.png\"  alt=\"\"  style=\" margin-right:5px;\"/>" + item.GroupName + "</a></li>";
                            }
                            inviteRedirect.InnerHtml = totgroups;
                        }
                        if (user.AccountType == AccountType.Deluxe.ToString().ToLower())
                            tot_acc = 10;
                        else if (user.AccountType == AccountType.Standard.ToString().ToLower())
                            tot_acc = 20;
                        else if (user.AccountType == AccountType.Premium.ToString().ToLower())
                            tot_acc = 50;
                        profileCount = objSocioRepo.getAllSocialProfilesOfUser(user.Id).Count;

                    }
                    catch (Exception ex)
                    {
                        logger.Error(ex.Message);
                        Console.WriteLine(ex.Message);
                    }
                }
            }
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                User user = (User)Session["LoggedUser"];

                #region check user Activation

                UserRepository objUserRepository = new UserRepository();

                try
                {
                    if (user != null)
                    {
                        if (user.ActivationStatus == "0" || user.ActivationStatus ==null)
                        {
                            actdiv.InnerHtml = "<span >Your account is not yet activated.Check your E-mail to activate your account.</span><a id=\"resendmail\" uid=\""+user.Id+"\" href=\"#\">Resend Mail</a>";
                            if (Request.QueryString["stat"] == "activate")
                            {
                                if (Request.QueryString["id"] != null)
                                {
                                    //objUserActivation = objUserActivationRepository.GetUserActivationStatusbyid(Request.QueryString["id"].ToString());
                                    if (user.Id.ToString() == Request.QueryString["id"].ToString())
                                    {
                                        user.Id = user.Id; //Guid.Parse(Request.QueryString["id"]);
                                        //objUserActivation.UserId = Guid.Parse(Request.QueryString["id"]);// objUserActivation.UserId;
                                        user.ActivationStatus = "1";
                                        //UserActivationRepository.Update(objUserActivation);

                                        int res = objUserRepository.UpdateActivationStatusByUserId(user);

                                        actdiv.Attributes.CssStyle.Add("display", "none");
                                        Console.WriteLine("before");
                                        #region to check/update user Reference Relation
                                        IsUserReferenceActivated(Request.QueryString["id"].ToString());
                                        Console.WriteLine("after");
                                        #endregion

                                    }
                                    else
                                    {
                                        Session["ActivationError"] = "Wrong Activation Link please contact Admin!";
                                        //ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Wrong Activation Link please contact Admin!');", true);
                                        //Response.Redirect("ActivationLink.aspx");

                                    }
                                }
                                else
                                {
                                    Session["ActivationError"] = "Wrong Activation Link please contact Admin!";
                                    //ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Wrong Activation Link please contact Admin!');", true);
                                    //Response.Redirect("ActivationLink.aspx");
                                }

                            }
                            else
                            {
                                // Response.Redirect("ActivationLink.aspx");
                            }

                        }

                        if (user.ActivationStatus == "1")
                        {
                            actdiv.Attributes.CssStyle.Add("display", "none");
                        }
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    logger.Error(ex.StackTrace);
                }
                #endregion

                if (!IsPostBack)
                {

                    if (user == null)
                        Response.Redirect("/Default.aspx");
                    else
                    {

                        #region for You can use only 30 days as Unpaid User

                        if (user.PaymentStatus.ToLower() == "unpaid")
                        {
                            if (!SBUtils.IsUserWorkingDaysValid(user.ExpiryDate))
                            {
                                //cmposecontainer.Attributes.Add("display", "none");
                                cmposecontainer.Attributes.CssStyle.Add("display", "none");
                                topbtn.Attributes.CssStyle.Add("display", "none");
                            }
                        }
                        #endregion

                        try
                        {
                            if (Session["IncomingTasks"] != null)
                            {
                                incom_tasks.InnerHtml = Convert.ToString((int)Session["IncomingTasks"]);
                                incomTasks.InnerHtml = Convert.ToString((int)Session["IncomingTasks"]);
                            }
                            else
                            {
                                TaskRepository taskRepo = new TaskRepository();
                                ArrayList alst = taskRepo.getAllIncompleteTasksOfUser(user.Id);
                                Session["IncomingTasks"] = alst.Count;
                                incom_tasks.InnerHtml = Convert.ToString(alst.Count);
                                incomTasks.InnerHtml = Convert.ToString(alst.Count);
                            }
                        }
                        catch (Exception es)
                        {
                            logger.Error(es.Message);
                            Console.WriteLine(es.Message);
                        }
                        try
                        {
                            if (Session["CountMessages"] != null)
                            {
                                incom_messages.InnerHtml = Convert.ToString((int)Session["CountMessages"]);
                                incomMessages.InnerHtml = Convert.ToString((int)Session["CountMessages"]);
                            }
                            else
                            {
                                incom_messages.InnerHtml = "0";
                                incomMessages.InnerHtml = "0";
                            }
                        }
                        catch (Exception sx)
                        {
                            logger.Error(sx.Message);
                            Console.WriteLine(sx.Message);
                        }

                        usernm.InnerHtml = "Hello, <a href=\"../Settings/PersonalSettings.aspx\"> " + user.UserName + "</a> ";
                        if (!string.IsNullOrEmpty(user.ProfileUrl))
                        {
                            // Datetime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToLongDateString() + " " + TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToShortTimeString() + " (" + user.TimeZone + ")";
                            userimg.InnerHtml = "<a href=\"../Settings/PersonalSettings.aspx\"><img id=\"loggeduserimg\" src=\"" + user.ProfileUrl + "\" alt=\"" + user.UserName + "\" /></a></a>";
                            //userinf.InnerHtml = Datetime;
                            //{
                            //    userimg.InnerHtml = "<a href=\"../Settings/PersonalSettings.aspx\"><img id=\"loggeduserimg\" src=\"" + user.ProfileUrl + "\" alt=\"" + user.UserName + "\" height=\"100\" width=\"100\"/></a></a>";
                            if (user.TimeZone != null)
                            {
                                Datetime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToLongDateString() + " " + TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToShortTimeString() + " (" + user.TimeZone + ")";
                                userinf.InnerHtml = Datetime;
                            }
                            if (user.TimeZone == null)
                            {
                                Datetime = DateTime.Now.ToString();
                                userinf.InnerHtml = Datetime;
                            }
                        }
                        else
                        {
                            //Datetime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToLongDateString() + " " + TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToShortTimeString() + " (" + user.TimeZone + ")";
                            userimg.InnerHtml = "<a href=\"../Settings/PersonalSettings.aspx\"><img id=\"loggeduserimg\" src=\"../Contents/img/blank_img.png\" alt=\"" + user.UserName + "\"/></a>";

                            userinf.InnerHtml = Datetime;
                            if (user.TimeZone != null)
                            {
                                Datetime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToLongDateString() + " " + TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToShortTimeString() + " (" + user.TimeZone + ")";
                                userinf.InnerHtml = Datetime;
                            }
                            if (user.TimeZone == null)
                            {
                                Datetime = DateTime.Now.ToString();
                                userinf.InnerHtml = Datetime;
                            }
                        }

                        try
                        {

                            GroupRepository grouprepo = new GroupRepository();
                            List<Groups> lstgroups = grouprepo.getAllGroups(user.Id);
                            string totgroups = string.Empty;
                            if (lstgroups.Count != 0)
                            {
                                foreach (Groups item in lstgroups)
                                {
                                    totgroups += "<li><a href=\"../Settings/InviteMember.aspx?q=" + item.Id + "\" id=\"group_" + item.Id + "\"><img src=\"../Contents/img/groups_.png\"  alt=\"\"  style=\" margin-right:5px;\"/>" + item.GroupName + "</a></li>";
                                }
                                inviteRedirect.InnerHtml = totgroups;
                            }
                            if (user.AccountType == AccountType.Deluxe.ToString().ToLower())
                                tot_acc = 10;
                            else if (user.AccountType == AccountType.Standard.ToString().ToLower())
                                tot_acc = 20;
                            else if (user.AccountType == AccountType.Premium.ToString().ToLower())
                                tot_acc = 50;
                            profileCount = objSocioRepo.getAllSocialProfilesOfUser(user.Id).Count;

                        }
                        catch (Exception ex)
                        {
                            logger.Error(ex.Message);
                            Console.WriteLine(ex.Message);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
                Console.WriteLine(ex.Message);
            }
        }
Example #4
0
        protected void btn_Click(object sender, EventArgs e)
        {
            try
            {
                int res = 0;
                Guid taskid = Guid.Parse(hdnTask_id.Value);
                bool status = bool.Parse(hdnstatus.Value.ToString());
                if (status == true)
                    status = false;
                else
                    status = true;
                TaskRepository objTaskRepo = new TaskRepository();
                objTaskRepo.updateTaskStatus(taskid, custid, status);
                TaskRepository taskRepo = new TaskRepository();
                ArrayList alst = taskRepo.getAllIncompleteTasksOfUser(custid);
                Session["IncomingTasks"] = alst.Count;
                bindTeamTask();
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);

            }
        }
Example #5
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtComment.Text))
     {
         try
         {
             Guid taskid = Guid.Parse(hdnTask_id.Value);
             string curdate = DateTime.Now.ToString("yyyy-MM-dd H:mm:ss ").ToString();
             TaskCommentRepository objTaskCmtRepo = new TaskCommentRepository();
             TaskComment objTaskCmt = new TaskComment();
             objTaskCmt.Comment = txtComment.Text;
             objTaskCmt.CommentDate = DateTime.Now;
             objTaskCmt.Id = Guid.NewGuid();
             objTaskCmt.TaskId = taskid;
             objTaskCmt.UserId = custid;
             objTaskCmtRepo.addTaskComment(objTaskCmt);
             hdnTask_id.Value = "";
             TaskRepository taskRepo = new TaskRepository();
             ArrayList alst = taskRepo.getAllIncompleteTasksOfUser(custid);
             Session["IncomingTasks"] = alst.Count;
         }
         catch (Exception ex)
         {
             logger.Error(ex.Message);
         }
     }
 }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            User user = (User)Session["LoggedUser"];

            if (!IsPostBack)
            {

                if (user == null)
                    Response.Redirect("/Default.aspx");
                else
                {
                    ProjectDetails prjDet = (ProjectDetails)Session["ProjectDet"];
                    var page = (Page)HttpContext.Current.Handler;
                    page.Title = prjDet.projectName;
                    logo.Alt = prjDet.projectName;
                    logo.Src = prjDet.projectLogo;
                    try
                    {
                        if (Session["IncomingTasks"] != null)
                        {
                            incom_tasks.InnerHtml = Convert.ToString((int)Session["IncomingTasks"]);
                            incomTasks.InnerHtml = Convert.ToString((int)Session["IncomingTasks"]);
                        }
                        else
                        {
                            TaskRepository taskRepo = new TaskRepository();
                            ArrayList alst = taskRepo.getAllIncompleteTasksOfUser(user.Id);
                            Session["IncomingTasks"] = alst.Count;
                        }
                    }
                    catch (Exception es)
                    {
                        logger.Error(es.Message);
                        Console.WriteLine(es.Message);
                    }
                    try
                    {
                        if (Session["CountMessages"] != null)
                        {
                            incom_messages.InnerHtml = Convert.ToString((int)Session["CountMessages"]);
                            incomMessages.InnerHtml = Convert.ToString((int)Session["CountMessages"]);
                        }
                        else
                        {
                            incom_messages.InnerHtml = "0";
                            incomMessages.InnerHtml = "0";
                        }
                    }
                    catch (Exception sx)
                    {
                        logger.Error(sx.Message);
                        Console.WriteLine(sx.Message);
                    }

                    usernm.InnerHtml = "Hello, <a href=\"../Settings/PersonalSettings.aspx\"> " + user.UserName + "</a> <div id=\"userinf\">sign in : " + DateTime.Now.ToLocalTime() + "</div>";
                    if (!string.IsNullOrEmpty(user.ProfileUrl))
                    {
                        userimg.InnerHtml = "<a href=\"../Settings/PersonalSettings.aspx\"><img id=\"loggeduserimg\" src=\"" + user.ProfileUrl + "\" alt=\"" + user.UserName + "\" height=\"100\" width=\"100\"/></a>";
                    }
                    else
                    {
                        userimg.InnerHtml = "<a href=\"../Settings/PersonalSettings.aspx\"><img id=\"loggeduserimg\" src=\"../Contents/img/blank_img.png\" alt=\"" + user.UserName + "\"/></a>";
                    }

                    try
                    {

                        GroupRepository grouprepo = new GroupRepository();
                        List<Groups> lstgroups = grouprepo.getAllGroups(user.Id);
                        string totgroups = string.Empty;
                        if (lstgroups.Count != 0)
                        {
                            foreach (Groups item in lstgroups)
                            {
                                totgroups += "<li><a href=\"../Settings/InviteMember.aspx?q=" + item.Id + "\" id=\"group_" + item.Id + "\"><img src=\"../Contents/img/groups_.png\"  alt=\"\"  style=\" margin-right:5px;\"/>" + item.GroupName + "</a></li>";
                            }
                            inviteRedirect.InnerHtml = totgroups;
                        }
                        if (user.AccountType == AccountType.Deluxe.ToString().ToLower())
                            tot_acc = 10;
                        else if (user.AccountType == AccountType.Standard.ToString().ToLower())
                            tot_acc = 20;
                        else if (user.AccountType == AccountType.Premium.ToString().ToLower())
                            tot_acc = 50;
                        profileCount = objSocioRepo.getAllSocialProfilesOfUser(user.Id).Count;

                    }
                    catch (Exception ex)
                    {
                        logger.Error(ex.Message);
                        Console.WriteLine(ex.Message);
                    }
                }
            }
        }
Example #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            User user = (User)Session["LoggedUser"];

            if (!IsPostBack)
            {

                if (user == null)
                    Response.Redirect("/Default.aspx");
                else
                {

                    #region for You can use only 30 days as Unpaid User

                    if (user.PaymentStatus.ToLower() == "unpaid")
                    {
                        if (!SBUtils.IsUserWorkingDaysValid(user.CreateDate))
                        {
                            //cmposecontainer.Attributes.Add("display", "none");
                            cmposecontainer.Attributes.CssStyle.Add("display", "none");
                            topbtn.Attributes.CssStyle.Add("display", "none");
                        }
                    }
                    #endregion

                    //List<Package> lstPackage = new List<Package>();
                    //PackageRepository packageRepo = new PackageRepository();
                    //lstPackage = packageRepo.getAllPackage();

                    //chkdate = user.CreateDate;
                    //DateTime curDate = DateTime.Now;
                    //TimeSpan ts = curDate - chkdate;
                    //datediff = ts.TotalDays;
                    //if (datediff > 30)
                    //{
                    //    Response.Redirect("Settings/Billing.aspx");
                    //}

                    //UserPackageRelation obj = new UserPackageRelation();
                    //obj.Id = new Guid();
                    //obj.UserId = user.Id;
                    //obj.PackageId = lstPackage[1].Id;
                    //obj.PackageStatus = true;
                    //repo.AddUserPackageRelation(obj);

                    //This Code is used for showing user current package
                    UserPackageRelationRepository repoUserPackageRelationRepository = new UserPackageRelationRepository();
                    List<UserPackageRelation> lstUserPackageRelationRepository = new List<UserPackageRelation>();
                    PackageRepository objPackageRepository = new PackageRepository();
                    Package objPackage = new Package();

                    lstUserPackageRelationRepository = repoUserPackageRelationRepository.getUserPackageRelationByUserId(user);

                    if (lstUserPackageRelationRepository.Count > 0)
                    {
                        objPackage = objPackageRepository.getPackageDetailsbyId(lstUserPackageRelationRepository[0].PackageId);
                    }

                    //if (user.PaymentStatus == "unpaid")
                    //{
                    //    daysremaining.InnerHtml = "free " + objPackage.PackageName + " " + datediff + " Days Remaining";
                    //}
                    //else if (user.PaymentStatus == "paid")
                    //{
                    //    daysremaining.InnerHtml = objPackage.PackageName + " Last" + datediff + " Days";
                    //}

                    //End This Code is used for showing user current package

                    try
                    {
                        //if (Session["IncomingTasks"] != null)
                        //{
                        //    incom_tasks.InnerHtml = Convert.ToString((int)Session["IncomingTasks"]);
                        //    incomTasks.InnerHtml = Convert.ToString((int)Session["IncomingTasks"]);
                        //}
                        //else
                        //{
                        //    TaskRepository taskRepo = new TaskRepository();
                        //    ArrayList alst = taskRepo.getAllIncompleteTasksOfUser(user.Id);
                        //    Session["IncomingTasks"] = alst.Count;
                        //}

                        TaskRepository taskRepo = new TaskRepository();
                        ArrayList alst = taskRepo.getAllIncompleteTasksOfUser(user.Id);
                        Session["IncomingTasks"] = alst.Count;
                        incom_tasks.InnerHtml = Convert.ToString((int)Session["IncomingTasks"]);
                        incomTasks.InnerHtml = Convert.ToString((int)Session["IncomingTasks"]);

                    }
                    catch (Exception es)
                    {
                        logger.Error(es.Message);
                        Console.WriteLine(es.Message);
                    }
                    try
                    {
                        if (Session["CountMessages"] != null)
                        {
                            incom_messages.InnerHtml = Convert.ToString((int)Session["CountMessages"]);
                            incomMessages.InnerHtml = Convert.ToString((int)Session["CountMessages"]);
                        }
                        else
                        {
                            incom_messages.InnerHtml = "0";
                            incomMessages.InnerHtml = "0";
                        }
                    }
                    catch (Exception sx)
                    {
                        logger.Error(sx.Message);
                        Console.WriteLine(sx.Message);
                    }

                    usernm.InnerHtml = "Hello, <a href=\"../Settings/PersonalSettings.aspx\"> " + user.UserName + "</a> ";
                    if (!string.IsNullOrEmpty(user.ProfileUrl))
                    {
                        //Datetime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToLongDateString() + " " + TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToShortTimeString() + " (" + user.TimeZone + ")";
                        userimg.InnerHtml = "<a href=\"../Settings/PersonalSettings.aspx\"><img id=\"loggeduserimg\" src=\"" + user.ProfileUrl + "\" alt=\"" + user.UserName + "\" height=\"100\" width=\"100\"/></a></a>";
                        //userinf.InnerHtml = Datetime;
                        //{
                        //    userimg.InnerHtml = "<a href=\"../Settings/PersonalSettings.aspx\"><img id=\"loggeduserimg\" src=\"" + user.ProfileUrl + "\" alt=\"" + user.UserName + "\" height=\"100\" width=\"100\"/></a></a>";
                        if (user.TimeZone != null)
                        {
                            Datetime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToLongDateString() + " " + TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToShortTimeString() + " (" + user.TimeZone + ")";
                            userinf.InnerHtml = Datetime;
                        }
                        //if (user.TimeZone == null)
                        //{
                        //    Datetime = DateTime.Now.ToString();
                        //    userinf.InnerHtml = Datetime;
                        //}
                        else
                        {
                            Datetime = DateTime.Now.ToString();
                            userinf.InnerHtml = Datetime;
                        }
                    }
                    else
                    {
                        //Datetime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToLongDateString() + " " + TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToShortTimeString() + " (" + user.TimeZone + ")";
                        userimg.InnerHtml = "<a href=\"../Settings/PersonalSettings.aspx\"><img id=\"loggeduserimg\" src=\"../Contents/img/blank_img.png\" alt=\"" + user.UserName + "\"/></a>";

                        //userinf.InnerHtml = Datetime;
                        if (user.TimeZone != null)
                        {
                            Datetime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToLongDateString() + " " + TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, user.TimeZone).ToShortTimeString() + " (" + user.TimeZone + ")";
                            userinf.InnerHtml = Datetime;
                        }
                        if (user.TimeZone == null)
                        {
                            Datetime = DateTime.Now.ToString();
                            userinf.InnerHtml = Datetime;
                        }
                    }

                    try
                    {

                        GroupRepository grouprepo = new GroupRepository();
                        List<Groups> lstgroups = grouprepo.getAllGroups(user.Id);
                        string totgroups = string.Empty;
                        if (lstgroups.Count != 0)
                        {
                            foreach (Groups item in lstgroups)
                            {
                                totgroups += "<li><a href=\"../Settings/InviteMember.aspx?q=" + item.Id + "\" id=\"group_" + item.Id + "\"><img src=\"../Contents/img/groups_.png\"  alt=\"\"  style=\" margin-right:5px;\"/>" + item.GroupName + "</a></li>";
                            }
                            inviteRedirect.InnerHtml = totgroups;
                        }
                        if (user.AccountType == "SMALL BUSINESS")
                            tot_acc = 10;
                        else if (user.AccountType == "CORPORATION")
                            tot_acc = 20;
                        else if (user.AccountType == "INDIVIDUAL")
                            tot_acc = 50;
                        profileCount = objSocioRepo.getAllSocialProfilesOfUser(user.Id).Count;

                    }
                    catch (Exception ex)
                    {
                        logger.Error(ex.Message);
                        Console.WriteLine(ex.Message);
                    }
                }
            }
        }
Example #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    if (Session["LoggedUser"] == null)
                    {
                        Response.Redirect("/Default.aspx");
                        return;
                    }

                    SocioBoard.Domain.User user = (User)Session["LoggedUser"];
                    SocialProfilesRepository objSocioRepo = new SocialProfilesRepository();
                    profileName.InnerHtml = user.UserName;
                    if(user.ProfileUrl!=null)
                        profileImg.Src= user.ProfileUrl;
                    else
                        profileImg.Src="~/Contents/img/blank_user.png";
                    try
                    {
                        if (Session["IncomingTasks"] != null)
                        {
                            incom_tasks.InnerHtml = "You have " + Convert.ToString((int)Session["IncomingTasks"]) + " Tasks";
                           // incom_tasks.InnerHtml = Convert.ToString((int)Session["IncomingTasks"]);
                        }
                        else
                        {
                            TaskRepository taskRepo = new TaskRepository();
                            ArrayList alst = taskRepo.getAllIncompleteTasksOfUser(user.Id);
                            incom_tasks.InnerHtml = "You have " + alst.Count + " Tasks";
                            Session["IncomingTasks"] = alst.Count;
                        }
                    }
                    catch (Exception es)
                    {
                        logger.Error(es.Message);
                        Console.WriteLine(es.Message);
                    }
                    try
                    {
                        if (Session["CountMessages"] != null)
                        {
                            incom_messages.InnerHtml = "You have " +  Convert.ToString((int)Session["CountMessages"]) + " Messages";
                            //incomMessages.InnerHtml = Convert.ToString((int)Session["CountMessages"]);
                        }
                        else
                        {
                            incom_messages.InnerHtml = "You have 0 Messages";
                           // incomMessages.InnerHtml = "0";
                        }
                    }
                    catch (Exception sx)
                    {
                        logger.Error(sx.Message);
                        Console.WriteLine(sx.Message);
                    }

                    #region Add Fan Page
                    try
                    {
                        if (Session["fbSocial"] != null)
                        {
                            if (Session["fbSocial"] == "p")
                            {
                                FacebookAccount objFacebookAccount = (FacebookAccount)Session["fbpagedetail"];

                                //    string strpageUrl = "https://graph.facebook.com/" + objFacebookAccount.FacebookId + "/accounts";
                                // objFacebookUrlBuilder = (FacebookUrlBuilder)Session["FacebookInsightUser"];
                                //    string strData = objAuthentication.RequestUrl(strpageUrl, objFacebookAccount.Token);
                                //    JObject output = objWebRequest.FacebookRequest(strData, "Get");
                                FacebookClient fb = new FacebookClient();
                                fb.AccessToken = objFacebookAccount.AccessToken;
                                dynamic output = fb.Get("/me/accounts");
                                //  JArray data = (JArray)output["data"];
                                DataTable dtFbPage = new DataTable();
                                dtFbPage.Columns.Add("Email");
                                dtFbPage.Columns.Add("PageId");
                                dtFbPage.Columns.Add("PageName");
                                dtFbPage.Columns.Add("status");
                                dtFbPage.Columns.Add("customer_id");
                                string strPageDiv = string.Empty;
                                if (output != null)
                                {
                                    foreach (var item in output["data"])
                                    {
                                        if (item.category.ToString() != "Application")
                                        {
                                            strPageDiv += "<div><a id=\"A1\"  onclick=\"getInsights('" + item["id"].ToString() + "','" + item["name"].ToString() + "')\"><span>" + item["name"].ToString() + "</span> </a></div>";
                                            fbpage.InnerHtml = strPageDiv;
                                        }
                                    }
                                }
                                else
                                {
                                    strPageDiv += "<div>No Pages Found</div>";
                                }
                                Page.ClientScript.RegisterStartupScript(Page.GetType(), "my", " ShowDialogHome(false);", true);
                                Session["fbSocial"] = null;
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                        logger.Error(ex.StackTrace);
                    }
                    #endregion
                    #region Count Used Accounts
                    try
                    {
                        if (user.AccountType.ToString().ToLower() == AccountType.Deluxe.ToString().ToLower())
                            tot_acc = 20;
                        else if (user.AccountType.ToString().ToLower() == AccountType.Standard.ToString().ToLower())
                            tot_acc = 10;
                        else if (user.AccountType.ToString().ToLower() == AccountType.Premium.ToString().ToLower())
                            tot_acc = 50;
                        profileCount = objSocioRepo.getAllSocialProfilesOfUser(user.Id).Count;
                        Session["ProfileCount"] = profileCount;
                        Session["TotalAccount"] = tot_acc;
                        usedAccount.InnerHtml = " using " + profileCount + " of " + tot_acc;
                    }
                    catch (Exception ex)
                    {
                        logger.Error(ex.StackTrace);
                    }
                    #endregion
                }
                catch (Exception ex)
                {
                }
            }
        }