Ejemplo n.º 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);
            }
        }
Ejemplo n.º 2
0
        public string AddTaskComment(string comment, string userId,string taskId,DateTime commentDate,DateTime entryDate)
        {
            string status = "";
            try
            {

                TaskCommentRepository taskrepo = new TaskCommentRepository();
                TaskComment objTask = new TaskComment();

                objTask.Id = new Guid();
                objTask.UserId = Guid.Parse(userId);
                objTask.Comment = comment;
                objTask.TaskId = Guid.Parse(taskId);
                objTask.CommentDate = commentDate;
                objTask.EntryDate = DateTime.Now;

                taskrepo.addTaskComment(objTask);

                status = "Success";
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error : " + ex.StackTrace);
            }
            return new JavaScriptSerializer().Serialize(status);
        }
Ejemplo n.º 3
0
        protected void bindTeamTask()
        {
            string path = "";
            string strbind = "";
            taskdiv.InnerHtml = "";
            int i = 0;
            int taskid = 0;
            string preaddedcomment = "";
            TaskCommentRepository objTaskCmtRepo = new TaskCommentRepository();
            taskdata = taskrepo.getAllTasksOfUser(custid);
            foreach (Tasks item in taskdata)
            {
                //if (item.pic_url == "")
                //    path = "../Contents/img/blank_img.png";
                //else
                //    path = "../Contents/user_image/" + item.pic_url;

                imgpath = path;
                i++;
                strbind += "<section class=\"section\" id=\"Section" + item.Id + "\"><div class=\"js-task-cont read\">"+
                            "<span id=\"taskcomment\" class=\"ficon task_active\">" +
                                      "<img  onclick=\"getmemberdata('" + item.Id + "');\" src=\"../Contents/img/task_pin.png\" width=\"14\" height=\"17\" alt=\"\" /></span>" +
                            "<section class=\"task-activity third\"><p>Name</p><div>" + item.AssignDate + "</div><input type=\"hidden\" id=\"hdntaskid_" + i + "\" value=" + item.Id + " />" +
                                  "<p>Assigned by Name</p></section>" +
                            "<section class=\"task-owner\">" +
                                   "<img width=\"32\" height=\"32\" border=\"0\" class=\"avatar\" src=" + path + " />" +
                                   "</section><section class=\"task-message font-13 third\"><a class=\"tip_left\">" + item.TaskMessage + "</a>" +
                                  "</section><section class=\"task-status\"><div class=\"ui_light floating task_status_change\"><a class=\"ui-sproutmenu\" href=\"#nogo\">" +
                                     "<b>" + item.TaskStatus + "</b><span class=\"ui-sproutmenu-status\">" +
                                      "<img id=\"img_" + item.Id + "_" + item.TaskStatus + "\" class=\"edit_button\" src=\"../Contents/img/icon_edit.png\" onclick=\"PerformClick(this.id)\" title=\"Edit Status\" />" +
                                      "</span></a></div></section></div>" +
                                      "</section>";

                ArrayList pretask = objTaskCmtRepo.getAllTasksCommentOfUser(item.UserId, item.Id);
                if (pretask != null)
                {
                    preaddedcomment += "<div id=" + item.Id + " style=\"display:none\" >";
                    foreach (TaskComment items in pretask)
                    {
                        preaddedcomment += "<div id=\"task_comment_" + item.Id + "_" + items.Id + "\" class=\"assign_comments\" >" +
                                        "<section><article class=\"task_assign\">" +
                                        "<img src=" + imgpath + " width=\"30\" height=\"30\" alt=\"\"  />  " +
                                            "<article><input id=\"hdncommentsid\" type=\"hidden\" value=" + items.Id + " /><p class=\"msg_article\">" + items.Comment + "</p>" +
                                                "<aside class=\"days_ago\">By " + custname + " at " + items.CommentDate + "</aside>" +
                                            "</article></article></section></div>";
                    }

                    preaddedcomment += "</div>";
                }


            }

            taskdiv.InnerHtml = strbind;
            prevComments.InnerHtml = preaddedcomment;

        }
Ejemplo n.º 4
0
 public void getAvgCount(int days)
 {
     try
     {
         User user = (User)Session["LoggedUser"];
         TaskCommentRepository objTaskCmtRepo = new TaskCommentRepository();
         ArrayList lstcmtTask = objTaskCmtRepo.getAllTasksComent(user.Id, days);
         commentCnt = lstcmtTask.Count;
         tcount = commentCnt / taskCount;
         repliescount.InnerHtml = commentCnt + " REPLIES /" + taskCount + " TOTAL POSTS";
         taskPer = (commentCnt / taskCount) * 100;
     }
     catch (Exception err)
     {
         Console.Write(err.StackTrace);
     }
 }
