示例#1
0
        public void CreateNewTask(string description, string userid, Tasks task, string assigntoId, string comment)
        {
            string descritption = description;
            Guid idtoassign = Guid.Empty;
            idtoassign = Guid.Parse(assigntoId);

            Tasks objTask = new Tasks();
            TaskRepository objTaskRepo = new TaskRepository();
            objTask.AssignDate = DateTime.Now.ToString("yyyy-MM-dd H:mm:ss").ToString();
            objTask.AssignTaskTo = idtoassign;
            objTask.TaskStatus = false;
            objTask.TaskMessage = descritption;
            objTask.UserId = Guid.Parse(userid);
            Guid taskid = Guid.NewGuid();
            objTask.Id = taskid;
            objTaskRepo.addTask(objTask);

            /////////////////
            string Comment = comment;
            if (!string.IsNullOrEmpty(comment))
            {
                string curdate = DateTime.Now.ToString("yyyy-MM-dd H:mm:ss").ToString();
                TaskComment objcmt = new TaskComment();
                TaskCommentRepository objcmtRepo = new TaskCommentRepository();
                objcmt.Comment = comment;
                objcmt.CommentDate = DateTime.Now;
                objcmt.EntryDate = DateTime.Now;
                objcmt.Id = Guid.NewGuid();
                objcmt.TaskId = objTask.Id;
                objcmt.UserId = Guid.Parse(userid);
                objcmtRepo.addTaskComment(objcmt);
            }
        }
示例#2
0
        public void getTaskDetail(int days)
        {
            try
            {
                User user = (User)Session["LoggedUser"];
                TaskRepository objTaskRepo = new TaskRepository();
                List<object> destination = new List<object>();
                ArrayList lstTask = objTaskRepo.getTasksByUserwithDetail(user.Id, days);
                string strTask = "<div class=\"task-labels\"><div class=\"task-labe-1\">TASK OWNER</div><div class=\"task-labe-2\">ASSIGNED</div>"+
                                 "<div class=\"task-labe-3\">TASK MESSAGE</div><div class=\"task-labe-4\">ASSIGN DATE</div><div class=\"task-labe-5\">COMPLETION DATE</div>"+
                                 "<div class=\"task-labe-6\">STATUS</div><div class=\"clear\"></div></div>";
                foreach (var item in lstTask)
                {
                    Array temp = (Array)item;
                    string taskStatus = string.Empty;
                    string completeDate = string.Empty;
                    if (temp.GetValue(4).Equals(false))
                    {
                        taskStatus = "Incomplete";
                    }
                    else
                    {
                        taskStatus = "Completed";
                        completeDate = temp.GetValue(6).ToString();
                    }
                    strTask = strTask + "<div class=\"task-header\"><div class=\"task-header-owner\"><div class=\"avathar-pub\"><img src=\"" + temp.GetValue(10) + "\" alt=\"\" /></div>" +
                                    "<div class=\"task-header-owner-name\">" + user.UserName + "</div><div class=\"clear\"></div></div><div class=\"assigned-lable\">" + temp.GetValue(8) + "</div><div class=\"assigned-lable\">" + temp.GetValue(1) + "</div><div class=\"task-text-3\">" + temp.GetValue(5) + "</div>" +
                                    "<div class=\"task-text-4\">" + completeDate + "</div><div class=\"task-text-5\">" + taskStatus + "</div><div class=\"clear\"></div></div>";

                    temp.GetValue(0);
                }
                taskCount = lstTask.Count;
                taskdiv.InnerHtml = strTask;
                divName.InnerHtml = user.UserName;

            }
            catch (Exception err)
            {
                Console.Write(err.StackTrace);
            }
        }
示例#3
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);
                    }
                }
            }
        }
示例#4
0
 protected void btn_Click(object sender, EventArgs e)
 {
     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);
     bindTeamTask();
 }
