Esempio n. 1
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;
        }
Esempio n. 2
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;
        }
Esempio n. 3
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;
        }
Esempio n. 4
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);
                }
            }
        }