Beispiel #1
0
        private void getissuenotifitcaions()
        {
            string htmldata = "";

            Dataservice.DatamanagementClient findata = new Dataservice.DatamanagementClient();

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

            findata.Open();
            object[][] issuenotifications = findata.getissuenotifications(user.getID());
            if (issuenotifications != null)
            {
                for (int i = 0; i < issuenotifications.Length; i++)
                {
                    DateTime credate      = DateTime.Parse((string)issuenotifications[i][3]);
                    DateTime exdate       = credate.AddDays(14);
                    object[] issuedetails = findata.getissuedetails((string)issuenotifications[i][1]);
                    object[] projdetails  = findata.getprojectdetails((string)issuedetails[3]);
                    int      result       = DateTime.Compare(exdate, DateTime.Now);

                    if (result < 0)
                    {
                        findata.deleteporjnotificaiton((string)issuenotifications[i][0], user.getID());
                    }
                    else
                    {
                        htmldata += "<a href=\"Issueaccept.aspx?id=" + (string)issuedetails[0] + "&in=" + (string)issuenotifications[i][0] + "\">";
                        htmldata += "<div class=\"col s12 m4 l4\">";
                        // incomplete += "<div class=\"card horizontal hoverable " + colorchoice(Convert.ToInt32((string)storedtask[4])) + " href=\"Taskedit" + "?id=" + task.Id + "\">";
                        htmldata += "<div class=\"card  hoverable orange lighten-3\">";
                        htmldata += "<div class=\"card-stacked\">";
                        htmldata += "<div class=\"card-content black-text\">";
                        htmldata += "<span class=\"card-title\"><p class=\"bold\">" + (string)issuedetails[1] + "</p>";
                        htmldata += "</span>";
                        htmldata += "<p class=\"trunctext\">Project: " + (string)projdetails[1] + "</p>";
                        htmldata += "<p class=\"trunctext\">Expires in: " + (exdate - DateTime.Now).Days + " Days</p>";
                        htmldata += "</div>";
                        htmldata += "</div>";
                        htmldata += "</div>";
                        htmldata += "</div>";
                        htmldata += "</a>";
                    }
                }
            }
            findata.Close();

            newissues.InnerHtml = htmldata;
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["User"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            else
            {
                Title = "Issue Edit";

                pid = Request.QueryString.Get("id");
                UserData user = (UserData)Session["User"];
                Currentmembers.Multiple = true;
                Othermembers.Multiple   = true;
                if (!IsPostBack)
                {
                    Dataservice.DatamanagementClient findata = new Dataservice.DatamanagementClient();
                    findata.Open();
                    issuemembers = findata.getissuemembers(pid);
                    issue        = findata.getissuedetails(pid);

                    projectmembers = findata.getprojectmembers((string)issue[3]);



                    project           = findata.getprojectdetails((string)issue[3]);
                    txtprojname.Value = (string)project[1];


                    txtprojt.Value = (string)project[1];
                    txtprojd.Value = (string)project[2];

                    for (int i = 0; i < projectmembers.Length; i++)
                    {
                        if ((string)projectmembers[i] == user.getID())
                        {
                        }
                        else
                        {
                            Boolean userisamember = false;
                            bool    issnotice     = false;
                            if (issuemembers != null)
                            {
                                for (int j = 0; j < issuemembers.Length; j++)
                                {
                                    if ((string)projectmembers[i] == (string)issuemembers[j])
                                    {
                                        userisamember = true;
                                    }
                                    else
                                    {
                                        userisamember = false;
                                    }
                                }
                            }

                            userdetails = findata.getspecificuserinformation((string)projectmembers[i]);
                            Object[][] userevents = findata.getalluserevents((string)projectmembers[i]);
                            int        eventcount = 0;
                            if (userevents != null)
                            {
                                for (int j = 0; j < userevents.Length; j++)
                                {
                                    DateTime credate = DateTime.Parse((string)userevents[j][1]);



                                    int result = DateTime.Compare(credate, DateTime.Now.AddDays(14));

                                    if (result < 0)
                                    {
                                        eventcount += 1;
                                    }
                                }
                            }
                            object[][] userissnotice = findata.getissuenotifications((string)projectmembers[i]);

                            if (userissnotice != null)
                            {
                                for (int a = 0; a < userissnotice.Length; a++)
                                {
                                    if (Convert.ToInt32(pid) == Convert.ToInt32((string)userissnotice[a][1]))
                                    {
                                        issnotice = true;
                                    }
                                }
                            }


                            if (issnotice == false)
                            {
                                if (userisamember == true)
                                {
                                    Currentmembers.Items.Add(new ListItem(" " + priority(eventcount).ToString() + " " + (string)userdetails[0] + " " + (string)userdetails[2] + " ", (string)projectmembers[i].ToString()));
                                }
                                else
                                {
                                    Othermembers.Items.Add(new ListItem(" " + priority(eventcount).ToString() + " " + (string)userdetails[0] + " " + (string)userdetails[2] + " ", (string)projectmembers[i].ToString()));
                                }
                            }
                        }
                    }

                    findata.Close();
                }
            }
        }