示例#5
0
        void ProcessRequest()
        {
            User user = (User)Session["LoggedUser"];
            if (Request.QueryString["op"] != null)
            {
                if (Request.QueryString["op"] == "bindMessages")
                {
                    DataSet ds = null;
                    if (Session["MessageDataTable"] == null)
                    {
                        clsFeedsAndMessages clsfeedsandmess = new clsFeedsAndMessages();
                        ds = clsfeedsandmess.bindMessagesIntoDataTable(user);
                        FacebookFeedRepository fbFeedRepo = new FacebookFeedRepository();
                        Session["MessageDataTable"] = ds;
                    }
                    else
                    {
                        ds = (DataSet)Session["MessageDataTable"];
                    }
                    string message = "There is no message !";
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        message = this.BindData(ds.Tables[0]);
                    }
                    Response.Write(message);

                }
                else if (Request.QueryString["op"] == "inbox_messages")
                {
                    DataSet ds = null;
                    if (Session["InboxMessages"] == null)
                    {
                        clsFeedsAndMessages clsfeedsandmessages = new clsFeedsAndMessages();
                        ds = clsfeedsandmessages.bindSentMessagesToDataTable(user, "");
                        Session["InboxMessages"] = ds;
                    }
                    else
                    {
                        ds = (DataSet)Session["InboxMessages"];
                    }

                    string message = "There is no message !";
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        message = this.BindData(ds.Tables[0]);
                    }
                    Response.Write(message);

                }
                else if (Request.QueryString["op"] == "bindProfiles")
                {

                    string profiles = string.Empty;
                    int i = 0;
                    profiles += "<ul class=\"options_list\">";

                    /*Binding facebook profiles in Accordian*/
                    FacebookAccountRepository facerepo = new FacebookAccountRepository();
                    ArrayList alstfacebookprofiles = facerepo.getOnlyFacebookAccountsOfUser(user.Id);
                    foreach (FacebookAccount item in alstfacebookprofiles)
                    {
                        try
                        {
                            profiles += "<ul><li><a id=\"checkimg_" + i + "\" href=\"#\" onclick=\"checkprofile('" + item.FbUserId + "','message','facebook');\"><img src=\"../Contents/img/admin/fbicon.png\"  width=\"15\" height=\"15\" alt=\"\" >" + item.FbUserName + "</a></li>";
                            i++;
                        }
                        catch (Exception ex)
                        {
                            logger.Error(ex.Message);
                            Console.WriteLine(ex.Message);
                        }

                    }

                    /*Binding TwitterProfiles in Accordian*/
                    TwitterAccountRepository twtaccountrepo = new TwitterAccountRepository();
                    ArrayList alsttwt = twtaccountrepo.getAllTwitterAccountsOfUser(user.Id);
                    foreach (TwitterAccount item in alsttwt)
                    {
                        try
                        {
                            profiles += "<ul><li><a href=\"#\" id=\"checkimg_" + i + "\" onclick=\"checkprofile('" + item.TwitterUserId + "','message','twitter');\"><img src=\"../Contents/img/admin/twittericon.png\"  width=\"15\" height=\"15\" alt=\"\" >" + item.TwitterScreenName + "</a></li>";
                            i++;
                        }
                        catch (Exception ex)
                        {
                            logger.Error(ex.Message);
                            Console.WriteLine(ex.Message);
                        }
                    }

                    GooglePlusAccountRepository gpAccRepo = new GooglePlusAccountRepository();
                    ArrayList alstgp = gpAccRepo.getAllGooglePlusAccountsOfUser(user.Id);
                    foreach (GooglePlusAccount item in alstgp)
                    {
                        try
                        {
                            profiles += "<ul><li><a href=\"#\" id=\"checkimg_" + i + "\" onclick=\"checkprofile('" + item.GpUserId + "','message','googleplus');\"><img src=\"../Contents/img/google_plus.png\"  width=\"15\" height=\"15\" alt=\"\" >" + item.GpUserName + "</a></li>";
                            i++;
                        }
                        catch (Exception esx)
                        {
                            logger.Error(esx.Message);
                            Console.WriteLine(esx.Message);
                        }
                    }
                    profiles += "</ul><input type=\"hidden\" id=\"profilecounter\" value=\"" + i + "\">";
                    Response.Write(profiles);
                }
                else if (Request.QueryString["op"] == "changeTaskStatus")
                {
                    Guid taskid = Guid.Parse(Request.QueryString["taskid"]);
                    bool status = bool.Parse(Request.QueryString["status"]);

                    if (status == true)
                        status = false;
                    else
                        status = true;
                    TaskRepository objTaskRepo = new TaskRepository();
                    objTaskRepo.updateTaskStatus(taskid, user.Id, status);

                }
                else if (Request.QueryString["op"] == "savetask")
                {
                    string descritption = Request.QueryString["description"];
                    Guid idtoassign = Guid.Empty;
                    try
                    {
                        if (Request.QueryString["memberid"] != string.Empty)
                        {
                            idtoassign = Guid.Parse(Request.QueryString["memberid"].ToString());
                        }
                    }
                    catch (Exception ex)
                    {
                        logger.Error(ex.Message);
                        // idtoassign = 0;
                    }
                    Tasks objTask = new Tasks();
                    TaskRepository objTaskRepo = new TaskRepository();
                    objTask.AssignDate = DateTime.Now.ToString("yyyy-MM-dd H:mm:ss").ToString();
                    objTask.AssignTaskTo = idtoassign;
                    objTask.TaskStatus = false;
                    objTask.TaskMessage = descritption;
                    objTask.UserId = user.Id;
                    Guid taskid = Guid.NewGuid();
                    objTask.Id = taskid;
                    objTaskRepo.addTask(objTask);

                    /////////////////
                    string comment = Request.QueryString["comment"];
                    if (!string.IsNullOrEmpty(comment))
                    {
                        string curdate = DateTime.Now.ToString("yyyy-MM-dd H:mm:ss").ToString();
                        TaskComment objcmt = new TaskComment();
                        TaskCommentRepository objcmtRepo = new TaskCommentRepository();
                        objcmt.Comment = comment;
                        objcmt.CommentDate = DateTime.Now;
                        objcmt.EntryDate = DateTime.Now;
                        objcmt.Id = Guid.NewGuid();
                        objcmt.TaskId = objTask.Id;
                        objcmt.UserId = user.Id;
                        objcmtRepo.addTaskComment(objcmt);
                    }

                }
                else if (Request.QueryString["op"] == "bindteam")
                {
                    TeamRepository objTeam = new TeamRepository();
                    string message = string.Empty;
                    message += "<ul>";
                    IEnumerable<dynamic> result = objTeam.getAllTeamsOfUser(user.Id);

                    if (result != null)
                    {
                        foreach (Team item in result)
                        {

                            message += "<li><a>";
                            message += "<img src=\"../Contents/img/blank_img.png\" alt=\"\" />";
                            message += "<span class=\"name\">" +
                                                     item.FirstName + " " + item.LastName +
                                                 "</span>" +
                                              " <span>" +
                                              "<input id=\"customerid_" + item.Id + "\" type=\"radio\" name=\"team_members\" value=\"customerid_" + item.Id + "\">" +
                                              "</span>" +
                                             "</a></li>";
                        }

                        message += "<li><a>";
                        if (string.IsNullOrEmpty(user.ProfileUrl))
                        {

                            message += "<img src=\"../Contents/img/blank_img.png\" alt=\"\" />";
                        }
                        else
                        {
                            message += "<img src=\"" + user.ProfileUrl + "\" alt=\"\" />";
                        }

                        message += "<span class=\"name\">" +
                                 user.UserName +
                              "</span>" +
                           " <span>" +
                           "<input id=\"customerid_" + user.Id + "\" type=\"radio\" name=\"team_members\" value=\"customerid_" + user.Id + "\">" +
                           "</span></a></li>";

                    }
                    else
                    {
                        message += "<li><a>";

                        if (string.IsNullOrEmpty(user.ProfileUrl))
                        {

                            message += "<img src=\"../Contents/img/blank_img.png\" alt=\"\" />";
                        }
                        else
                        {
                            message += "<img src=\"" + user.ProfileUrl + "\" alt=\"\" />";
                        }

                        message += "<span class=\"name\">" +
                                            user.UserName +
                                         "</span>" +
                                      " <span>" +
                                      "<input id=\"customerid_" + user.Id + "\" type=\"radio\" name=\"team_members\" value=\"customerid_" + user.Id + "\">" +
                                      "</span>" +
                                     "</a></li>";

                    }
                    message += "</ul>";
                    Response.Write(message);
                }
                else if (Request.QueryString["op"] == "bindarchive")
                {
                    ArchiveMessageRepository objArchiveRepo = new ArchiveMessageRepository();

                    string message = string.Empty;
                    message += "<ul  id=\"message-list\">";
                    List<ArchiveMessage> result = objArchiveRepo.getAllArchiveMessage(user.Id);
                    int sorteddatacount = 0;
                    if (result != null)
                    {
                        foreach (ArchiveMessage item in result)
                        {
                            message += "<li>";
                            sorteddatacount++;
                            if (item.SocialGroup == "twitter")
                            {
                                message += "<div id=\"messagetaskable_" + sorteddatacount + "\" class=\"userpictiny\"><div style=\"width:60px;height:auto;float:left\"><img id=\"formprofileurl_" + sorteddatacount + "\" onclick=\"detailsprofile(this.alt);\" src=\"" + item.ImgUrl + "\" height=\"48\" width=\"48\" alt=\"\" title=\"\" />" +
                                             "<a href=\"#\" class=\"userurlpic\" title=\"\"><img src=\"../Contents/img/twticon.png\" width=\"16\" height=\"16\" alt=\"\"></a></div>" +
                                             "</div><div id=\"messagedescription_" + sorteddatacount + "\" class=\"message-list-content\"><div  id=\"msgdescription_" + sorteddatacount + "\" style=\"width:500px;height:auto;float:left\"><p>" + item.Message + "</p>" +
                                                 "<div class=\"message-list-info\"><span><a href=\"#\" id=\"rowname_" + sorteddatacount + "\" onclick=\"detailsprofile(" + item.ProfileId + ");\">" + item.ProfileId + "</a> " + item.CreatedDateTime + "</span>" +
                                                 "<div class=\"scl\">" +
                                                 "<a id=\"createtasktwt_" + sorteddatacount + "\" href=\"#\" onclick=\"createtask(this.id);\"><img src= title=\"Task\" \"../Contents/img/pin.png\" alt=\"\" width=\"14\" height=\"17\" border=\"none\"></a><a href=\"#\"><img title=\"comment\" src=\"../Contents/img/admin/goto.png\" width=\"12\" height=\"12\" alt=\"\"/></a></div></div></div></div></li>";
                            }
                            else if (item.SocialGroup == "facebook")
                            {
                                message += "<div id=\"messagetaskable_" + sorteddatacount + "\" class=\"userpictiny\"><div style=\"width:60px;height:auto;float:left\"><img id=\"formprofileurl_" + sorteddatacount + "\" onclick=\"detailsprofile(this.alt);\" src=\"" + item.ImgUrl + "\" height=\"48\" width=\"48\" alt=\"\" title=\"\" />" +
                                            "<a href=\"#\" class=\"userurlpic\" title=\"\"><img src=\"../Contents/img/fb_icon.png\" width=\"16\" height=\"16\" alt=\"\"></a></div>" +
                                            "</div><div id=\"messagedescription_" + sorteddatacount + "\" class=\"message-list-content\"><div  id=\"msgdescription_" + sorteddatacount + "\" style=\"width:500px;height:auto;float:left\"><p>" + item.Message + "</p>" +
                                                "<div class=\"message-list-info\"><span><a href=\"#\" id=\"rowname_" + sorteddatacount + "\" onclick=\"getFacebookProfiles(" + item.ProfileId + ");\">" + item.ProfileId + "</a> " + item.CreatedDateTime + "</span>" +
                                                "<div class=\"scl\">" +
                                                "<a id=\"createtasktwt_" + sorteddatacount + "\" href=\"#\" onclick=\"createtask(this.id);\"><img title=\"Task\" src=\"../Contents/img/pin.png\" alt=\"\" width=\"14\" height=\"17\" border=\"none\"></a><a href=\"#\"><img title=\"comment\" src=\"../Contents/img/admin/goto.png\" width=\"12\" height=\"12\" alt=\"\"/></a></div></div></div></div></li>";

                            }
                            else if (item.SocialGroup == "googleplus")
                            {
                                message += "<div id=\"messagetaskable_" + sorteddatacount + "\" class=\"userpictiny\"><div style=\"width:60px;height:auto;float:left\"><img id=\"formprofileurl_" + sorteddatacount + "\" onclick=\"detailsprofile(this.alt);\" src=\"" + item.ImgUrl + "\" height=\"48\" width=\"48\" alt=\"\" title=\"\" />" +
                                            "<a href=\"#\" class=\"userurlpic\" title=\"\"><img src=\"../Contents/img/google_plus.png\" width=\"16\" height=\"16\" alt=\"\"></a></div>" +
                                            "</div><div id=\"messagedescription_" + sorteddatacount + "\" class=\"message-list-content\"><div  id=\"msgdescription_" + sorteddatacount + "\" style=\"width:500px;height:auto;float:left\"><p>" + item.Message + "</p>" +
                                                "<div class=\"message-list-info\"><span><a href=\"#\" id=\"rowname_" + sorteddatacount + "\" onclick=\"detailsprofile(" + item.ProfileId + ");\">" + item.ProfileId + "</a> " + item.CreatedDateTime + "</span>" +
                                                "<div class=\"scl\">" +
                                                "<a id=\"createtasktwt_" + sorteddatacount + "\" href=\"#\" onclick=\"createtask(this.id);\"><img title=\"Task\" src=\"../Contents/img/pin.png\" alt=\"\" width=\"14\" height=\"17\" border=\"none\"></a></div></div></div></div></li>";

                            }
                            message += "</li>";
                        }

                    }
                    message += "</ul>";
                    Response.Write(message);
                }
                else if (Request.QueryString["op"] == "savearchivemsg")
                {
                    User use = (User)Session["LoggedUser"];
                    ArchiveMessage am = new ArchiveMessage();
                    ArchiveMessageRepository objArchiveRepo = new ArchiveMessageRepository();
                    am.UserId = user.Id;
                    am.ImgUrl = Request.QueryString["imgurl"];
                    //am.user_name = Request.QueryString["UserName"];
                    //am.msg = Request.QueryString["Msg"];
                    ////am.sociel_group = Request.QueryString["Network"];
                    //am.createdtime = Request.QueryString["CreatedTime"];

                    System.IO.StreamReader sr = new System.IO.StreamReader(Request.InputStream);
                    string line = "";
                    line = sr.ReadToEnd();
                    // JObject jo = JObject.Parse("[" + line + "]");
                    // am.UserName = Request.QueryString["UserName"];//Server.UrlDecode((string)jo["UserName"]);
                    //am.Message = Request.QueryString["Msg"];//Server.UrlDecode((string)jo["Msg"]);
                    JObject jo = JObject.Parse(line);
                    am.Message = Server.UrlDecode((string)jo["Msg"]); ;//Server.UrlDecode((string)jo["Msg"]);
                    am.SocialGroup = Request.QueryString["Network"];// Server.UrlDecode((string)jo["Network"]);
                    am.CreatedDateTime = Request.QueryString["CreatedTime"];
                    am.MessageId = Request.QueryString["MessageId"];
                    am.ProfileId = Request.QueryString["ProfileId"];
                    am.UserId = use.Id;

                    // Server.UrlDecode((string)jo["CreatedTime"]);

                    if (am.UserName != string.Empty)
                    {
                        if (!objArchiveRepo.checkArchiveMessageExists(user.Id, am.MessageId))
                        {
                            objArchiveRepo.AddArchiveMessage(am);
                        }
                    }
                }
                else if (Request.QueryString["op"] == "createfacebookcomments")
                {
                    FacebookAccountRepository facerepo = new FacebookAccountRepository();
                    string postid = Request.QueryString["replyid"];
                    string message = Request.QueryString["replytext"];
                    string userid = Request.QueryString["userid"];
                    FacebookAccount result = facerepo.getFacebookAccountDetailsById(userid, user.Id);

                    FacebookClient fc = new FacebookClient(result.AccessToken);
                    Dictionary<string, object> parameters = new Dictionary<string, object>();
                    parameters.Add("message", message);
                    JsonObject dyn = (JsonObject)fc.Post("/" + postid+ "/comments", parameters);

                }
                else if (Request.QueryString["op"] == "getFacebookComments")
                {
                    FacebookAccountRepository facerepo = new FacebookAccountRepository();
                    string postid = Request.QueryString["postid"];
                    string userid = Request.QueryString["userid"];
                    FacebookAccount result = facerepo.getFacebookAccountDetailsById(userid, user.Id);

                    FacebookClient fc = new FacebookClient(result.AccessToken);
                    JsonObject dyn = (JsonObject)fc.Get("/" + postid + "/comments");
                    string mess = string.Empty;
                    dynamic jc = dyn["data"];
                    int iii = 0;
                    foreach (dynamic item in jc)
                    {
                        mess += "<div class=\"messages\"><section><aside><section class=\"js-avatar_tip\" data-sstip_class=\"twt_avatar_tip\">" +
                                "<a class=\"avatar_link view_profile\">" +
                                "<img width=\"54\" height=\"54\" border=\"0\" id=\"" + item["id"] + "\" class=\"avatar\" src=\"http://graph.facebook.com/" + item["from"]["id"] + "/picture?type=small\"><article class=\"message-type-icon\"></article>" +
                                 "</a></section><ul></ul></aside><article><div class=\"\"><a class=\"language\" href=\"\"></a></div>" +
                                 "<div class=\"message_actions\"><a class=\"gear_small\" href=\"#\"><span title=\"Options\" class=\"ficon\">?</span></a></div><div id=\"messagedescription_" + iii + "\" class=\"message-text font-14\">" + item["message"] + "</div><section class=\"bubble-meta\"><article class=\"threefourth text-overflow\"><section class=\"floatleft\"><a class=\"js-avatar_tip view_profile profile_link\" data-sstip_class=\"twt_avatar_tip\"><span id=\"rowname_" + iii + "\">" + item["from"]["name"] + "</span></a>&nbsp;<a data-msg-time=\"1363926699000\" class=\"time\" target=\"_blank\" title=\"View message on Twitter\">" + item["created_time"] + "</a><span class=\"location\">&nbsp;</span></section></article><ul class=\"message-buttons quarter clearfix\"></ul></section></article></section></div>";
                    }
                    Response.Write(mess);

                }
                else if (Request.QueryString["op"] == "twittercomments")
                {

                    Tweet objTwitterMethod = new Tweet();
                    TwitterAccountRepository objTwtAccRepo = new TwitterAccountRepository();
                    try
                    {
                        string messid = Request.QueryString["messid"];
                        string replytext = Request.QueryString["replytext"];
                        string replyid = Request.QueryString["replyid"];
                        string userid = Request.QueryString["userid"];
                        string username = Request.QueryString["username"];
                        string rowid = Request.QueryString["rowid"];
                        TwitterAccount objTwtAcc = objTwtAccRepo.getUserInformation(user.Id, userid);

                        TwitterHelper twthelper = new TwitterHelper();

                        oAuthTwitter OAuthTwt = new oAuthTwitter();
                        OAuthTwt.AccessToken = objTwtAcc.OAuthToken;
                        OAuthTwt.AccessTokenSecret = objTwtAcc.OAuthSecret;
                        OAuthTwt.TwitterScreenName = objTwtAcc.TwitterScreenName;
                        twthelper.SetCofigDetailsForTwitter(OAuthTwt);
                        Tweet twt = new Tweet();
                        JArray post = twt.Post_Statuses_Update(OAuthTwt, replytext);
                    }
                    catch (Exception ex)
                    {
                        logger.Error(ex.Message);
                    }
                }
                else if (Request.QueryString["op"] == "gpProfile")
                {
                    GooglePlusAccountRepository objgpAccRepo = new GooglePlusAccountRepository();
                    GooglePlusAccount objGpAcc = objgpAccRepo.getGooglePlusAccountDetailsById(Request.QueryString["gpid"].ToString(), user.Id);
                    PeopleController obj = new PeopleController();
                    oAuthToken objgpToken = new oAuthToken();
                    JArray objProfile = null;
                    try
                    {
                        string strAccess = objgpToken.GetAccessToken(objGpAcc.RefreshToken);
                        if (!strAccess.StartsWith("["))
                            strAccess = "[" + strAccess + "]";
                        JArray objArray = JArray.Parse(strAccess);
                        foreach (var itemgp in objArray)
                        {
                            objGpAcc.AccessToken = itemgp["access_token"].ToString();
                        }
                        objProfile = obj.GetPeopleProfile(Request.QueryString["gpid"].ToString(), objGpAcc.AccessToken);
                    }
                    catch (Exception Err)
                    {
                        logger.Error(Err.Message);
                        Console.Write(Err.Message.ToString());
                    }
                    string jas = string.Empty;
                      foreach (var item in objProfile)
                    {
                        jas += "<div class=\"modal-small draggable\">";
                        jas += "<div class=\"modal-content\">";
                        jas += "<button type=\"button\" class=\"modal-btn button b-close\">";
                        jas += "<span class=\"icon close-medium\"><span class=\"visuallyhidden\">X</span></span></button>";
                        jas += "<div class=\"modal-header\"><h3 class=\"modal-title\">Profile summary</h3></div>";
                        jas += "<div class=\"modal-body profile-modal\">";
                        jas += "<div class=\"module profile-card component profile-header\">";
                        jas += "<div style=\"background-image: url('https://pbs.twimg.com/profile_banners/215936249/1371721359');\" class=\"profile-header-inner flex-module clearfix\">";
                        jas += "<div class=\"profile-header-inner-overlay\"></div>";
                        jas += "<a href=\"#\" class=\"profile-picture media-thumbnail js-nav\">";
                        string[] imgurl = item["image"]["url"].ToString().Split('?');
                        jas += "<img src=\"" + imgurl[0] + " alt=\"" + item["name"]["givenName"] + "\" class=\"avatar size73\"></a>";
                        jas += "<div class=\"profile-card-inner\">";
                        jas += "<h1 class=\"fullname editable-group\">";
                        jas += "<a class=\"js-nav\" href=\"#\">" + item["name"]["givenName"] + "</a>";
                        jas += "<a href=\"#\" class=\"verified-link js-tooltip\">";
                        jas += "<span class=\"icon verified verified-large-border\">";
                        jas += "<span class=\"visuallyhidden\"></span></span></a></h1>";
                        jas += "<h2 class=\"username\">";
                        jas += "<a class=\"pretty-link js-nav\" href=\"#\">";
                        jas += "<span class=\"screen-name\"><s></s>" + item["displayName"] + "</span></a></h2>";
                        jas += "<div class=\"bio-container editable-group\"><p class=\"bio profile-field\"></p></div>";
                        jas += "<p class=\"location-and-url\">";
                        jas += "<span class=\"location-container editable-group\">";
                        jas += "<span class=\"location profile-field\"></span></span>";
                        jas += "<span class=\"divider hidden\"></span> ";
                        jas += "<span class=\"url editable-group\">  ";
                        jas += "<span class=\"profile-field\">";
                        jas += "<a target=\"_blank\" rel=\"me nofollow\" href=\"" + item["url"] + "\" title=\"#\">" + item["url"] + " </a></span></span></p>";
                        jas += "<div style=\"cursor: pointer; width: 16px; height: 16px; display: inline-block;\">&nbsp;</div><p></p></div></div>";
                        jas += "<div class=\"clearfix\"><div class=\"default-footer\">";
                        jas += "<div class=\"btn-group\"><div class=\"follow_button\"></div></div></div></div>";
                        jas += "<div class=\"profile-social-proof\">";
                        jas += "<div class=\"follow-bar\"></div></div></div>";
                        jas += "<ol class=\"recent-tweets\"><li class=\"\"><div><i class=\"dogear\"></i></div></li></ol>";
                        jas += "<div class=\"go_to_profile\">";
                        jas += "<small><a class=\"view_profile\" target=\"_blank\" href=\""+ item["url"] +"\">Go to full profile →</a></small></div></div>";
                        jas += "<div class=\"loading\"><span class=\"spinner-bigger\"></span></div></div></div>";
                    }
                    Response.Write(jas);
                }
                else if (Request.QueryString["op"] == "updatedstatus")
                {
                    try
                    {
                        TwitterMessageRepository twtmsgRepo = new TwitterMessageRepository();
                        int i = twtmsgRepo.updateMessageStatus(user.Id);
                        FacebookFeedRepository fbfeedRepo = new FacebookFeedRepository();
                        int j = fbfeedRepo.updateMessageStatus(user.Id);

                        if (i > 0 || j > 0)
                        {
                            Session["CountMessages"] = 0;
                            Session["MessageDataTable"] = null;

                            DataSet ds = null;
                            if (Session["MessageDataTable"] == null)
                            {
                                clsFeedsAndMessages clsfeedsandmess = new clsFeedsAndMessages();
                                ds = clsfeedsandmess.bindMessagesIntoDataTable(user);
                                FacebookFeedRepository fbFeedRepo = new FacebookFeedRepository();
                                Session["MessageDataTable"] = ds;
                            }
                            else
                            {
                                ds = (DataSet)Session["MessageDataTable"];
                            }
                        }

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

                    }
                }
            }
        }
