Exemplo n.º 1
0
    private edit_Item_Dropdown_Chooser getFilter(XmlNode node)
    {
        edit_Item_Dropdown_Chooser filter = new edit_Item_Dropdown_Chooser();

        filter.ConnStr      = getChild(node, "conn", "ConnStr1");
        filter.ConnStr      = SecureConnection.GetCnxString(filter.ConnStr);
        filter.ID           = node.Attributes["id"].Value;
        filter.Label        = node.Attributes["label"].Value;
        filter.Width        = node.Attributes["width"].Value;
        filter.Type         = Edit_Item_Type.Dropdown_Chooser;
        filter.Field        = node.SelectSingleNode(".//field").InnerText;
        filter.FieldType    = node.SelectSingleNode(".//fieldtype").InnerText;
        filter.FieldList    = node.SelectSingleNode(".//fieldlist").InnerText;
        filter.FilterField  = node.SelectSingleNode(".//filterField").InnerText;
        filter.SQL          = node.SelectSingleNode(".//sql").InnerText;
        filter.ErrorNoInput = getChild(node, "error_no_input", "");
        return(filter);
    }
Exemplo n.º 2
0
    private view_Item_Dropdown_Filter getFilter(XmlNode node)
    {
        string id    = node.Attributes["id"].Value;    //.SelectSingleNode(".//id").InnerText;
        string label = node.Attributes["label"].Value; //.SelectSingleNode(".//label").InnerText;
        string type  = node.Attributes["type"].Value;  //.SelectSingleNode(".//type").InnerText;

        view_Item_Dropdown_Filter filter = new view_Item_Dropdown_Filter();

        filter.ConnStr = node.SelectSingleNode(".//conn") == null?VatLid.DAL.getConnectionString1() : node.SelectSingleNode(".//conn").InnerText;

        filter.ConnStr = SecureConnection.GetCnxString(filter.ConnStr);
        filter.ID      = id;
        filter.Label   = label;
        filter.Type    = type;
        if (type != "3") //<!-- filter, type = 3: Filter info load from list of different kind of filter. Ex: {Canceled,IsPause=1};{Free,IsPause=0 AND NextCharge>0};{==All status==,} -->
        {
            filter.FieldList   = node.SelectSingleNode(".//fieldlist").InnerText;
            filter.FilterField = node.SelectSingleNode(".//filterField").InnerText;
        }
        filter.SQL = node.SelectSingleNode(".//sql").InnerText;
        return(filter);
    }
Exemplo n.º 3
0
    private void travelXML(XmlNode doc)
    {
        listItems = new ArrayList();
        foreach (XmlNode value in doc.SelectNodes(".//text"))
        {
            string type = value.Attributes["type"].Value;

            edit_Item_TextInput textinput = new edit_Item_TextInput();
            textinput.ID           = value.Attributes["id"].Value;
            textinput.Label        = value.Attributes["label"].Value;
            textinput.Width        = value.Attributes["width"].Value;
            textinput.Field        = value.SelectSingleNode(".//field").InnerText;
            textinput.FieldType    = value.SelectSingleNode(".//fieldtype").InnerText;
            textinput.Validate     = value.SelectSingleNode(".//validate").InnerText;
            textinput.ErrorNoInput = getChild(value, "error_no_input", "");
            if (type == "2") // text area
            {
                textinput.Type   = Edit_Item_Type.TextArea;
                textinput.Height = value.SelectSingleNode(".//height").InnerText;
            }
            else
            {
                textinput.Type = Edit_Item_Type.TextBox;
            }

            listItems.Add(textinput);
        }

        //foreach (XmlNode value in doc.SelectNodes(".//check"))
        //{
        //    string type = value.Attributes["type"].Value;

        //    edit_Item_CheckBox textinput = new edit_Item_CheckBox();
        //    textinput.ID = value.Attributes["id"].Value;
        //    textinput.Label = value.Attributes["label"].Value;
        //    textinput.Width = value.Attributes["width"].Value;
        //    textinput.Field = value.SelectSingleNode(".//field").InnerText;
        //    textinput.FieldType = value.SelectSingleNode(".//fieldtype").InnerText;
        //    textinput.ErrorNoInput = getChild(value, "error_no_input", "");

        //    textinput.Type = Edit_Item_Type.TextBox;

        //    listItems.Add(textinput);
        //}


        foreach (XmlNode value in doc.SelectNodes(".//file"))
        {
            edit_Item_FileInput fileinput = new edit_Item_FileInput();
            fileinput.ID           = value.Attributes["id"].Value;
            fileinput.Label        = value.Attributes["label"].Value;
            fileinput.Width        = value.Attributes["width"].Value;
            fileinput.Field        = value.SelectSingleNode(".//field").InnerText;
            fileinput.FieldType    = value.SelectSingleNode(".//fieldtype").InnerText;
            fileinput.Extention    = value.SelectSingleNode(".//extension").InnerText;
            fileinput.StorePath    = ConfigurationSettings.AppSettings[value.SelectSingleNode(".//storepath").InnerText];
            fileinput.MaxSize      = Int32.Parse(getChild(value, "maxsize", "10204000"));
            fileinput.ErrorNoInput = getChild(value, "error_no_input", "");
            fileinput.CurrentValue = "";

            listItems.Add(fileinput);
        }
        foreach (XmlNode value in doc.SelectNodes(".//filter"))
        {
            edit_Item_Dropdown_Chooser filter = getFilter(value);
            listItems.Add(filter);

            XmlNode n = value.SelectSingleNode(".//filter_sub");
            if (n != null)
            {
                edit_Item_Dropdown_Chooser sub = getFilter(n);
                sub.Type     = Edit_Item_Type.Dropdown_Chooser_2;
                filter.Child = sub;
                listItems.Add(sub);
            }
        }
        foreach (XmlNode value in doc.SelectNodes(".//action"))
        {
            string type = value.Attributes["type"].Value;

            edit_Item_ButtonAction action = new edit_Item_ButtonAction();
            action.ConnStr = getChild(value, "conn", "ConnStr1");
            action.ConnStr = SecureConnection.GetCnxString(action.ConnStr);
            action.ID      = value.Attributes["id"].Value;
            action.Label   = value.Attributes["label"].Value;
            if (type == "1")
            {
                action.Type = Edit_Item_Type.AddAction;
            }
            else
            {
                action.Type = Edit_Item_Type.EditAction;
            }
            action.Procedure = value.SelectSingleNode(".//procedure").InnerText;
            action.BackLink  = getChild(value, "backlink", "");

            listItems.Add(action);
        }
    }