コード例 #1
0
        private void InitDb(string path)
        {
            EbConfiguration e = new EbConfiguration()
            {
                ClientID   = "xyz0007",
                ClientName = "XYZ Enterprises Ltd.",
                LicenseKey = "00288-22558-25558",
            };

            e.DatabaseConfigurations.Add(EbDatabases.EB_OBJECTS, new EbDatabaseConfiguration(EbDatabases.EB_OBJECTS, DatabaseVendors.PGSQL, "eb_objects", "localhost", 5432, "postgres", "infinity", 500));
            e.DatabaseConfigurations.Add(EbDatabases.EB_DATA, new EbDatabaseConfiguration(EbDatabases.EB_DATA, DatabaseVendors.PGSQL, "eb_objects", "localhost", 5432, "postgres", "infinity", 500));
            e.DatabaseConfigurations.Add(EbDatabases.EB_ATTACHMENTS, new EbDatabaseConfiguration(EbDatabases.EB_ATTACHMENTS, DatabaseVendors.PGSQL, "eb_objects", "localhost", 5432, "postgres", "infinity", 500));
            e.DatabaseConfigurations.Add(EbDatabases.EB_LOGS, new EbDatabaseConfiguration(EbDatabases.EB_LOGS, DatabaseVendors.PGSQL, "eb_objects", "localhost", 5432, "postgres", "infinity", 500));

            byte[] bytea = EbSerializers.ProtoBuf_Serialize(e);
            EbFile.Bytea_ToFile(bytea, path);
        }
コード例 #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            var _form = (IpDesignerCore as pF.pDesigner.pDesigner).Controls[0].Controls[0].Controls[0] as EbFormControl;

            _form.BeforeSerialization();

            IServiceClient client = new JsonServiceClient(CacheHelper.SERVICESTACK_URL).WithCache();
            var            f      = new EbObjectWrapper
            {
                Id           = _form.EbControlContainer.Id,
                EbObjectType = ExpressBase.Objects.EbObjectType.Form,
                Name         = _form.Name,
                Bytea        = EbSerializers.ProtoBuf_Serialize(_form.EbControlContainer),
                Token        = MainForm.JwtToken
            };

            using (client.Post <HttpWebResponse>(f as object)) { }

            this.Close();
        }
コード例 #3
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            IServiceClient client = new JsonServiceClient(CacheHelper.SERVICESTACK_URL).WithCache();
            var            f      = new EbObjectWrapper
            {
                Id           = this.Id,
                EbObjectType = Objects.EbObjectType.DataSource,
                Name         = txtName.Text.Trim(),
                Bytea        = EbSerializers.ProtoBuf_Serialize(new EbDataSource
                {
                    Id   = this.Id,
                    Name = txtName.Text.Trim(),
                    Sql  = this.scintilla1.Text.Trim()
                }),
                Token = MainForm.JwtToken
            };

            using (client.Post <HttpWebResponse>(f)) { }

            this.Close();
        }