示例#6
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);

            }
        }
示例#7
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);
         }
     }
 }
示例#8
0
        public string DeleteAllUsersByCreateDate(string date)
        {
            int i = 0;
            int count = 0;
            UserRepository objUserRepository = new UserRepository();
            List<User> lstuser = objUserRepository.GetAllUsersByCreateDate(date);
            ArchiveMessageRepository objArchiveMessageRepository = new ArchiveMessageRepository();
            DiscoverySearchRepository objDiscoverySearchRepository = new DiscoverySearchRepository();
            DraftsRepository objDraftsRepository = new DraftsRepository();
            FacebookAccountRepository objFacebookAccountRepository = new FacebookAccountRepository();
            FacebookFeedRepository objFacebookFeedRepository = new FacebookFeedRepository();
            FacebookInsightPostStatsRepository objFacebookInsightPostStatsRepository = new FacebookInsightPostStatsRepository();
            FacebookInsightStatsRepository objFacebookInsightStatsRepository = new FacebookInsightStatsRepository();
            FacebookMessageRepository objFacebookMessageRepository = new FacebookMessageRepository();
            FacebookStatsRepository objFacebookStatsRepository = new FacebookStatsRepository();
            GoogleAnalyticsAccountRepository objGoogleAnalyticsAccountRepository = new GoogleAnalyticsAccountRepository();
            GoogleAnalyticsStatsRepository objGoogleAnalyticsStatsRepository = new GoogleAnalyticsStatsRepository();
            GooglePlusAccountRepository objGooglePlusAccountRepository = new GooglePlusAccountRepository();
            GooglePlusActivitiesRepository objGooglePlusActivitiesRepository = new GooglePlusActivitiesRepository();
            GroupProfileRepository objGroupProfileRepository = new GroupProfileRepository();
            GroupRepository objGroupRepository = new GroupRepository();
            InstagramAccountRepository objInstagramAccountRepository = new InstagramAccountRepository();
            InstagramCommentRepository objInstagramCommentRepository = new InstagramCommentRepository();
            InstagramFeedRepository objInstagramFeedRepository = new InstagramFeedRepository();
            LinkedInAccountRepository objLinkedInAccountRepository = new LinkedInAccountRepository();
            LinkedInFeedRepository objLinkedInFeedRepository = new LinkedInFeedRepository();
            LogRepository objLogRepository = new LogRepository();
            RssFeedsRepository objRssFeedsRepository = new RssFeedsRepository();
            RssReaderRepository objRssReaderRepository = new RssReaderRepository();
            ScheduledMessageRepository objScheduledMessageRepository = new ScheduledMessageRepository();
            SocialProfilesRepository objSocialProfilesRepository = new SocialProfilesRepository();
            TaskCommentRepository objTaskCommentRepository = new TaskCommentRepository();
            TaskRepository objTaskRepository = new TaskRepository();
            TeamRepository objTeamRepository = new TeamRepository();
            TeamMemberProfileRepository objTeamMemberProfileRepository = new TeamMemberProfileRepository();
            TwitterAccountRepository objTwitterAccountRepository = new TwitterAccountRepository();
            TwitterDirectMessageRepository objTwitterDirectMessageRepository = new TwitterDirectMessageRepository();
            TwitterFeedRepository objTwitterFeedRepository = new TwitterFeedRepository();
            TwitterMessageRepository objTwitterMessageRepository = new TwitterMessageRepository();
            TwitterStatsRepository objTwitterStatsRepository = new TwitterStatsRepository();
            UserActivationRepository objUserActivationRepository = new UserActivationRepository();
            UserPackageRelationRepository objUserPackageRelationRepository = new UserPackageRelationRepository();






            count = lstuser.Count();


            foreach (var item in lstuser)
            {
                i++;
                try
                {

                    if (item.EmailId == "*****@*****.**" || item.EmailId == "*****@*****.**" || item.EmailId == "*****@*****.**" || item.EmailId == "*****@*****.**" || item.EmailId == "*****@*****.**" || item.EmailId == "*****@*****.**" || item.EmailId == "*****@*****.**" || item.EmailId == "*****@*****.**" || item.EmailId == "*****@*****.**" || item.EmailId == "*****@*****.**")
                    {

                    }
                    else
                    {
                        objArchiveMessageRepository.DeleteArchiveMessageByUserid(item.Id);
                        objDiscoverySearchRepository.DeleteDiscoverySearchByUserid(item.Id);
                        objDraftsRepository.DeleteDraftsByUserid(item.Id);
                        objFacebookAccountRepository.DeleteFacebookAccountByUserid(item.Id);
                        objFacebookFeedRepository.DeleteFacebookFeedByUserid(item.Id);
                        objFacebookInsightPostStatsRepository.DeleteFacebookInsightPostStatsByUserid(item.Id);
                        objFacebookInsightStatsRepository.DeleteFacebookInsightStatsByUserid(item.Id);
                        objFacebookMessageRepository.DeleteFacebookMessageByUserid(item.Id);
                        objFacebookStatsRepository.DeleteFacebookStatsByUserid(item.Id);
                        objGoogleAnalyticsAccountRepository.DeleteGoogleAnalyticsAccountByUserid(item.Id);
                        objGoogleAnalyticsStatsRepository.DeleteGoogleAnalyticsStatsByUserid(item.Id);
                        objGooglePlusAccountRepository.DeleteGooglePlusAccountByUserid(item.Id);
                        objGooglePlusActivitiesRepository.DeleteGooglePlusActivitiesByUserid(item.Id);
                        objGroupProfileRepository.DeleteGroupProfileByUserid(item.Id);
                        objGroupRepository.DeleteGroupsByUserid(item.Id);
                        objInstagramAccountRepository.DeleteInstagramAccountByUserid(item.Id);
                        objInstagramCommentRepository.DeleteInstagramCommentByUserid(item.Id);
                        objInstagramFeedRepository.DeleteInstagramFeedByUserid(item.Id);
                        objLinkedInAccountRepository.DeleteLinkedInAccountByUserid(item.Id);
                        objLinkedInFeedRepository.DeleteLinkedInFeedByUserid(item.Id);
                        objLogRepository.DeleteLogByUserid(item.Id);
                        objRssFeedsRepository.DeleteRssFeedsByUserid(item.Id);
                        objRssReaderRepository.DeleteRssReaderByUserid(item.Id);
                        objScheduledMessageRepository.DeleteScheduledMessageByUserid(item.Id);
                        objSocialProfilesRepository.DeleteSocialProfileByUserid(item.Id);
                        objTaskCommentRepository.DeleteTaskCommentByUserid(item.Id);
                        objTaskRepository.DeleteTasksByUserid(item.Id);
                        objTeamRepository.DeleteTeamByUserid(item.Id);
                        objTeamMemberProfileRepository.DeleteTeamMemberProfileByUserid(item.Id);
                        objTwitterAccountRepository.DeleteTwitterAccountByUserid(item.Id);
                        objTwitterDirectMessageRepository.DeleteTwitterDirectMessagesByUserid(item.Id);
                        objTwitterFeedRepository.DeleteTwitterFeedByUserid(item.Id);
                        objTwitterMessageRepository.DeleteTwitterMessageByUserid(item.Id);
                        objTwitterStatsRepository.DeleteTwitterStatsByUserid(item.Id);
                        objUserActivationRepository.DeleteUserActivationByUserid(item.Id);
                        objUserPackageRelationRepository.DeleteuserPackageRelationByUserid(item.Id);
                        objUserRepository.DeleteUserByUserid(item.Id);
                    }
                }
                catch (Exception ex)
                {

                    Console.WriteLine(ex.Message);
                }
            }
           return i +" "+count;
        }
