예제 #1
0
 private static void ReadGroups()
 {
     try
     {
         Binary bi = HttpGetService.GetAsBinary(DataCenter.ServerAddr + "giraservice?func=readgroup");
         if (bi != null)
         {
             String xmlString = bi.ReadString();
             if (xmlString != null)
             {
                 XmlDocument xmlDoc = new XmlDocument();
                 xmlDoc.LoadXml(xmlString);
                 XmlNode node = xmlDoc.DocumentElement;
                 foreach (XmlNode subNode in node.ChildNodes)
                 {
                     if (subNode.Name.ToUpper() == "GROUP")
                     {
                         JGroup jGroup = new JGroup();
                         jGroup.ReadXml(subNode);
                         m_groups.Add(jGroup);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         ErrorException.OnError(ex);
     }
 }
예제 #2
0
        /// <summary>
        /// 数值改变事件
        /// </summary>
        /// <param name="sender">调用者</param>
        private void SelectedIndexChangedEvent(object sender)
        {
            MenuItemA item  = m_cmbGroup.GetItems()[m_cmbGroup.SelectedIndex];
            JGroup    group = item.Tag as JGroup;

            m_cmbCategory.ClearItems();
            int size = group.Categories.Count;

            for (int i = 0; i < size; i++)
            {
                JCategory category = group.Categories[i];
                MenuItemA item1    = new MenuItemA();
                item1.Text = category.Name;
                item1.Tag  = category;
                m_cmbCategory.AddItem(item1);
            }
            m_cmbCategory.SelectedIndex = 0;
        }
예제 #3
0
        /// <summary>
        /// 插入行数据
        /// </summary>
        /// <param name="jira">Jira对象</param>
        public void Addrows(Jira jira)
        {
            m_gridDgvTable.BeginUpdate();
            //设置样式
            GridCellStyle gridStyle = new GridCellStyle();

            gridStyle.BackColor = COLOR.DISABLEDCONTROL;
            GridRow row = new GridRow();

            m_gridDgvTable.AddRow(row);
            //设置边框线的颜色
            m_gridDgvTable.GridLineColor = COLOR.EMPTY;
            m_gridDgvTable.HeaderHeight  = 35;
            m_gridDgvTable.BackColor     = COLOR.ARGB(31, 29, 40);
            row.Tag = jira;
            //设置行高
            row.Height = 35;
            GridCell cell1 = new GridCellExp(jira.JiraID);

            row.AddCell("colT1", cell1);
            GridCellStyle gridStyle1 = new GridCellStyle();

            gridStyle1.BackColor = COLOR.DISABLEDCONTROL;
            gridStyle1.ForeColor = COLOR.ARGB(255, 255, 255);
            cell1.Style          = gridStyle1;
            GridCell cell2 = new GridCellExp(jira.Title);

            row.AddCell("colT2", cell2);
            GridCellStyle gridStyle2 = new GridCellStyle();

            gridStyle2.BackColor = COLOR.DISABLEDCONTROL;
            gridStyle2.ForeColor = COLOR.ARGB(45, 142, 45);
            cell2.Style          = gridStyle2;
            GridCell cell3 = new GridCellExp(jira.Creater);

            row.AddCell("colT3", cell3);
            GridCell cell4 = new GridCellExp(jira.Developer);

            row.AddCell("colT4", cell4);
            GridCellStyle gridStyle3 = new GridCellStyle();

            gridStyle3.BackColor = COLOR.DISABLEDCONTROL;
            gridStyle3.ForeColor = COLOR.ARGB(47, 145, 145);
            cell3.Style          = gridStyle3;
            cell4.Style          = gridStyle3;
            int count = XmlHandle.Groups.Count;

            for (int j = 0; j < count; j++)
            {
                JGroup group = XmlHandle.Groups[j];
                if (group.Id == jira.GroupID)
                {
                    GridCell cell5 = new GridCellExp(group.Name);
                    row.AddCell("colT5", cell5);
                    GridCellStyle gridStyle5 = new GridCellStyle();
                    gridStyle5.BackColor = COLOR.DISABLEDCONTROL;
                    gridStyle5.ForeColor = COLOR.ARGB(47, 145, 145);
                    cell5.Style          = gridStyle5;
                    GridCell cell6 = new GridCellExp(group.Manager);
                    row.AddCell("colT6", cell6);
                    GridCellStyle gridStyle6 = new GridCellStyle();
                    gridStyle6.BackColor = COLOR.DISABLEDCONTROL;
                    gridStyle6.ForeColor = COLOR.ARGB(255, 153, 153);
                    cell6.Style          = gridStyle6;
                    List <JCategory> categories = group.Categories;
                    int categoriesCount         = categories.Count;
                    for (int n = 0; n < categoriesCount; n++)
                    {
                        if (categories[n].Id == jira.CategoryID)
                        {
                            GridCell cell7 = new GridCellExp(categories[n].Name);
                            row.AddCell("colT7", cell7);
                            GridCellStyle gridStyle7 = new GridCellStyle();
                            gridStyle7.BackColor = COLOR.DISABLEDCONTROL;
                            gridStyle7.ForeColor = COLOR.ARGB(45, 142, 45);
                            cell7.Style          = gridStyle7;
                            break;
                        }
                    }
                    break;
                }
            }
            String        str        = jira.DeveloperReceive ? "是" : "否";
            GridCell      cell8      = new GridCellExp(str);
            GridCellStyle gridStyle8 = new GridCellStyle();

            gridStyle8.ForeColor = COLOR.ARGB(255, 255, 255);
            if (str == "是")
            {
                gridStyle8.BackColor = COLOR.ARGB(93, 146, 202);
            }
            else
            {
                gridStyle8.BackColor = COLOR.ARGB(163, 5, 50);
            }
            cell8.Style = gridStyle8;
            row.AddCell("colT8", cell8);
            String        str1       = jira.DeveloperPass ? "是" : "否";
            GridCell      cell9      = new GridCellExp(str1);
            GridCellStyle gridStyle9 = new GridCellStyle();

            gridStyle9.ForeColor = COLOR.ARGB(255, 255, 255);
            if (str1 == "是")
            {
                gridStyle9.BackColor = COLOR.ARGB(93, 146, 202);
            }
            else
            {
                gridStyle9.BackColor = COLOR.ARGB(163, 5, 50);
            }
            cell9.Style = gridStyle9;
            row.AddCell("colT9", cell9);
            String        str2        = jira.TestPass ? "是" : "否";
            GridCell      cell10      = new GridCellExp(str2);
            GridCellStyle gridStyle10 = new GridCellStyle();

            gridStyle10.ForeColor = COLOR.ARGB(255, 255, 255);
            if (str2 == "是")
            {
                gridStyle10.BackColor = COLOR.ARGB(93, 146, 202);
            }
            else
            {
                gridStyle10.BackColor = COLOR.ARGB(163, 5, 50);
            }
            cell10.Style = gridStyle10;
            row.AddCell("colT10", cell10);
            String        str3        = jira.ProductPass ? "是" : "否";
            GridCell      cell11      = new GridCellExp(str3);
            GridCellStyle gridStyle11 = new GridCellStyle();

            gridStyle11.ForeColor = COLOR.ARGB(255, 255, 255);
            if (str3 == "是")
            {
                gridStyle11.BackColor = COLOR.ARGB(93, 146, 202);
            }
            else
            {
                gridStyle11.BackColor = COLOR.ARGB(163, 5, 50);
            }
            cell11.Style = gridStyle11;
            row.AddCell("colT11", cell11);
            String        str4        = jira.WaitPublish ? "是" : "否";
            GridCell      cell12      = new GridCellExp(str4);
            GridCellStyle gridStyle12 = new GridCellStyle();

            gridStyle12.ForeColor = COLOR.ARGB(255, 255, 255);
            if (str4 == "是")
            {
                gridStyle12.BackColor = COLOR.ARGB(93, 146, 202);
            }
            else
            {
                gridStyle12.BackColor = COLOR.ARGB(163, 5, 50);
            }
            cell12.Style = gridStyle12;
            row.AddCell("colT12", cell12);
            String        str5        = jira.Published ? "是" : "否";
            GridCell      cell13      = new GridCellExp(str5);
            GridCellStyle gridStyle13 = new GridCellStyle();

            gridStyle13.ForeColor = COLOR.ARGB(255, 255, 255);
            if (str5 == "是")
            {
                gridStyle13.BackColor = COLOR.ARGB(93, 146, 202);
            }
            else
            {
                gridStyle13.BackColor = COLOR.ARGB(163, 5, 50);
            }
            cell13.Style = gridStyle13;
            row.AddCell("colT13", cell13);

            String        str6        = jira.CloseTask ? "是" : "否";
            GridCell      cell14      = new GridCellExp(str6);
            GridCellStyle gridStyle14 = new GridCellStyle();

            gridStyle14.ForeColor = COLOR.ARGB(255, 255, 255);
            if (str6 == "是")
            {
                gridStyle14.BackColor = COLOR.ARGB(93, 146, 202);
            }
            else
            {
                gridStyle14.BackColor = COLOR.ARGB(163, 5, 50);
            }
            cell14.Style = gridStyle14;
            row.AddCell("colT14", cell14);

            GridCell      cell15      = new GridCellExp(jira.Hurry);
            GridCellStyle gridStyle15 = new GridCellStyle();

            gridStyle15.BackColor = COLOR.ARGB(0, 0, 0);
            if (jira.Hurry == "紧急")
            {
                gridStyle15.ForeColor = COLOR.ARGB(255, 0, 0);
            }
            else
            {
                gridStyle15.ForeColor = COLOR.ARGB(255, 255, 0);
            }
            cell15.Style = gridStyle15;
            row.AddCell("colT15", cell15);
            GridCellStyle gridStyle16 = new GridCellStyle();

            gridStyle16.BackColor = COLOR.DISABLEDCONTROL;
            gridStyle16.ForeColor = COLOR.ARGB(255, 255, 0);
            DateTime dt1     = DateTime.Now;
            String   status  = jira.EndDate.ToFileTime() > dt1.ToFileTime() ? "(超时)" : "(正常)";
            GridCell cells16 = new GridCellExp(status + jira.StartDate.ToLongDateString().ToString());

            row.AddCell("colT16", cells16);
            cells16.Tag = jira.StartDate;
            GridCell cells17 = new GridCellExp(status + jira.StartDate.ToLongDateString().ToString());

            row.AddCell("colT17", cells17);
            cells16.Style = gridStyle16;
            cells17.Style = gridStyle16;
            cells17.Tag   = jira.EndDate;
            m_gridDgvTable.EndUpdate();
        }