Beispiel #1
0
    private void mSave()
    {
        if (mValidateAddEdit())
        {
            try
            {
                Plugins plugins = new Plugins();
                if (pIDPlugin.HasValue)
                {
                    plugins.LoadByPrimaryKey(pIDPlugin.Value);
                    if (string.IsNullOrEmpty(pJSFileName))
                    {
                        pJSFileName = plugins.pJSfileName;
                    }
                }
                else
                {
                    plugins.AddNew();
                }

                plugins.pName        = txtName.Text;
                plugins.pJSfileName  = pJSFileName;
                plugins.pVersion     = txtVersion.Text;
                plugins.pDescription = txtDescription.Text;
                plugins.pSettings    = txtSettings.Text;
                plugins.pCss         = txtCss.Text;
                plugins.pJSinit      = txtJSinit.Text;

                plugins.Save();
                mSaveFile(pJSFileName);

                pMessage.Clear();
                pMessage.Add(Farschidus.Translator.AppTranslate["general.message.success"], Farschidus.Web.UI.Message.MessageTypes.Success);
                mShowMessage(pMessage);
            }
            catch (Exception ex)
            {
                pMessage.Clear();
                pMessage.Add(ex.Message, Farschidus.Web.UI.Message.MessageTypes.Error);
                mShowMessage(pMessage);
            }
        }
        else
        {
            mShowMessage(pMessage);
        }
    }