Ejemplo n.º 5
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtComment.Text))
     {
         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 = "";
     }
 }
Ejemplo n.º 6
0
        protected void rdbtnteamtask_CheckedChanged(object sender, EventArgs e)
        {
            // IEnumerable<dynamic> task = taskrepo.GetAllTaskbyCustId(custid);

            if (chkincomplete.Checked == true)
            {
                chkincomplete.Checked = false;
            }
            if (CheckBox1.Checked == true)
            {
                CheckBox1.Checked = false;
            }
            if (rdbtnmytask.Checked == true)
            {
                rdbtnteamtask.Checked = false;
            }

            string path = "";
            string strbind = "";
            taskdiv.InnerHtml = "";
            int i = 0;
            string preaddedcomment = "";
            TaskCommentRepository objTaskCmtRepo = new TaskCommentRepository();
            TeamRepository objTeam = new TeamRepository();
            taskdata = taskrepo.getAllTasksOfUser(custid);
            foreach (Tasks item in taskdata)
            {
                //if (item.pic_url == "")
                //    path = "../Contents/Images/blank_img.png";
                //else
                //    path = "../Contents/user_image/" + item.pic_url;
                Team team = objTeam.getMemberById(item.AssignTaskTo, item.UserId);
                string strAssignedTo=string.Empty;
                if (team == null)
                {
                    strAssignedTo = custname;
                }
                else
                    strAssignedTo = team.FirstName;
                imgpath = path;
                i++;
                strbind += "<section class=\"section\" id=\"Section" + item.Id + "\"><div class=\"js-task-cont read\"><section class=\"task-owner\">" +
                                   "<img width=\"32\" height=\"32\" border=\"0\" class=\"avatar\" src=" + path + " />" +
                                   "</section><section class=\"task-activity third\"><p>" + strAssignedTo + "</p><div>" + item.AssignDate + "</div><input type=\"hidden\" id=\"hdntaskid_" + i + "\" value=" + item.Id + " />" +
                                  "<p>Assigned by " + custname + "</p></section><section class=\"task-message font-13 third\"><a class=\"tip_left\">" + item.TaskMessage + "</a>" +
                                  "</section><section class=\"task-status\"><span id=\"taskcomment\" class=\"ficon task_active\">" +
                                      "<img  onclick=\"getmemberdata('" + item.Id + "');\" src=\"../Contents/Images/task/task_pin.png\" width=\"14\" height=\"17\" alt=\"\" /></span><div class=\"ui_light floating task_status_change\"><a class=\"ui-sproutmenu\" href=\"#nogo\">" +
                                      "<span class=\"ui-sproutmenu-status\">" + item.TaskStatus +
                                      "<img id=\"img_" + item.Id + "_" + item.TaskStatus + "\" class=\"edit_button\" src=\"../Contents/Images/icon_edit.png\" onclick=\"PerformClick(this.id)\" title=\"Edit Status\" />" +
                                      "</span></a></div></section></div>" +
                                      "</section>";

                ArrayList pretask = objTaskCmtRepo.getAllTasksCommentOfUser(item.UserId, item.Id);
                if (pretask != null)
                {
                    preaddedcomment += "<div id=" + item.Id + " style=\"display:none\" >";
                    foreach (TaskComment items in pretask)
                    {
                        preaddedcomment += "<div id=\"task_comment_" + item.Id + "_" + items.Id + "\" class=\"assign_comments\" >" +
                                        "<section><article class=\"task_assign\">" +
                                        "<img src=" + imgpath + " width=\"30\" height=\"30\" alt=\"\"  />  " +
                                            "<article><input id=\"hdncommentsid\" type=\"hidden\" value=" + items.Id + " /><p class=\"msg_article\">" + items.Comment + "</p>" +
                                                "<aside class=\"days_ago\">Assigned to ANagha  by " + items.CommentDate + "</aside>" +
                                            "</article></article></section></div>";
                    }

                    preaddedcomment += "</div>";
                }

            }

            taskdiv.InnerHtml = strbind;
            prevComments.InnerHtml = preaddedcomment;
        }
Ejemplo n.º 7
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);

                    }
                }
            }
        }
Ejemplo n.º 8
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);
         }
     }
 }
Ejemplo n.º 9
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;
        }
