Beispiel #1
0
    private void editRow(string keySet, string keyName)
    {
        LblOk.Text = "";
        LblErr.Text = "";

        var man = new AppSettingsManager2();
        var obj = new AppSetting();

        clearForm();
        this.currentXmlType = null;
        this.CurrentKey = keySet + "|" + keyName;
        if (keyName != string.Empty)
        {
            obj = man.GetByKey(keySet, keyName);
            DropKeySet.Enabled = false;
            TxtKeyName.Enabled = false;
        }
        else
        {
            DropKeySet.Enabled = true;
            TxtKeyName.Enabled = true;
        }
        obj2form(obj);

        MultiView1.ActiveViewIndex = 1;
    }
Beispiel #2
0
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        LblErr.Text = "";
        LblOk.Text = "";

        try
        {
            var man = new AppSettingsManager2();
            var item = new AppSetting();

            string keySet = getKeySetFromArgument(this.CurrentKey);
            string keyName = getKeyNameFromArgument(this.CurrentKey);

            item = man.GetByKey(keySet, keyName);

            form2obj(item);
            if (string.IsNullOrEmpty(keyName))
            {
                item = man.Insert(item);
            }
            else
            {
                man.Update(item);
            }
            loadGroupsList(item.KeySet);
            LblOk.Text = RenderSuccess(Utility.GetLabel("RECORD_SAVED_MSG"));
            MultiView1.ActiveViewIndex = 0;
        }
        catch (Exception e1)
        {
            LblErr.Text = RenderError(Utility.GetLabel("RECORD_ERR_MSG") + "<br />" + e1.ToString());
        }
        finally
        {
        }
    }