Exemplo n.º 1
0
        private static specifications GetSpecifications(HtmlDocument page, string element)
        {
            specifications specifications = new specifications();
            List <string>  elements       = new List <string>();

            elements.Add(element);
            List <KeyValuePair <string, HtmlNodeCollection> > htmlSpecifications = DataGetter.GetDataByXPATH(page, elements);
            HtmlNode Form = htmlSpecifications[0].Value[0];
            HtmlNode Storage_Conditions = htmlSpecifications[0].Value[1];
            HtmlNode Quality_Control    = htmlSpecifications[0].Value[2];

            specifications.form = Form.InnerText;;
            specifications.storage_conditions = Storage_Conditions.InnerText;
            specifications.quality_control    = Quality_Control.InnerText;
            return(specifications);
        }
Exemplo n.º 2
0
    specifications getSpecs(int prodId)
    {
        DataTable      dt    = new DataTable();
        specifications specs = new specifications();

        specs._video    = new List <specRow>();
        specs._features = new List <specRow>();
        specs._network  = new List <specRow>();
        specs._io       = new List <specRow>();
        specs._misc     = new List <specRow>();

        cmd.CommandText = "SELECT * FROM mtconsult_specs WHERE prodFk = " + prodId;
        dt = da.GetData(cmd);

        foreach (DataRow spec in dt.Rows)
        {
            specRow specRow = new global::specRow();
            int     type    = Convert.ToInt32(spec["type"]);

            specRow._header = spec["header"].ToString();
            specRow._detail = spec["detail"].ToString();

            if (type == 0)
            {
                specs._video.Add(specRow);
            }
            else if (type == 1)
            {
                specs._features.Add(specRow);
            }
            else if (type == 2)
            {
                specs._network.Add(specRow);
            }
            else if (type == 3)
            {
                specs._io.Add(specRow);
            }
            else if (type == 4)
            {
                specs._misc.Add(specRow);
            }
        }

        return(specs);
    }