示例#9
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)
                {
                }
            }
        }
示例#10
0
        public string GetPostGraph()
        {
            string postGraphData = string.Empty;
            try
            {
                //--------Graph Data Format-----------------

                //[
                //   { x: new Date(2001, 0), y: 0 },
                //{ x: new Date(2002, 0), y: 0.001 },
                //{ x: new Date(2003, 0), y: 0.01 },
                //{ x: new Date(2004, 0), y: 0.05 },
                //{ x: new Date(2005, 0), y: 0.1 },
                //{ x: new Date(2006, 0), y: 0.98 },
                //{ x: new Date(2007, 0), y: 0.22 },
                //{ x: new Date(2008, 0), y: 0.38 },
                //{ x: new Date(2009, 0), y: 0.56 },
                //{ x: new Date(2010, 0), y: 0.98 },
                //{ x: new Date(2011, 0), y: 0.91 },
                //{ x: new Date(2012, 0), y: 0.94 }
                //]

                User user = (User)Session["LoggedUser"];

                TaskRepository objTaskRepository = new TaskRepository();

                List<string> lstLastYear=GetLastYears();

                List<int> lstShareCount = objTaskRepository.GetTaskByUserIdAndYear(user.Id);

                string shareGarphArray = string.Empty;

                for (int i = 0; i < 12; i++)
                {
                    try
                    {
                        if (i == 0)
                        {
                            shareGarphArray += "{ x: new Date(" + lstLastYear[i] + ", 0), y: 0." + lstShareCount[i] + " },";
                            continue;
                        }
                        if (i == 1)
                        {
                            shareGarphArray += "{ x: new Date(" + lstLastYear[i] + ", 0), y: 0." + lstShareCount[i] + " },";
                            continue;
                        }
                        if (i == 2)
                        {
                            shareGarphArray += "{ x: new Date(" + lstLastYear[i] + ", 0), y: 0." + lstShareCount[i] + " },";
                            continue;
                        }
                        if (i == 3)
                        {
                            shareGarphArray += "{ x: new Date(" + lstLastYear[i] + ", 0), y: 0." + lstShareCount[i] + " },";
                            continue;
                        }
                        if (i == 4)
                        {
                            shareGarphArray += "{ x: new Date(" + lstLastYear[i] + ", 0), y: 0." + lstShareCount[i] + " },";
                            continue;
                        }
                        if (i == 5)
                        {
                            shareGarphArray += "{ x: new Date(" + lstLastYear[i] + ", 0), y: 0." + lstShareCount[i] + " },";
                            continue;
                        }
                        if (i == 6)
                        {
                            shareGarphArray += "{ x: new Date(" + lstLastYear[i] + ", 0), y: 0." + lstShareCount[i] + " },";
                            continue;
                        }
                        if (i == 7)
                        {
                            shareGarphArray += "{ x: new Date(" + lstLastYear[i] + ", 0), y: 0." + lstShareCount[i] + " },";
                            continue;
                        }
                        if (i == 8)
                        {
                            shareGarphArray += "{ x: new Date(" + lstLastYear[i] + ", 0), y: 0." + lstShareCount[i] + " },";
                            continue;
                        }
                        if (i == 9)
                        {
                            shareGarphArray += "{ x: new Date(" + lstLastYear[i] + ", 0), y: 0." + lstShareCount[i] + " },";
                            continue;
                        }
                        if (i == 10)
                        {
                            shareGarphArray += "{ x: new Date(" + lstLastYear[i] + ", 0), y: 0." + lstShareCount[i] + " },";
                            continue;
                        }
                        if (i == 11)
                        {
                            shareGarphArray += "{ x: new Date(" + lstLastYear[i] + ", 0), y: 0." + lstShareCount[i] + " },";
                            continue;
                        }

                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("Error : " + ex.StackTrace);
                    }
                }

                shareGarphArray = "[" + shareGarphArray.Substring(0, shareGarphArray.Length - 1) + "]";

                postGraphData = shareGarphArray;
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error : " + ex.StackTrace);
            }
            return postGraphData;
        }