Ejemplo n.º 10
0
        public string GetReplyGraph()
        {
            string replyGraphData = string.Empty;
            try
            {
                //--------Graph Data Format-----------------

                //    [
                //    { x: new Date(2001, 00), y: 0.18 },
                //{ x: new Date(2002, 00), y: 0.2 },
                //{ x: new Date(2003, 0), y: 0.25 },
                //{ x: new Date(2004, 0), y: 0.35 },
                //{ x: new Date(2005, 0), y: 0.42 },
                //{ x: new Date(2006, 0), y: 0.2 },
                //{ x: new Date(2007, 0), y: 0.58 },
                //{ x: new Date(2008, 0), y: 0.67 },
                //{ x: new Date(2009, 0), y: 0.78 },
                //{ x: new Date(2010, 0), y: 0.88 },
                //{ x: new Date(2011, 0), y: 0.98 },
                //{ x: new Date(2012, 0), y: 0.04 },
                //{ x: new Date(2012, 0), y: 0.30 }

                //]

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

                TaskCommentRepository objTaskCommentRepository = new TaskCommentRepository();

                List<string> lstLastYear = GetLastYears();

                List<int> lstShareCount = objTaskCommentRepository.GetTaskCommentByUserIdAndYear(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] + " },";
                            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) + "]";

                replyGraphData = shareGarphArray;
            }

            catch (Exception ex)
            {
                Console.WriteLine("Error : " + ex.StackTrace);
            }
            return replyGraphData;
        }
Ejemplo n.º 11
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);
 }
Ejemplo n.º 12
0
        public string GetAllTaskCommentByUserIdTaskId(string taskId, string userId)
        {
            ArrayList arrList = new ArrayList();
            string JStr = string.Empty;
            try
            {

                TaskCommentRepository taskrepo = new TaskCommentRepository();
                TaskComment objTask = new TaskComment();

                objTask.Id = Guid.Parse(taskId);
                objTask.UserId = Guid.Parse(userId);

                arrList = taskrepo.getAllTasksCommentOfUser(objTask.UserId,objTask.Id);

                if (arrList.Count > 0)
                {
                    JStr = new JavaScriptSerializer().Serialize(arrList);
                }
                else
                {
                    JStr = "Data Not Found";
                }

            }
            catch (Exception ex)
            {
                Console.WriteLine("Error : " + ex.StackTrace);
            }
            return JStr;
        }
Ejemplo n.º 13
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);
                }
            }
        }
