示例#1
0
        private void Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (ValidateSaveRequest())
                {
                    DataCommand cmd = new DataCommand();

                    cmd.Name           = CommandName.Text;
                    cmd.DataConnection = DataConnectionList.Text;
                    cmd.Type           = CommandTypeList.Text.ToString();
                    cmd.Text           = CommandText.Text;
                    cmd.ReturnType     = (DataCommandReturnType)Enum.Parse(typeof(DataCommandReturnType), CommandReturnTypeList.Text.ToString());

                    DataConnection       connection = Project.GetDataConnection(cmd);
                    IDataCommandProvider DataSource = DataCommandService.GetInstance().GetProvider(connection);
                    DataSource.RefreshSchema(connection, cmd);

                    DataCommand.Save(cmd);

                    Configuration.GetInstance().DataCommands.Add(cmd);


                    this.DialogResult = DialogResult.OK;
                }
            }
            catch (Exception ex)
            {
                ErrorManager.HandleError(ex);
            }
        }
 public void Save(object configurationItem)
 {
     DataCommand.Save((DataCommand)configurationItem);
 }