示例#11
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);
                    }
                }
            }
        }
示例#12
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);
                    }
                }
            }
        }
示例#13
0
        public string UpdateTasksByUserIdTaskId(string taskMessage, string assignTaskTo, string taskStatus, DateTime assignDate, string taskId, string userId)
        {
            string status = string.Empty;
            try
            {

                TaskRepository taskrepo = new TaskRepository();
                Tasks objTask = new Tasks();

                var Assign_Date = String.Format("{0:yyyy-M-d HH:mm:ss}", assignDate);
                //var Completion_Date = String.Format("{0:yyyy-M-d HH:mm:ss}", DateTime.Now);
                objTask.Id = Guid.Parse(taskId);
                objTask.UserId = Guid.Parse(userId);
                objTask.AssignDate = Convert.ToString(Assign_Date);
                //objTask.CompletionDate = DateTime.Parse(String.Format("{0:yyyy-M-d HH:mm:ss}", DateTime.Now));
                objTask.AssignTaskTo = Guid.Parse(assignTaskTo);
                objTask.TaskMessage = taskMessage;
                objTask.TaskStatus = Convert.ToBoolean(taskStatus);

                taskrepo.updateTask(objTask);

                status = "Success";
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error : " + ex.StackTrace);
            }
            return new JavaScriptSerializer().Serialize(status);
        }
