Esempio n. 1
0
        private void ReplacerItemAdd(Repeater source, RepeaterCommandEventArgs e)
        {
            ReplacerController controller = new ReplacerController();

            TextBox addKeywordTextbox   = (TextBox)e.Item.FindControl("AddKeywordTextbox");
            TextBox addDataFieldTextBox = (TextBox)e.Item.FindControl("AddDataFieldTextBox");

            ReplacerModel replacer = new ReplacerModel();

            replacer.Keyword   = addKeywordTextbox.Text;
            replacer.DataField = addDataFieldTextBox.Text;

            controller.SaveReplacer(replacer);
        }
Esempio n. 2
0
        private void ReplacerItemSave(RepeaterCommandEventArgs e)
        {
            ReplacerController controller = new ReplacerController();

            Label   id        = (Label)e.Item.FindControl("IdLabel");
            TextBox keyword   = (TextBox)e.Item.FindControl("KeywordTextBox");
            TextBox dataField = (TextBox)e.Item.FindControl("DataFieldTextBox");

            ReplacerModel replacer = new ReplacerModel();

            if (id.Text != "")
            {
                replacer.Id = System.Convert.ToInt32(id.Text);
            }

            replacer.Keyword   = keyword.Text;
            replacer.DataField = dataField.Text;

            controller.SaveReplacer(replacer);
        }