Ejemplo n.º 14
0
        protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
        {
            User user = (User)Session["LoggedUser"];
            SocioBoard.Domain.Team team = (SocioBoard.Domain.Team)Session["GroupName"];
            if (CheckBox1.Checked)
            {
                if (chkincomplete.Checked == true)
                {
                    chkincomplete.Checked = false;
                    CheckBox1.Checked = true;
                }

                if (rdbtnmytask.Checked == true)
                    rdbtnmytask.Checked = false;

                if (rdbtnteamtask.Checked == true)
                    rdbtnteamtask.Checked = false;

              
                string path = "";
                string strbind = string.Empty;
                taskdiv.InnerHtml = "";
                int i = 0;
                string preaddedcomment = "";

                if (string.IsNullOrEmpty(user.ProfileUrl))
                {
                    path = "../Contents/img/blank_img.png";
                }
                else
                {
                    path = user.ProfileUrl;
                }

                //taskdata = taskrepo.getAllCompleteTasksOfUser(custid, custid);
                taskdata = taskrepo.getAllCompleteTasksOfUser(custid, team.GroupId,custid);
                //foreach (Tasks item in taskrepo.getAllCompleteTasksOfUsers(custid))
                //{
                //    taskdata.Add(item);
                //}
                foreach (Tasks item in taskrepo.getAllCompleteTasksOfUsers(custid,team.GroupId))
                {
                    taskdata.Add(item);
                }
                TaskCommentRepository objTaskCmtRepo = new TaskCommentRepository();
                TeamRepository objTeam = new TeamRepository();
                foreach (Tasks item in taskdata)
                {
                    if (item.TaskStatus == true)
                    {
                        TaskStatus = "Completed";

                    }
                    else
                    {
                        TaskStatus = "Pending";
                    }



                    User objdetails = objUserRepository.getUsersById(item.AssignTaskTo);
                    string strAssignedTo = objdetails.UserName;
                    User objdetail = objUserRepository.getUsersById(item.UserId);
                    string strAssignedBy = objdetail.UserName;
                    imgpath = path;
                    i++;

                    if (user.Id == objdetail.Id)
                    {
                        strbind += "<section class=\"section\" id=\"Section" + item.Id + "\"><div class=\"js-task-cont read\">" +
                                    "<span id=\"taskcomment\" class=\"ficon task_active\">" +
                                              "<img  onclick=\"getmemberdata('" + item.Id + "');\" src=\"../Contents/img/task_pin.png\" width=\"14\" height=\"17\" alt=\"\" /></span>" +
                                   "<section class=\"task-activity third\"><p>" + strAssignedTo + "</p><div>" + item.AssignDate + "</div><input type=\"hidden\" id=\"hdntaskid_" + i + "\" value=" + item.Id + " />" +
                                          "<p>Assigned by " + strAssignedBy + "</p></section>" +
                                    "<section class=\"task-owner\">" +
                                           "<img width=\"32\" height=\"32\" border=\"0\" class=\"avatar\" src=" + path + " />" +
                                           "</section><section class=\"task-message font-13 third\"><a class=\"tip_left\">" + item.TaskMessage + "</a>" +
                                          "</section><section class=\"task-status\"><div class=\"ui_light floating task_status_change\"><a class=\"ui-sproutmenu\" href=\"#nogo\">" +
                                            "<b>" + TaskStatus + "</b><span class=\"ui-sproutmenu-status\">" +
                                              "<img id=\"img_" + item.Id + "_" + item.TaskStatus + "\" class=\"edit_button\" src=\"../Contents/img/icon_edit.png\" onclick=\"PerformClick(this.id)\" title=\"Edit Status\" />" +
                                              "</span></a></div></section></div>" +
                                              "</section>";
                    }

                    else
                    {
                        strbind += "<section class=\"section\" id=\"Section" + item.Id + "\"><div class=\"js-task-cont read\">" +
                                    "<span id=\"taskcomment\" class=\"ficon task_active\">" +
                                              "<img  onclick=\"getmemberdata('" + item.Id + "');\" src=\"../Contents/img/task_pin.png\" width=\"14\" height=\"17\" alt=\"\" /></span>" +
                                   "<section class=\"task-activity third\"><p>" + strAssignedTo + "</p><div>" + item.AssignDate + "</div><input type=\"hidden\" id=\"hdntaskid_" + i + "\" value=" + item.Id + " />" +
                                          "<p>Assigned by " + strAssignedBy + "</p></section>" +
                                    "<section class=\"task-owner\">" +
                                           "<img width=\"32\" height=\"32\" border=\"0\" class=\"avatar\" src=" + path + " />" +
                                           "</section><section class=\"task-message font-13 third\"><a class=\"tip_left\">" + item.TaskMessage + "</a>" +
                                          "</section><section class=\"task-status\"><div class=\"ui_light floating task_status_change\"><a class=\"ui-sproutmenu\" href=\"#nogo\">" +
                                            "<b>" + TaskStatus + "</b><span class=\"ui-sproutmenu-status\">" +                            
                                              "</span></a></div></section></div>" +
                                              "</section>";
                    }


                    ArrayList pretask = objTaskCmtRepo.getAllTasksCommentOfUser(item.Id);
                    if (pretask != null)
                    {
                        preaddedcomment += "<div id=" + item.Id + " style=\"display:none\" >";
                        foreach (TaskComment items in pretask)
                        {
                            User details = objUserRepository.getUsersById(items.UserId);
                            string strAssigned = details.UserName;

                            
                            preaddedcomment += "<div id=\"task_comment_" + item.Id + "_" + items.Id + "\" class=\"assign_comments\" >" +
                                            "<section><article class=\"task_assign\">" +
                                            "<img src=" + imgpath + " width=\"30\" height=\"30\" alt=\"\"  />  " +
                                                "<article><input id=\"hdncommentsid\" type=\"hidden\" value=" + items.Id + " /><p class=\"msg_article\">" + items.Comment + "</p>" +
                                                    "<aside class=\"days_ago\"> By " + strAssigned + " at " + items.CommentDate + "</aside>" +
                                                "</article></article></section></div>";
                        }

                        preaddedcomment += "</div>";
                    }


                }

                if (string.IsNullOrEmpty(strbind))
                {
                    strbind = "Sorry no data !";
                }
                taskdiv.InnerHtml = strbind;
                prevComments.InnerHtml = preaddedcomment;
            }
            else
            {
                try
                {
                    bindTeamTask();
                }
                catch (Exception ex)
                {

                    logger.Error(ex.Message);
                }
            }
        }