示例#14
0
 public string GetAllTasks(string custid)
 {
     ArrayList taskdata = new ArrayList();
     TaskCommentRepository objTaskCmtRepo = new TaskCommentRepository();
     TaskRepository taskrepo = new TaskRepository();
     taskdata = taskrepo.getAllTasksOfUser(Guid.Parse(custid));
     return new JavaScriptSerializer().Serialize(taskdata);
 }
示例#15
0
        void ProcessRequest()
        {
            User user = (User)Session["LoggedUser"];
            if (Request.QueryString["op"] != null)
            {
                if (Request.QueryString["op"] == "bindMessages")
                {
                     DataSet ds = null;
                    if (Session["MessageDataTable"] == null)
                    {
                        clsFeedsAndMessages clsfeedsandmess = new clsFeedsAndMessages();
                        ds = clsfeedsandmess.bindMessagesIntoDataTable(user);
                        Session["MessageDataTable"] = ds;

                    }
                    else
                    {
                        ds = (DataSet)Session["MessageDataTable"];
                    }
                        string message = this.BindData(ds.Tables[0]);
                    Response.Write(message);

                }
                else if (Request.QueryString["op"] == "bindProfiles")
                {

                    string profiles = string.Empty;
                    int i = 0;
                    profiles += "<ul class=\"options_list\">";

                    /*Binding facebook profiles in Accordian*/
                    FacebookAccountRepository facerepo = new FacebookAccountRepository();
                    ArrayList alstfacebookprofiles = facerepo.getAllFacebookAccountsOfUser(user.Id);
                    foreach (FacebookAccount item in alstfacebookprofiles)
                    {
                        profiles += "<li><a id=\"greencheck_" + i + "\" ><span class=\"network_icon\">" +
                                    "<img src=\"../Contents/Images/fb_icon.png\" width=\"17\" height=\"16\" alt=\"\" /></span>" +
                                 "<span id=\"profileusername_" + i + "\" class=\"user_name\">" + item.FbUserName + "</span><input type=\"hidden\" id=\"fbhidden_" + i + "\" value=\"" + item.FbUserId + "\" /> <span id=\"checkid_" + i + "\" class=\"checkbx_green\">" +
                                     "<img id=\"checkimg_" + i + "\" src=\"../Contents/Images/msg/network_click.png\" width=\"17\" height=\"17\" alt=\"\" onclick=\"checkprofile(this.id,'message','facebook');\" /></span>" +
                             "</a></li> ";
                        i++;
                    }

                    /*Binding TwitterProfiles in Accordian*/
                    TwitterAccountRepository twtaccountrepo = new TwitterAccountRepository();
                    ArrayList alsttwt = twtaccountrepo.getAllTwitterAccountsOfUser(user.Id);
                    foreach (TwitterAccount item in alsttwt)
                    {
                         profiles += "<li><a id=\"greencheck_" + i + "\" ><span class=\"network_icon\">" +
                                      "<img src=\"../Contents/Images/msg/network_twt.png\" width=\"17\" height=\"16\" alt=\"\" /></span>" +
                                   "<span id=\"profileusername_" + i + "\" class=\"user_name\">" + item.TwitterScreenName + "</span> <span id=\"checkid_" + i + "\" class=\"checkbx_green\"><input type=\"hidden\" id=\"twthidden_" + i + "\" value=\"" + item.TwitterUserId+ "\">" +
                                       "<img id=\"checkimg_" + i + "\" src=\"../Contents/Images/msg/network_click.png\" width=\"17\" height=\"17\" alt=\"\"  onclick=\"checkprofile(this.id,'message','twitter');\"/></span>" +
                               "</a></li> ";
                         i++;
                    }

                    profiles += "</ul><input type=\"hidden\" id=\"profilecounter\" value=\"" + i + "\">";
                    Response.Write(profiles);
                }
                else if (Request.QueryString["op"] == "savetask")
                {
                    string descritption = Request.QueryString["description"];
                    Guid idtoassign = Guid.Empty;
                    try
                    {
                        if (Request.QueryString["memberid"] != string.Empty)
                        {
                            idtoassign = Guid.Parse(Request.QueryString["memberid"].ToString());
                        }
                    }
                    catch
                    {
                       // idtoassign = 0;
                    }
                    Tasks objTask = new Tasks();
                    TaskRepository objTaskRepo = new TaskRepository();
                    objTask.AssignDate = DateTime.Now.ToString("yyyy-MM-dd H:mm:ss").ToString();
                    objTask.AssignTaskTo = idtoassign;
                    objTask.TaskStatus = false;
                    objTask.TaskMessage = descritption;
                    objTask.UserId = user.Id;
                    Guid taskid = Guid.NewGuid();
                    objTask.Id = taskid;
                    objTaskRepo.addTask(objTask);

                    /////////////////
                    string comment = Request.QueryString["comment"];
                    if (!string.IsNullOrEmpty(comment))
                    {
                        string curdate = DateTime.Now.ToString("yyyy-MM-dd H:mm:ss").ToString();
                        TaskComment objcmt = new TaskComment();
                        TaskCommentRepository objcmtRepo = new TaskCommentRepository();
                        objcmt.Comment = comment;
                        objcmt.CommentDate = DateTime.Now;
                        objcmt.EntryDate = DateTime.Now;
                        objcmt.Id = Guid.NewGuid();
                        objcmt.TaskId = objTask.Id;
                        objcmt.UserId = user.Id;
                        objcmtRepo.addTaskComment(objcmt);
                    }

                }
                else if (Request.QueryString["op"] == "bindteam")
                {
                    TeamRepository objTeam = new TeamRepository();
                    string message = string.Empty;
                    message += "<ul>";
                    IEnumerable<dynamic> result = objTeam.getAllTeamsOfUser(user.Id);

                    if (result != null)
                    {
                        foreach (Team item in result)
                        {
                            message += "<li><a><img src=\"../Contents/Images/blank_img.png\" alt=\"\" />" +
                                            "<span class=\"name\">" +
                                                item.FirstName + " " + item.LastName+
                                            "</span>" +
                                         " <span>" +
                                         "<input id=\"customerid_" + item.Id + "\" type=\"radio\" name=\"team_members\" value=\"customerid_" + item.Id + "\">" +
                                         "</span>" +
                                        "</a></li>";
                        }
                        message += "<li><a><img src=\"../Contents/Images/blank_img.png\" alt=\"\" />" +
                                        "<span class=\"name\">" +
                                           user.UserName +
                                        "</span>" +
                                     " <span>" +
                                     "<input id=\"customerid_" + user.Id + "\" type=\"radio\" name=\"team_members\" value=\"customerid_" + user.Id + "\">" +
                                     "</span>" +
                                    "</a></li>";

                    }
                    else
                    {
                        message += "<li><a><img src=\"../Contents/Images/blank_img.png\" alt=\"\" />" +
                                         "<span class=\"name\">" +
                                            user.UserName +
                                         "</span>" +
                                      " <span>" +
                                      "<input id=\"customerid_" + user.Id + "\" type=\"radio\" name=\"team_members\" value=\"customerid_" + user.Id + "\">" +
                                      "</span>" +
                                     "</a></li>";

                    }
                    message += "</ul>";
                    Response.Write(message);
                }
            }
        }
