예제 #1
0
        void Callback_Click(object sender, System.Windows.Forms.HtmlElementEventArgs e)
        {
            string action = this.web.Document.GetElementById("callback").GetAttribute("action");

            if (action == "validate")
            {
                int rowId = this.index;
                if (rowId > 0)
                {
                    o2Mate.Array  outputTab    = this.outputDict.GetArray(this.keyTab) as o2Mate.Array;
                    o2Mate.Fields outputFields = outputTab.Item(rowId) as o2Mate.Fields;
                    foreach (KeyValuePair <string, string> kv in this.keys)
                    {
                        string value = this.web.Document.GetElementById(kv.Key).GetAttribute("value");
                        outputFields.AddString(kv.Value, value);
                    }
                }
                else
                {
                    o2Mate.Array  outputTab    = this.outputDict.GetArray(this.keyTab) as o2Mate.Array;
                    o2Mate.Fields outputFields = new o2Mate.Fields();
                    foreach (KeyValuePair <string, string> kv in this.keys)
                    {
                        string value = this.web.Document.GetElementById(kv.Key).GetAttribute("value");
                        outputFields.AddString(kv.Value, value);
                    }
                    outputTab.Add(outputFields);
                }
                this.Return_Click(sender, e);
            }
            else if (action == "add")
            {
                string           arrayRef = this.web.Document.GetElementById("callback").GetAttribute("reference");
                DictSaisieChamps dsc      = new DictSaisieChamps(this, null, null, this.web, this.inputDict, this.outputDict, this.fileNameSrc, arrayRef, 0);
                dsc.Load();
                dsc.Navigate();
            }
            else if (action == "edit")
            {
                string arrayRef = this.web.Document.GetElementById("callback").GetAttribute("reference");
                int    indexRef = 0;
                Int32.TryParse(this.web.Document.GetElementById("callback").GetAttribute("index"), out indexRef);
                DictSaisieChamps dsc = new DictSaisieChamps(this, null, null, this.web, this.inputDict, this.outputDict, this.fileNameSrc, arrayRef, indexRef);
                dsc.Load();
                dsc.Navigate();
            }
        }
        void Callback_Click(object sender, System.Windows.Forms.HtmlElementEventArgs e)
        {
            string action = this.web.Document.GetElementById("callback").GetAttribute("action");

            if (action == "add")
            {
                string           arrayRef = this.web.Document.GetElementById("callback").GetAttribute("reference");
                DictSaisieChamps dsc      = new DictSaisieChamps(this, null, null, this.web, this.inputDict, this.outputDict, this.fileNameSrc, arrayRef, 0);
                dsc.Load();
                dsc.Navigate();
            }
            else if (action == "edit")
            {
                string arrayRef = this.web.Document.GetElementById("callback").GetAttribute("reference");
                int    indexRef = 0;
                Int32.TryParse(this.web.Document.GetElementById("callback").GetAttribute("index"), out indexRef);
                DictSaisieChamps dsc = new DictSaisieChamps(this, null, null, this.web, this.inputDict, this.outputDict, this.fileNameSrc, arrayRef, indexRef);
                dsc.Load();
                dsc.Navigate();
            }
        }