Esempio n. 1
0
        public List <List <string> > GetData()
        {
            List <List <string> > rtn_list = new List <List <string> >();
            Case_tagClass         ct       = new Case_tagClass();
            List <Case_tagClass>  list     = ct.Read();
            TcaseClass            tc       = new TcaseClass();
            TagsClass             tags     = new TagsClass();


            foreach (var item in tc.Read())
            {
                List <string> myArrayList = new List <string>();
                myArrayList.Add(item.case_id_name);
                myArrayList.Add(item.case_id.ToString());
                int i = 0;
                foreach (var item1 in tags.Read())
                {
                    if (i == 0)
                    {
                        myArrayList.Add(item1.tag_id.ToString());
                    }
                    i++;
                    if (list.Any(cus => cus.f_case_id == item.case_id && cus.f_tag_id == item1.tag_id))
                    {
                        myArrayList.Add("checked");
                    }
                    else
                    {
                        myArrayList.Add("");
                    }
                }
                rtn_list.Add(myArrayList);
            }
            return(rtn_list);
        }
Esempio n. 2
0
        public string GetRelationOfTestcaseAndTagCode(string[] child_names)
        {
            string code = "";

            Case_tagClass case_TagClass = new Case_tagClass();
            TcaseClass    tcaseClass    = new TcaseClass();
            TagsClass     tagsClass     = new TagsClass();

            List <TcaseClass> list_case = tcaseClass.Read();


            string real_code = "";

            foreach (var case_ in list_case)
            {
                Boolean flg = false;
                code  = "<tr>";
                code += "<td>";
                code += case_.case_id_name;
                code += "</td>";

                foreach (string child_name in child_names)
                {
                    string r_child_name = child_name.Split('#')[0];
                    string type         = child_name.Split('#')[3];


                    TagsClass tc = new TagsClass();
                    if (tagsClass.isRealExist(new TagsClass {
                        tag_name = r_child_name
                    }))
                    {
                        tc = tagsClass.Detail(r_child_name);
                        if (case_TagClass.isExist(new Case_tagClass {
                            f_tag_id = tc.tag_id, f_case_id = case_.case_id
                        }))
                        {
                            code += "<td>Yes</td>";
                            flg   = true;
                            continue;
                        }
                        else
                        {
                            code += "<td></td>";
                            if (type == "and")
                            {
                                flg = false;
                                break;
                            }
                        }
                    }
                    else
                    {
                        code += "<td>" + "</td>";
                        if (type == "and")
                        {
                            flg = false;
                            break;
                        }
                    }
                }
                code += "</tr>";

                if (flg)
                {
                    real_code += code;
                }
            }
            return(real_code);
        }