示例#16
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);
            }
        }
示例#17
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);
                    }
                }

            }
        }
示例#18
0
        public void getTaskDetail(int days)
        {
            try
            {
                User user = (User)Session["LoggedUser"];
                SocioBoard.Domain.Team team = (SocioBoard.Domain.Team)Session["GroupName"];
                TaskRepository objTaskRepo = new TaskRepository();
                List<object> destination = new List<object>();
                //ArrayList lstTask = objTaskRepo.getTasksByUserwithDetail(user.Id, days);
                ArrayList lstTask = objTaskRepo.getTasksByUserwithDetail(user.Id, days, team.GroupId);
                string strTask = "<div class=\"task-labels\"><div class=\"task-labe-1\">TASK OWNER</div><div class=\"task-labe-2\">ASSIGNED</div>" +
                                 "<div class=\"task-labe-3\">TASK MESSAGE</div><div class=\"task-labe-4\">ASSIGN DATE</div><div class=\"task-labe-5\">COMPLETION DATE</div>" +
                                 "<div class=\"task-labe-6\">STATUS</div><div class=\"clear\"></div></div>";
                foreach (var item in lstTask)
                {
                    Array temp = (Array)item;
                    string taskStatus = string.Empty;
                    string completeDate = string.Empty;
                    if (temp.GetValue(5).Equals(false))
                    {
                        taskStatus = "Incomplete";
                    }
                    else
                    {
                        taskStatus = "Completed";
                        //completeDate = temp.GetValue(6).ToString();
                        //0001-01-01 00:00:00
                    }
                    if (temp.GetValue(7).Equals("0001-01-01 00:00:00"))
                    {
                        completeDate = "Pending";
                    }
                    else
                    {
                        completeDate = temp.GetValue(7).ToString();
                    }
                    UserRepository objusrrepo = new UserRepository();
                    Guid ownid = (Guid)temp.GetValue(3);
                    User taskowner = objusrrepo.getUsersById(ownid);
                    Guid assgnId = (Guid)temp.GetValue(4);
                    User asgntaskto = objusrrepo.getUsersById(assgnId);



                    //strTask = strTask + "<div class=\"task-header\"><div class=\"task-header-owner\"><div class=\"avathar-pub\"><img src=\"" + temp.GetValue(10) + "\" alt=\"\" /></div>" +
                    //                "<div class=\"task-header-owner-name\">" + user.UserName + "</div><div class=\"clear\"></div></div><div class=\"assigned-lable\">" + temp.GetValue(8) + "</div><div class=\"assigned-lable\">" + temp.GetValue(1) + "</div><div class=\"task-text-3\">" + temp.GetValue(5) + "</div>" +
                    //                "<div class=\"task-text-4\">" + completeDate + "</div><div class=\"task-text-5\">" + taskStatus + "</div><div class=\"clear\"></div></div>";

                    strTask = strTask + "<div class=\"task-header\"><div class=\"task-header-owner\"><div class=\"avathar-pub\"><img src=\"" + taskowner.ProfileUrl + "\" alt=\"\" /></div>" +
                                    "<div class=\"task-header-owner-name\">" + taskowner.UserName + "</div><div class=\"clear\"></div></div><div class=\"assigned-lable\">" + asgntaskto.UserName + "</div><div class=\"assigned-lable\">" + temp.GetValue(2) + "</div><div class=\"task-text-3\">" + temp.GetValue(6) + "</div>" +
                                    "<div class=\"task-text-4\">" + completeDate + "</div><div class=\"task-text-5\">" + taskStatus + "</div><div class=\"clear\"></div></div>";

                    temp.GetValue(0);
                }
                taskCount = lstTask.Count;
                taskdiv.InnerHtml = strTask;
                divName.InnerHtml = user.UserName;

            }
            catch (Exception err)
            {
                Console.Write(err.StackTrace);
            }
        }