public void AddPost(Post post)
        {
            // Parse Tags into separate hash tags
            if (post.Tags != null)
            {
                var hashtags = post.Tags.Replace("#", "").Split(',');

                foreach (var hashtag in hashtags)
                {
                    if (hashtag != "")
                    {
                        var p = new HashTag();

                        p.ActualHashTag = hashtag;
                        post.HashTags.Add(p);
                    }
                }
            }

            var create = new Create();
            var postID = create.AddPost(post);

            // Check if post add was successful and returned the new postID
            if (postID != null && post.HashTags.Count() != 0)
            {
                foreach (var tag in post.HashTags)
                {
                    create.AddTag((int) postID, tag);
                }
            }
        }
Exemple #2
0
 // Use this for initialization
 void Start()
 {
     this.cameraObject = GameObject.Find("MainCamera");
     this.create = GameObject.Find("ShootPosition").GetComponent<Create>();
     this.cameraSmoothScipt = this.cameraObject.GetComponent<CameraSmooth>();
     this.addValue = 0;
 }
Exemple #3
0
        public override Statistics run()
        {
            Environment env = new Environment();

            //dist
            List<double> valueList = new List<double>() { 1, 2, 3, 4, 5 };
            List<double> distribution = new List<double>() { 0.5, 0.6, 0.7, 0.8, 1.0 };
            Discrete d = new Discrete(valueList, distribution);
            //dist1
            Uniform n = new Uniform(1, 3);
            Distribution dist = new Distribution(d);
            Distribution dist1 = new Distribution(n);

            Create c = new Create(env, 0, 20, dist);

            Dispose di = new Dispose(env, 1);

            Queue q = new Queue(env, 3);
            q.Capacity = 1;
            Resource r = new Resource(env, 2, 1, dist1, q);

            c.Next_AID.Add("First", 2);
            r.Next_AID.Add("First", 1);

            env.System_Time = new DateTime(1970, 1, 1, 0, 0, 0);
            env.Start_Time = new DateTime(1970, 1, 1, 0, 0, 0);
            env.Setup_Simulation();
            return env.Simulate();
        }
Exemple #4
0
        public void WithoutViewModelRendersWithoutExceptions()
        {
            var view = new Create();
            var viewModel = new CreateViewModel { Currencies = UnitTestHelper.Currencies.ToList() };

            var html = view.RenderAsHtml(viewModel);
        }
 public ActionResult Create(Create create)
 {
     using (_sessionManager.CreateUnitOfWork())
     {
         _galaxyManager.CreateGalaxy();
         return View();
     }
 }
Exemple #6
0
        public CreateOrJoin(Create a, Join n)
        {
            cfunk = a;
            jfunk = n;
            ipAddress.Text = loadFromRegistry("ipAdress");
            port.Text = loadFromRegistry("port");
            ssName.Text = loadFromRegistry("ssName");
            passWord.Text = loadFromRegistry("passWord");

            InitializeComponent();
        }
Exemple #7
0
        public void WithViewModelRendersWithoutExceptions1()
        {
            var view = new Create();

            var viewModel = new CreateViewModel
                {
                   Currencies = new List<string> { "USD", "BTC", "MBUSD" }, CurrencyId = "BTC", DisplayName = null
                };

            var html = view.RenderAsHtml(viewModel);
        }
Exemple #8
0
    // Use this for initialization
    void Start()
    {
        this.phidgetSetting = GameObject.Find("GamePhidgetSetting").GetComponent<PhidgetSetting>();

        this.create = this.transform.parent.GetComponent<Create>();

        if (this.phidgetSetting.PhidgetKit.sensors[this.Port].Value > this.ReturnLimitValue)
            this.isReturn = false;
        else
            this.isReturn = true;
    }
Exemple #9
0
        IEnumerable<Event> Handle(Create cmd)
        {
            if (string.IsNullOrEmpty(cmd.Name))
                throw new ArgumentException("Inventory item name cannot be null or empty");

            if (name != null)
                throw new InvalidOperationException(
                    $"Inventory item with id {Id} has been already created");

            yield return new InventoryItemCreated(cmd.Name);
        }
Exemple #10
0
        public double run()
        {
            Environment env = new Environment();

            //dist for Create
            Constant Const = new Constant(1);
            Distribution CreateDist = new Distribution(Const);
            //distributions for Inventory
            List<double> States = new List<double>() { 1, 2, 3 }; //1 for good, 2 for fair, 3 for poor
            List<double> States_Prob = new List<double>() { 0.35, 0.80, 1.00 };
            Discrete StatesDisc = new Discrete(States, States_Prob);

            List<double> State1 = new List<double>() { 40, 50, 60, 70, 80, 90, 100 };
            List<double> State1_Prob = new List<double>() { 0.03, 0.08, 0.23, 0.43, 0.78, 0.93, 1.00 };
            Discrete State1Disc = new Discrete(State1, State1_Prob);

            List<double> State2 = new List<double>() { 40, 50, 60, 70, 80, 90, 100 };
            List<double> State2_Prob = new List<double>() { 0.10, 0.28, 0.68, 0.88, 0.96, 1.00, 1.00 };
            Discrete State2Disc = new Discrete(State2, State2_Prob);

            List<double> State3 = new List<double>() { 40, 50, 60, 70, 80, 90, 100 };
            List<double> State3_Prob = new List<double>() { 0.44, 0.66, 0.82, 0.94, 1.00, 1.00, 1.00 };
            Discrete State3Disc = new Discrete(State3, State3_Prob);

            Dictionary<double, Discrete> Demand = new Dictionary<double, Discrete>();
            Demand.Add(1, State1Disc);
            Demand.Add(2, State2Disc);
            Demand.Add(3, State3Disc);

            List<Int64> Amount = new List<Int64>();
            for (int i = 0; i < 20; i++) Amount.Add(70);

            Create create = new Create(env, 0, 20, CreateDist, Amount);

            Dispose dispose = new Dispose(env, 2);

            Inventory inv = new Inventory(env, 1, new TimeSpan(1), 70, StatesDisc, Demand, 0.33, 0.50, true, 0.05);

            create.Next_AID.Add("First", 1);
            inv.Next_AID.Add("First", 2);

            env.System_Time = new DateTime(1970, 1, 1, 0, 0, 0);
            env.Start_Time = new DateTime(1970, 1, 1, 0, 0, 0);

            env.Setup_Simulation();
            env.Simulate();

            double sumOfProfit = 0;
            for (int i = 1; i <= 20; i++)
                sumOfProfit += (double)inv.Statistics.OtherStatistics[i][5].StatisticValue;
            return sumOfProfit;
        }
Exemple #11
0
        public void run()
        {
            Environment env = new Environment();

            //
            List<double> valueList = new List<double>() { 1, 2, 3, 4, 5 };
            List<double> distribution = new List<double>() { 0.5, 0.6, 0.7, 0.8, 1.0 };
            Discrete discrete = new Discrete(valueList, distribution, 0);
            //
            Uniform uniform = new Uniform(1, 3, 0);
            Distribution CreateDist = new Distribution(discrete);
            Distribution ResDist = new Distribution(uniform);

            Create c = new Create(env, 0, 4, CreateDist);

            Dispose dispose = new Dispose(env, 10);

            Queue q = new Queue(env, 5);
            q.Capacity = 10;
            Resource r = new Resource(env, 1, 1, ResDist, q);

            Queue q2 = new Queue(env, 6);
            q2.Capacity = 10;
            Resource r2 = new Resource(env, 2, 1, ResDist, q2);

            Queue q3 = new Queue(env, 7);
            q3.Capacity = 10;
            Resource r3 = new Resource(env, 3, 1, ResDist, q3);

            Queue q4 = new Queue(env, 8);
            q4.Capacity = 10;
            Resource r4 = new Resource(env, 4, 1, ResDist, q4);

            c.Next_AID.Add("First", 1);
            r.Next_AID.Add("First", 2);
            r2.Next_AID.Add("First", 3);
            r3.Next_AID.Add("First", 4);
            r4.Next_AID.Add("First", 2);

            env.System_Time = new DateTime(1970, 1, 1, 0, 0, 0);
            env.Start_Time = new DateTime(1970, 1, 1, 0, 0, 0);
            env.Setup_Simulation(TimeSpan.FromSeconds(300));
            env.Simulate();
        }
Exemple #12
0
        public override Statistics run()
        {
            Environment env = new Environment();

            //dist for Create
            Uniform CreateDist = new Uniform(1, 5);

            //dist for Able
            Uniform AbleDist = new Uniform(4, 6);

            //dist for Baker
            Uniform BakerDist = new Uniform(2, 5);

            Distribution DistCreate = new Distribution(CreateDist);
            Distribution DistAble = new Distribution(AbleDist);
            Distribution DistBaker = new Distribution(BakerDist);

            Create create = new Create(env, 0, 100, DistCreate);

            Dispose dispose = new Dispose(env, 10);

            Queue SharedQueue = new Queue(env, 3);

            Resource Able = new Resource(env, 1, 1, DistAble, SharedQueue);

            Resource Baker = new Resource(env, 2, 1, DistBaker, SharedQueue);

            Decide decide = new Decide(env, 5);
            //Condition
            EQCond cond = new EQCond(0, Able, Actor.StateType.Idle);
            decide.AddCondition(cond, Able.AID);
            decide.AddElse(Baker.AID);

            create.Next_AID.Add("First", 5);
            Able.Next_AID.Add("First", 10);
            Baker.Next_AID.Add("First", 10);

            env.System_Time = new DateTime(1970, 1, 1, 0, 0, 0);
            env.Start_Time = new DateTime(1970, 1, 1, 0, 0, 0);

            env.Setup_Simulation();
            return env.Simulate();
        }
Exemple #13
0
        public void run()
        {
            Environment env = new Environment();

            //dist
            List<double> valueList = new List<double>() { 1, 2, 3, 4, 5 };
            List<double> distribution = new List<double>() { 0.5, 0.6, 0.7, 0.8, 1.0 };
            Discrete d = new Discrete(valueList, distribution, 0);
            //dist1
            Uniform n = new Uniform(1, 3, 0);
            Distribution dist = new Distribution(d);
            Distribution dist1 = new Distribution(n);

            Create c = new Create(env, 0, 10000, dist,null,new List<double>(){0.3,0.8,1.0});

            Dispose di = new Dispose(env, 1);

            Queue q = new Queue(env, 3);
            q.Capacity = 1;
            Resource r = new Resource(env, 2, 1, dist1, q);

            Queue q2 = new Queue(env,5);
            q2.Capacity = 1;
            Resource r2 = new Resource(env, 6, 1, dist1, q2);

            Queue q3 = new Queue(env, 10);
            q3.Capacity = 1;
            Resource r3 = new Resource(env, 7, 1, dist1, q3);

            c.Next_AID.Add("First", 2);
            c.Next_AID.Add("Second", 6);
            c.Next_AID.Add("Third", 7);

            r.Next_AID.Add("First", 1);
            r2.Next_AID.Add("First", 1);
            r3.Next_AID.Add("First", 1);

            env.System_Time = new DateTime(1970, 1, 1, 0, 0, 0);
            env.Start_Time = new DateTime(1970, 1, 1, 0, 0, 0);
            env.Setup_Simulation();
            env.Simulate();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="DelegateFactory"/> class.
        /// </summary>
        /// <param name="typeToCreate">The instance type to create.</param>
        /// <param name="argumentTypes">The types argument.</param>
        public DelegateFactory(Type typeToCreate, Type[] argumentTypes)
        {
            DynamicMethod dynamicMethod = new DynamicMethod("CreateImplementation", typeof(object), new Type[] { typeof(object[]) }, this.GetType().Module, false);
            ILGenerator generatorIL = dynamicMethod.GetILGenerator();

            // Emit the IL for Create method.
            // Add test if contructeur not public
            ConstructorInfo constructorInfo = typeToCreate.GetConstructor(VISIBILITY, null, argumentTypes, null);
            if (constructorInfo==null || !constructorInfo.IsPublic)
            {
                throw new ProbeException(
                    string.Format("Unable to optimize create instance. Cause : Could not find public constructor matching specified arguments for type \"{0}\".", typeToCreate.Name));
            }
            // new typeToCreate() or new typeToCreate(... arguments ...)
            EmitArgsIL(generatorIL, argumentTypes);
            generatorIL.Emit(OpCodes.Newobj, constructorInfo);
            generatorIL.Emit(OpCodes.Ret);

            _create = (Create)dynamicMethod.CreateDelegate(typeof(Create));
        }
Exemple #15
0
        public void run()
        {
            Environment env = new Environment();

            //dist
            Uniform d = new Uniform(1, 1, 0);

            //dist1
            Uniform n = new Uniform(5, 5, 0);
            Distribution dist = new Distribution(d);
            Distribution dist1 = new Distribution(n);

            Create c = new Create(env, 0, 10, dist);

            Dispose di = new Dispose(env, 10);

            Queue q = new Queue(env, 3);
            q.Capacity = 10;
            Resource r = new Resource(env, 1, 1, dist1, q);

            Queue q2 = new Queue(env, 4);
            q2.Capacity = 5;
            Resource r2 = new Resource(env, 2, 1, dist1, q);

            Decide de = new Decide(env, 5);
            //Condition
            EQCond cond = new EQCond(0, r, Actor.StateType.Busy);
            de.AddCondition(cond, r2.AID);
            de.AddElse(r.AID);

            c.Next_AID.Add("First", 5);
            r.Next_AID.Add("First", 10);
            r2.Next_AID.Add("First", 10);

            env.System_Time = new DateTime(1970, 1, 1, 0, 0, 0);
            env.Start_Time = new DateTime(1970, 1, 1, 0, 0, 0);
            env.Setup_Simulation();
            env.Simulate();
            ///////
        }
Exemple #16
0
 public static void Death()
 {
     death++;
     Console.Clear();
     if (death > 2)
     {
         Console.Clear();
         Utilities.ColourText(Colour.MONSTER, $"You were the last of the {Create.p.family.LastName}s.\nYour bloodline ends here");
         Utilities.Keypress();
         GameOver();
     }
     Utilities.ColourText(Colour.MONSTER, "YOU DIED! Hopefully one of your family members can carry on for you");
     Utilities.Keypress();
     if (death == 1)
     {
         Create.Character2Create();
     }
     else
     {
         Create.Character3Create();
     }
 }
 public void SaveItem(EmployeeModel updatedModel)
 {
     this.newModel = updatedModel;
     if (RecordExists() && IsItemUpdated())
     {
         updatedModel.ID = thisModel.ID;
         Update.Employee(updatedModel);
         helper.MessageDialog("Employee data has been updated successfully!",
                              updatedModel.FullName);
     }
     else if (RecordExists() == true && IsItemUpdated() == false)
     {
         helper.MessageDialog("Save failed! There are no changes identified.",
                              updatedModel.FullName);
     }
     else
     {
         Create.Employee(updatedModel);
         helper.MessageDialog("Employee data has been added successfully!",
                              updatedModel.FullName);
     }
 }
Exemple #18
0
        public void allocation_on_creditnote()
        {
            var creditNote = new CreditNotes.CreditNotesTest().Given_an_authorised_creditnote();
            var invoice    = new Create().Given_an_authorised_invoice();
            var expected   = Math.Min(creditNote.Total, invoice.Total.GetValueOrDefault());

            Api.Allocations.Add(new Allocation
            {
                AppliedAmount = expected,
                CreditNote    = new CreditNote {
                    Id = creditNote.Id
                },
                Invoice = new Invoice {
                    Id = invoice.Id
                }
            });

            creditNote = Api.CreditNotes.Find(creditNote.Id);

            Assert.AreEqual(1, creditNote.Allocations.Count);
            Assert.AreEqual(expected, creditNote.Allocations.First().Amount);
        }
Exemple #19
0
        public static Core.GasMaterial ToSAM(this EnergyWindowMaterialGas energyWindowMaterialGas)
        {
            if (energyWindowMaterialGas == null)
            {
                return(null);
            }

            DefaultGasType defaultGasType = Query.DefaultGasType(energyWindowMaterialGas.GasType);

            Core.GasMaterial result = Create.GasMaterial(
                energyWindowMaterialGas.Identifier,
                energyWindowMaterialGas.GetType().Name,
                energyWindowMaterialGas.DisplayName,
                energyWindowMaterialGas.GasType.ToString(),
                energyWindowMaterialGas.Thickness,
                double.NaN,
                energyWindowMaterialGas.UValue,
                defaultGasType
                );

            return(result);
        }
Exemple #20
0
        public override void Up()
        {
            Create.Table(TableName)
            .WithColumn("id").AsString(36).NotNullable().PrimaryKey()
            .WithColumn("account_id").AsString(36).Nullable()
            .WithColumn("name").AsString().Nullable()
            .WithColumn("email").AsString().Nullable()
            .WithColumn("phone").AsString().Nullable()
            .WithColumn("created_date").AsDateTime().NotNullable()
            .WithColumn("updated_date").AsDateTime().NotNullable()
            .WithColumn("deleted_date").AsDateTime().Nullable();

            Create.Index("IX_profile_email")
            .OnTable(TableName)
            .OnColumn("email")
            .Ascending().WithOptions().NonClustered();

            Create.Index("IX_profile_account_id")
            .OnTable(TableName)
            .OnColumn("account_id")
            .Ascending().WithOptions().NonClustered();
        }
        public override void Up()
        {
            Create.Table("AbpTenants")
            .WithIdAsInt32()
            .WithColumn("TenancyName").AsString(32).NotNullable()
            .WithColumn("Name").AsString(128).NotNullable()
            .WithCreationTimeColumn();

            Create.Index("AbpTenants_TenancyName")
            .OnTable("AbpTenants")
            .OnColumn("TenancyName").Ascending()
            .WithOptions().Unique()
            .WithOptions().NonClustered();

            //Default tenant
            Insert.IntoTable("AbpTenants").Row(
                new
            {
                TenancyName = "Default",     //Reserved TenancyName
                Name        = "Default"
            });
        }
Exemple #22
0
        public override void Up()
        {
            // don't execute if the column is already there
            var columns = SqlSyntax.GetColumnsInSchema(Context.Database).ToArray();

            if (columns.Any(x => x.TableName.InvariantEquals("cmsPropertyTypeGroup") && x.ColumnName.InvariantEquals("uniqueID")) == false)
            {
                Create.Column("uniqueID").OnTable("cmsPropertyTypeGroup").AsGuid().NotNullable().WithDefault(SystemMethods.NewGuid);

                // unique constraint on name + version
                Create.Index("IX_cmsPropertyTypeGroupUniqueID").OnTable("cmsPropertyTypeGroup")
                .OnColumn("uniqueID").Ascending()
                .WithOptions()
                .NonClustered()
                .WithOptions()
                .Unique();

                // fill in the data in a way that is consistent over all environments
                // (ie cannot use random guids, http://issues.umbraco.org/issue/U4-6942)
                Execute.Code(UpdateGuids);
            }
        }
Exemple #23
0
 public void SaveItem(InventoryModel updatedModel)
 {
     this.newModel = updatedModel;
     if (RecordExists() && IsItemUpdated())
     {
         updatedModel.ItemCode = thisModel.ItemCode;
         Update.Inventory(updatedModel);
         helper.MessageDialog("Employee data has been updated successfully!",
                              updatedModel.Description);
     }
     else if (RecordExists() == true && IsItemUpdated() == false)
     {
         helper.MessageDialog("Save failed! There are no changes identified.",
                              updatedModel.Description);
     }
     else
     {
         Create.Inventory(updatedModel);
         helper.MessageDialog("Employee data has been added successfully!",
                              updatedModel.Description);
     }
 }
        /*******************************************/
        /**** Private Methods                   ****/
        /*******************************************/

        private MethodBase GetMethod(string methodName, string typeName, List <string> paramTypesJson)
        {
            List <Type> types = paramTypesJson.Select(x => Convert.FromJson(x)).Cast <Type>().ToList();

            MethodBase   method = null;
            BsonDocument typeDocument;

            if (BsonDocument.TryParse(typeName, out typeDocument) && typeDocument.Contains("Name"))
            {
                typeName = typeDocument["Name"].AsString;
                foreach (Type type in Reflection.Create.AllTypes(typeName))
                {
                    method = Create.MethodBase(type, methodName, types); // type overload
                    if (method != null)
                    {
                        return(method);
                    }
                }
            }

            return(method);
        }
Exemple #25
0
        public async Task Scaffolding_HTML_trydotnet_js_autoEnable_useBlazor_is_true_when_package_is_not_specified_and_supports_wasmrunner()
        {
            var(name, addSource) = await Create.NupkgWithBlazorEnabled("packageName");

            using (var dir = DisposableDirectory.Create())
            {
                var text = $@"
```cs --package {name}
```";

                var path = Path.Combine(dir.Directory.FullName, "BlazorTutorial.md");
                File.WriteAllText(path, text);

                var startupOptions = new StartupOptions(
                    rootDirectory: new FileSystemDirectoryAccessor(dir.Directory),
                    addPackageSource: new WorkspaceServer.PackageSource(addSource.FullName));

                using (var agent = new AgentService(startupOptions))
                {
                    var response = await agent.GetAsync(@"/BlazorTutorial.md");

                    response.Should().BeSuccessful();

                    var html = await response.Content.ReadAsStringAsync();

                    var document = new HtmlDocument();
                    document.LoadHtml(html);

                    var scripts = document.DocumentNode
                                  .Descendants("body")
                                  .Single()
                                  .Descendants("script")
                                  .Select(s => s.InnerHtml);

                    scripts.Should()
                    .Contain(s => s.Contains(@"trydotnet.autoEnable({ apiBaseAddress: new URL(""http://localhost""), useWasmRunner: true });"));
                }
            }
        }
Exemple #26
0
 public override void Up()
 {
     if (!Schema.Table("PartialVoidRequestDetails").Exists())
     {
         Create.Table("PartialVoidRequestDetails")
         .WithColumn("Id").AsInt64().PrimaryKey().Identity()
         .WithColumn("BarcodeNumber").AsString(80)
         .WithColumn("RequestDateTimeUTC").AsDateTime()
         .WithColumn("IsPartialVoid").AsBoolean()
         .WithColumn("PartialVoidDateTime").AsDateTime()
         .WithColumn("IsEnabled").AsBoolean()
         .WithColumn("CreatedUtc").AsDateTime()
         .WithColumn("UpdatedUtc").AsDateTime().Nullable()
         .WithColumn("CreatedBy").AsGuid()
         .WithColumn("UpdatedBy").AsGuid().Nullable()
         .WithColumn("Reason").AsString(80);
     }
     if (!Schema.Table("BoxofficeUserAdditionalDetails").Column("CountryId").Exists())
     {
         Alter.Table("BoxofficeUserAdditionalDetails").AddColumn("CountryId").AsInt64().ForeignKey("Countries", "Id").Nullable();
     }
     if (!Schema.Table("TicketRefundDetails").Exists())
     {
         Create.Table("TicketRefundDetails")
         .WithColumn("Id").AsInt64().PrimaryKey().Identity()
         .WithColumn("BarcodeNumber").AsString(80)
         .WithColumn("TransactionId ").AsInt64()
         .WithColumn("RefundedAmount ").AsDecimal()
         .WithColumn("IsEnabled").AsBoolean()
         .WithColumn("CreatedUtc").AsDateTime()
         .WithColumn("UpdatedUtc").AsDateTime().Nullable()
         .WithColumn("CreatedBy").AsGuid()
         .WithColumn("UpdatedBy").AsGuid().Nullable()
         .WithColumn("ExchangedAmount ").AsDecimal()
         .WithColumn("ExchangedId ").AsInt64()
         .WithColumn("ActionTypeId ").AsInt16()
         .WithColumn("IsExchanged").AsBoolean();
     }
 }
 public override void Up()
 {
     //add centre self assessments table:
     Create.Table("CentreSelfAssessments")
     .WithColumn("CentreID").AsInt32().NotNullable().PrimaryKey().ForeignKey("Centres", "CentreID")
     .WithColumn("SelfAssessmentID").AsInt32().NotNullable().PrimaryKey().ForeignKey("SelfAssessments", "ID")
     .WithColumn("AllowEnrolment").AsBoolean().NotNullable().WithDefaultValue(false);
     //add centre learning portal URL field:
     Alter.Table("Centres")
     .AddColumn("LearningPortalUrl").AsString(100).Nullable();
     //add enrolment method etc to CandidateAssessments
     Alter.Table("CandidateAssessments")
     .AddColumn("LaunchCount").AsInt32().NotNullable().WithDefaultValue(0)
     .AddColumn("CompletedDate").AsDateTime().Nullable()
     .AddColumn("RemovedDate").AsDateTime().Nullable()
     .AddColumn("RemovalMethodID").AsInt32().NotNullable().WithDefaultValue(1)
     .AddColumn("EnrolmentMethodId").AsInt32().NotNullable().WithDefaultValue(1)
     .AddColumn("EnrolledByAdminId").AsInt32().Nullable()
     .AddColumn("SupervisorAdminId").AsInt32().Nullable()
     .AddColumn("OneMonthReminderSent").AsBoolean().NotNullable().WithDefaultValue(false)
     .AddColumn("ExpiredReminderSent").AsBoolean().NotNullable().WithDefaultValue(false);
 }
 public static Command ToolInstall()
 {
     return(Create.Command("install",
                           LocalizableStrings.CommandDescription,
                           Accept.ExactlyOneArgument(errorMessage: o => LocalizableStrings.SpecifyExactlyOnePackageId)
                           .With(name: LocalizableStrings.PackageIdArgumentName,
                                 description: LocalizableStrings.PackageIdArgumentDescription),
                           Create.Option(
                               "-g|--global",
                               LocalizableStrings.GlobalOptionDescription,
                               Accept.NoArguments()),
                           Create.Option(
                               "--tool-path",
                               LocalizableStrings.ToolPathOptionDescription,
                               Accept.ExactlyOneArgument()
                               .With(name: LocalizableStrings.ToolPathOptionName)),
                           Create.Option(
                               "--version",
                               LocalizableStrings.VersionOptionDescription,
                               Accept.ExactlyOneArgument()
                               .With(name: LocalizableStrings.VersionOptionName)),
                           Create.Option(
                               "--configfile",
                               LocalizableStrings.ConfigFileOptionDescription,
                               Accept.ExactlyOneArgument()
                               .With(name: LocalizableStrings.ConfigFileOptionName)),
                           Create.Option(
                               "--add-source",
                               LocalizableStrings.AddSourceOptionDescription,
                               Accept.OneOrMoreArguments()
                               .With(name: LocalizableStrings.AddSourceOptionName)),
                           Create.Option(
                               "--framework",
                               LocalizableStrings.FrameworkOptionDescription,
                               Accept.ExactlyOneArgument()
                               .With(name: LocalizableStrings.FrameworkOptionName)),
                           CommonOptions.HelpOption(),
                           CommonOptions.VerbosityOption()));
 }
Exemple #29
0
        public async Task Demo_project_passes_verification()
        {
            var console = new TestConsole();

            var outputDirectory = Create.EmptyWorkspace().Directory;
            var packageFile     = outputDirectory.Subdirectory("Snippets")
                                  .File("Snippets.csproj");

            await DemoCommand.Do(new DemoOptions(output : outputDirectory), console);

            var resultCode = await VerifyCommand.Do(
                new VerifyOptions(dir : outputDirectory),
                console,
                () => new FileSystemDirectoryAccessor(outputDirectory),
                new PackageRegistry(),
                startupOptions : new StartupOptions(package : packageFile.FullName));

            _output.WriteLine(console.Out.ToString());
            _output.WriteLine(console.Error.ToString());

            resultCode.Should().Be(0);
        }
Exemple #30
0
        public static Core.GasMaterial ToSAM_GasMaterial(this EnergyMaterial energyMaterial)
        {
            if (energyMaterial == null)
            {
                return(null);
            }

            DefaultGasType defaultGasType = Analytical.Query.DefaultGasType(energyMaterial.Identifier, energyMaterial.DisplayName);

            Core.GasMaterial result = Create.GasMaterial(
                energyMaterial.Identifier,
                energyMaterial.GetType().Name,
                energyMaterial.DisplayName,
                null,
                energyMaterial.Thickness,
                double.NaN,
                energyMaterial.Thickness / energyMaterial.Conductivity,
                defaultGasType
                );

            return(result);
        }
Exemple #31
0
        public override void Up()
        {
            const string tableName     = "PageBlock";
            const string blockIdColumn = "BlockId";
            const string pageIdColumn  = "PageId";

            Create.Table(tableName)
            .WithColumn("Id").AsGuid().NotNullable().PrimaryKey()
            .WithColumn(blockIdColumn).AsGuid().NotNullable()
            .WithColumn(pageIdColumn).AsGuid().NotNullable()
            .WithColumn("SortOrder").AsInt32().NotNullable()
            .WithColumn("ParentId").AsGuid().Nullable()
            ;
            Create.Index($"IDX_{tableName}_{blockIdColumn}")
            .OnTable(tableName)
            .OnColumn(blockIdColumn)
            ;
            Create.Index($"IDX_{tableName}_{pageIdColumn}")
            .OnTable(tableName)
            .OnColumn(pageIdColumn)
            ;
        }
Exemple #32
0
    internal static void Start()
    {
        Console.Clear();
        Write.Line(35, 5, Color.DAMAGE + "  ____ _           _ _       _             ");
        Write.Line(35, 6, Color.DAMAGE + " / ___| | __ _  __| (_) __ _| |_ ___  _ __ ");
        Write.Line(35, 7, Color.DAMAGE + "| |  _| |/ _` |/ _` | |/ _` | __/ _ \\| '__|");
        Write.Line(35, 8, Color.DAMAGE + "| |_| | | (_| | (_| | | (_| | || (_) | |   ");
        Write.Line(35, 9, Color.DAMAGE + " \\____|_|\\__,_|\\__,_|_|\\__,_|\\__\\___/|_|   ");
        Write.Line(35, 10, Color.DAMAGE + "                                           ");
        Write.Line(35, 12, Color.HEALTH + " __  __                                    ");
        Write.Line(35, 13, Color.HEALTH + "|  \\/  | __ _ _ __   __ _  __ _  ___ _ __  ");
        Write.Line(35, 14, Color.HEALTH + "| |\\/| |/ _` | '_ \\ / _` |/ _` |/ _ \\ '__| ");
        Write.Line(35, 15, Color.HEALTH + "| |  | | (_| | | | | (_| | (_| |  __/ |    ");
        Write.Line(35, 16, Color.HEALTH + "|_|  |_|\\__,_|_| |_|\\__,_|\\__, |\\___|_|    ");
        Write.Line(35, 17, Color.HEALTH + "                           |___/           ");
        Write.Line(0, Console.WindowHeight - 4, Color.RESET + "[1] New Game");
        //Write.Line(0, Console.WindowHeight - 3, "[2] Load Game");
        Write.Line(0, Console.WindowHeight - 2, "[0] Quit");
        Write.Line(100, Console.WindowHeight - 2, "Version 0.40");
        string choice = Return.Option();

        Console.Clear();
        if (choice == "1")
        {
            Create.Player();
            Create.Opponents();
            Hub.Start();
        }
        //if (choice == "2")
        //{
        //    Write.Line("Not implemented");
        //    Write.KeyPress(0, Console.WindowHeight - 2);
        //}
        if (choice == "0")
        {
            Environment.Exit(0);
        }
        Start();
    }
Exemple #33
0
        /// <summary>
        /// Creates the content options types table.
        /// </summary>
        private void CreateContentOptionsTypesTable()
        {
            Create
            .Table("ContentOptionTypes")
            .InSchema(SchemaName)
            .WithColumn("Id").AsInt32().PrimaryKey()
            .WithColumn("Name").AsString(MaxLength.Name).NotNullable();

            Create
            .UniqueConstraint("UX_Cms_ContentOptionTypes_Name")
            .OnTable("ContentOptionTypes").WithSchema(SchemaName)
            .Column("Name");

            Insert
            .IntoTable("ContentOptionTypes")
            .InSchema(SchemaName)
            .Row(new
            {
                Id   = 1,
                Name = "Text"
            });
        }
Exemple #34
0
 public override void Up()
 {
     if (!Schema.Table <Language>().Exists())
     {
         Create.Table <Language>().
         WithColumn((Language x) => x.IdLanguage).AsInt32().NotNullable().PrimaryKey().Identity().
         WithColumn((Language x) => x.NameLanguage).AsString(200).NotNullable().
         WithColumn((Language x) => x.ShortAlias).AsString(20).NotNullable().
         WithColumn((Language x) => x.IsDefault).AsInt32().NotNullable().
         WithColumn((Language x) => x.TemplatesPath).AsString(200).NotNullable().
         WithColumn((Language x) => x.Culture).AsString(20).NotNullable().WithDefaultValue("");
     }
     else
     {
         AddColumnIfNotExists(Schema, (Language x) => x.IdLanguage, x => x.AsInt32().NotNullable().PrimaryKey().Identity());
         AddColumnIfNotExists(Schema, (Language x) => x.NameLanguage, x => x.AsString(200).NotNullable());
         AddColumnIfNotExists(Schema, (Language x) => x.ShortAlias, x => x.AsString(20).NotNullable());
         AddColumnIfNotExists(Schema, (Language x) => x.TemplatesPath, x => x.AsString(200).NotNullable());
         AddColumnIfNotExists(Schema, (Language x) => x.TemplatesPath, x => x.AsInt32().NotNullable());
         AddColumnIfNotExists(Schema, (Language x) => x.Culture, x => x.AsString(20).NotNullable().WithDefaultValue(""));
     }
 }
        private void CreateForeignKeys()
        {
            Create.ForeignKey()
            .FromTable("CalendarItems").ForeignColumn("ConferenceId")
            .ToTable("Conferences").PrimaryColumn("ConferenceId");

            Create.ForeignKey()
            .FromTable("Sessions").ForeignColumn("ConferenceId")
            .ToTable("Conferences").PrimaryColumn("ConferenceId");

            Create.ForeignKey()
            .FromTable("Votes").ForeignColumn("UserId")
            .ToTable("UserProfiles").PrimaryColumn("UserId");

            Create.ForeignKey()
            .FromTable("webpages_UsersInRoles").ForeignColumn("UserId")
            .ToTable("UserProfiles").PrimaryColumn("UserId");

            Create.ForeignKey()
            .FromTable("webpages_UsersInRoles").ForeignColumn("RoleId")
            .ToTable("webpages_Roles").PrimaryColumn("RoleId");
        }
Exemple #36
0
        public override void Up()
        {
            if (Schema.Table("Account").Exists())
            {
                return;
            }

            Create.Table("Account")
            .WithColumn("Account Name").AsAnsiString(100).Nullable()
            .WithColumn("OpeningBalance").AsCurrency().Nullable();

            Create.Table("Transactions")
            .WithColumn("Date").AsDateTime().Nullable()
            .WithColumn("Description").AsAnsiString(255).Nullable()
            .WithColumn("Original Description").AsAnsiString(255).Nullable()
            .WithColumn("Amount").AsCurrency().Nullable()
            .WithColumn("Transaction Type").AsAnsiString(50).Nullable()
            .WithColumn("Category").AsAnsiString(50).Nullable()
            .WithColumn("Account Name").AsAnsiString(50).Nullable()
            .WithColumn("Labels").AsAnsiString(50).Nullable()
            .WithColumn("Notes").AsAnsiString(50).Nullable();
        }
Exemple #37
0
        public static void Main()
        {
            var e         = new Create(Tuple.Create);
            var listEdge1 = new List <MyTuple>()
            {
                e(0, 1, 5), e(0, 2, 3), e(1, 2, 1)
            };
            var listEdge2 = new List <MyTuple>()
            {
                e(0, 1, 5), e(0, 2, 1), e(0, 4, 2), e(1, 2, 3), e(2, 3, 4), e(3, 4, 11)
            };
            var listEdge3 = new List <MyTuple>()
            {
                e(0, 1, 6), e(0, 2, 8), e(0, 3, 5), e(0, 4, 5), e(0, 5, 4), e(1, 2, 7), e(1, 3, 7), e(1, 4, 6),
                e(1, 5, 2), e(2, 3, 5), e(2, 4, 10), e(2, 5, 10), e(3, 4, 7), e(3, 5, 10), e(4, 5, 3)
            };
            var listEdge4 = new List <MyTuple>()
            {
                e(0, 1, 5), e(0, 6, 3), e(0, 5, 9), e(1, 6, 4), e(1, 7, 2), e(1, 2, 9), e(2, 7, 9), e(2, 8, 7), e(2, 9, 5),
                e(2, 3, 4), e(3, 9, 1), e(3, 4, 4), e(4, 9, 3), e(4, 8, 10), e(4, 5, 18), e(5, 8, 8), e(5, 6, 9), e(6, 7, 2), e(6, 8, 9), e(7, 8, 8), e(8, 9, 9)
            };
            var listEdge5 = new List <MyTuple>()
            {
                e(0, 1, 3), e(1, 2, 4), e(1, 19, 12), e(19, 20, 13), e(1, 18, 7), e(15, 18, 1), e(2, 3, 5), e(3, 17, 8), e(17, 16, 7), e(3, 4, 3), e(4, 5, 4),
                e(5, 6, 1), e(6, 7, 8), e(7, 8, 7), e(8, 9, 6), e(9, 10, 5), e(8, 11, 4), e(11, 12, 1), e(12, 13, 8), e(13, 14, 9)
            };
            var l = new List <MyTuple>()
            {
                e(0, 1, 1), e(1, 4, 2), e(0, 3, 7), e(0, 5, 4), e(0, 4, 3), e(2, 3, 9), e(2, 5, 5), e(2, 4, 6), e(3, 4, 8), e(3, 5, 10)
            };
            var mst = new List <MyTuple>();
            var n   = l.Select((x) => Math.Max(x.Item1, x.Item2)).ToList().Max() + 1;

            PrimAlg(n, l, mst);
            foreach (var edge in mst)
            {
                Console.WriteLine("(" + edge.Item1 + "-" + edge.Item2 + ")" + " " + edge.Item3);
            }
        }
Exemple #38
0
        private void CriarTabelaInscricao()
        {
            Create
            .Table("INSCRICOES")
            .WithColumn("ID_INSCRICAO").AsInt32().PrimaryKey().Identity()
            .WithColumn("TIPO_INSCRICAO").AsString(30).NotNullable()
            .WithColumn("CONFIRMADO").AsBoolean().NotNullable()
            .WithColumn("DATA_RECEBIMENTO").AsDate().NotNullable()
            .WithColumn("DORMIRA").AsBoolean().NotNullable()
            .WithColumn("ID_EVENTO").AsInt32().NotNullable()
            .ForeignKey("FK_INSC_EVENTO", "EVENTOS", "ID_EVENTO").OnDelete(Rule.Cascade).OnUpdate(Rule.Cascade)
            .WithColumn("INSTITUICOES_ESPIRITAS_FREQ").AsString(300).Nullable()
            .WithColumn("NOME_CRACHA").AsString(150).Nullable()
            .WithColumn("NOME_RESP_CENTRO").AsString(150).Nullable()
            .WithColumn("NOME_RESP_LEGAL").AsString(150).Nullable()
            .WithColumn("OBSERVACOES").AsString(Int32.MaxValue).Nullable()
            .WithColumn("ID_PESSOA").AsInt32().NotNullable()
            .ForeignKey("FK_INSC_PESSOA", "PESSOAS", "ID_PESSOA").OnDelete(Rule.Cascade).OnUpdate(Rule.Cascade)
            .WithColumn("PRIMEIRO_ENCONTRO").AsBoolean().NotNullable()
            .WithColumn("SITUACAO").AsInt16().NotNullable()
            .WithColumn("TELEFONE_RESP_CENTRO").AsString(15).Nullable()
            .WithColumn("TELEFONE_RESP_LEGAL").AsString(15).Nullable()
            .WithColumn("TEMPO_ESPIRITA").AsString(20).Nullable()
            .WithColumn("ID_INSC_RESPONSAVEL_1").AsInt32().Nullable()
            .ForeignKey("FK_INSC_INF_1", "INSCRICOES", "ID_INSCRICAO").OnDelete(Rule.Cascade).OnUpdate(Rule.Cascade)
            .WithColumn("ID_INSC_RESPONSAVEL_2").AsInt32().Nullable()
            .ForeignKey("FK_INSC_INF_2", "INSCRICOES", "ID_INSCRICAO").OnDelete(Rule.Cascade).OnUpdate(Rule.Cascade)
            .WithColumn("TIPO").AsInt16().Nullable()
            .WithColumn("FORMA_PAGAMENTO").AsInt16().Nullable()
            .WithColumn("OBS_PAGAMENTO").AsString(Int32.MaxValue).Nullable();

            Create
            .Table("PAGAMENTO_INSCRICAO_COMPROVANTES")
            .WithColumn("ID_PAG_INSC_COMPROVANTES").AsInt32().PrimaryKey().Identity()
            .WithColumn("ID_ARQUIVO").AsInt32()
            .ForeignKey("FK_PAGINSC_ARQ", "ARQUIVOS_BINARIOS", "ID_ARQUIVO").OnDelete(Rule.Cascade).OnUpdate(Rule.Cascade)
            .WithColumn("ID_INSCRICAO").AsInt32()
            .ForeignKey("FK_PAGINSC_INSC", "INSCRICOES", "ID_INSCRICAO").OnDelete(Rule.Cascade).OnUpdate(Rule.Cascade);
        }
Exemple #39
0
        public void MergeFrom(KeywordPlanAdGroupOperation other)
        {
            if (other == null)
            {
                return;
            }
            if (other.updateMask_ != null)
            {
                if (updateMask_ == null)
                {
                    UpdateMask = new global::Google.Protobuf.WellKnownTypes.FieldMask();
                }
                UpdateMask.MergeFrom(other.UpdateMask);
            }
            switch (other.OperationCase)
            {
            case OperationOneofCase.Create:
                if (Create == null)
                {
                    Create = new global::Google.Ads.GoogleAds.V4.Resources.KeywordPlanAdGroup();
                }
                Create.MergeFrom(other.Create);
                break;

            case OperationOneofCase.Update:
                if (Update == null)
                {
                    Update = new global::Google.Ads.GoogleAds.V4.Resources.KeywordPlanAdGroup();
                }
                Update.MergeFrom(other.Update);
                break;

            case OperationOneofCase.Remove:
                Remove = other.Remove;
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
Exemple #40
0
 private void CriarTabelaEventos()
 {
     Create.Table("EVENTOS")
     .WithColumn("ID_EVENTO").AsInt32().PrimaryKey().Identity()
     .WithColumn("NOME").AsString(250).NotNullable()
     .WithColumn("DATA_INICIO_INSC").AsDateTime().NotNullable()
     .WithColumn("DATA_FIM_INSC").AsDateTime().NotNullable()
     .WithColumn("DATA_INICIO_EVENTO").AsDateTime().NotNullable()
     .WithColumn("DATA_FIM_EVENTO").AsDateTime().NotNullable()
     .WithColumn("DATA_REGISTRO").AsDateTime().NotNullable()
     .WithColumn("ID_ARQUIVO_LOGOTIPO").AsInt32().Nullable()
     .ForeignKey("FK_EVENTO_ARQBIN", "ARQUIVOS_BINARIOS", "ID_ARQUIVO").OnDelete(Rule.Cascade).OnUpdate(Rule.Cascade)
     .WithColumn("TEM_DEPARTAMENTALIZACAO").AsBoolean().NotNullable()
     .WithColumn("MODELO_DIV_SL_ESTUDO").AsInt16().Nullable()
     .WithColumn("TEM_OFICINAS").AsBoolean().NotNullable()
     .WithColumn("TEM_DORMITORIOS").AsBoolean().NotNullable()
     .WithColumn("PUBLICO_EVANGELIZACAO").AsInt16().Nullable()
     .WithColumn("TEMPO_SARAU_MIN").AsInt32().Nullable()
     .WithColumn("IDADE_MINIMA_INSC_ADULTO").AsInt32().NotNullable()
     .WithColumn("VALOR_INSC_ADULTO").AsDecimal(6, 2).NotNullable()
     .WithColumn("VALOR_INSC_CRIANCA").AsDecimal(6, 2).NotNullable();
 }
Exemple #41
0
        public override void Up()
        {
            Create.Table("TaskAttributes")
            .WithColumn("Id").AsGuid().NotNullable()
            .WithColumn("AccountId").AsGuid().NotNullable()
            .WithColumn("Type").AsByte().NotNullable()
            .WithColumn("Key").AsString().NotNullable()
            .WithColumn("IsDeleted").AsBoolean().NotNullable()
            .WithColumn("CreateDateTime").AsDateTime2().NotNullable()
            .WithColumn("ModifyDateTime").AsDateTime2().Nullable();

            Create.PrimaryKey("PK_TaskAttributes_Id").OnTable("TaskAttributes")
            .Columns("Id");

            Create.UniqueConstraint("UQ_TaskAttributes_AccountId_Key").OnTable("TaskAttributes")
            .Columns("AccountId", "Key");

            Create.Index("IX_TaskAttributes_AccountId_CreateDateTime").OnTable("TaskAttributes")
            .OnColumn("AccountId").Ascending()
            .OnColumn("CreateDateTime").Descending()
            .WithOptions().NonClustered();
        }
Exemple #42
0
        public void SpecifyDefaultScheduler()
        {
            // Arrange
            _binder = Create.Binder(_viewModel);
            var task = new Task <int>(() => 5);

            _viewModel.MyObservable = task.ToObservable();

            var    bindingThread = Thread.CurrentThread;
            Thread actionThread  = null;

            _binder.Observe(_viewModel.MyObservable).Subscribe(x => actionThread = Thread.CurrentThread);

            // Act
            task.Start();
            task.Wait();

            ConditionalWait.WaitFor(() => actionThread != null);

            // Assert
            Assert.That(actionThread, Is.Not.SameAs(bindingThread));
        }
Exemple #43
0
        public async Task Can_serve_from_webassembly_controller()
        {
            var(name, addSource) = await Create.NupkgWithBlazorEnabled();

            using (var agent = new AgentService(new StartupOptions(addPackageSource: new WorkspaceServer.PackageSource(addSource.FullName))))
            {
                var response = await agent.GetAsync($@"/LocalCodeRunner/{name}");

                response.EnsureSuccess();
                var result = await response.Content.ReadAsStringAsync();

                result.Should().Contain("Loading...");

                response = await agent.GetAsync($@"/LocalCodeRunner/{name}/interop.js");

                response.EnsureSuccess();
                result = await response.Content.ReadAsStringAsync();

                result.Should().Contain("DotNet.invokeMethodAsync");
            }

            // Now do the same thing in hosted mode using the already installed package
            using (var agent = new AgentService(StartupOptions.FromCommandLine("hosted")))
            {
                var response = await agent.GetAsync($@"/LocalCodeRunner/{name}");

                response.EnsureSuccess();
                var result = await response.Content.ReadAsStringAsync();

                result.Should().Contain("Loading...");

                response = await agent.GetAsync($@"/LocalCodeRunner/{name}/interop.js");

                response.EnsureSuccess();
                result = await response.Content.ReadAsStringAsync();

                result.Should().Contain("DotNet.invokeMethodAsync");
            }
        }
        private IFormula getTotalFractionOfDoseFormula(IObserverBuildingBlock observerBuildingBlock, Compound compound, string fractionOfDoseObserverName)
        {
            var formulaName = $"TotalFractionOfDose_{compound.Name}";

            if (observerBuildingBlock.FormulaCache.Contains(formulaName))
            {
                return(observerBuildingBlock.FormulaCache[formulaName]);
            }

            var sumFormula = _objectBaseFactory.Create <SumFormula>()
                             .WithName(formulaName)
                             .WithDimension(_dimensionRepository.Fraction);

            //This will collect all observer named 'fractionOfDoseObserverName' for the molecule where the observer is defined.
            sumFormula.Criteria = Create.Criteria(x => x.With(ObjectPathKeywords.MOLECULE));
            sumFormula.Variable = "M";
            sumFormula.AddObjectPath(createTotalDrugMassObjectPath(compound.Name));
            sumFormula.FormulaString = $"({TOTAL_DRUG_MASS_ALIAS} > 0 ? {sumFormula.VariablePattern}/{TOTAL_DRUG_MASS_ALIAS} : 0)";

            observerBuildingBlock.AddFormula(sumFormula);
            return(sumFormula);
        }
Exemple #45
0
        public override void Up()
        {
            Create.Table(Names.Tables.ZipCode)
            .InSchema(Names.Schemas.VideoStore)
            .WithColumn("ZipCode").AsString(5).PrimaryKey()
            .WithColumn("City").AsString(50).NotNullable()
            .WithColumn("State").AsString(50).NotNullable();

            Create.Table(Names.Tables.Area)
            .InSchema(Names.Schemas.VideoStore)
            .WithColumn("AreaID").AsInt64().Identity().PrimaryKey()
            .WithColumn("Name").AsString(100).NotNullable();

            Create.Table(Names.Tables.AreaZipCode)
            .InSchema(Names.Schemas.VideoStore)
            .WithColumn("AreaID").AsInt64().NotNullable()
            .WithColumn("ZipCode").AsString(5).NotNullable();

            Create.PrimaryKey(Names.Tables.AreaZipCode + "PK")
            .OnTable(Names.Tables.AreaZipCode)
            .WithSchema(Names.Schemas.VideoStore)
            .Columns(new string[] { "AreaID", "ZipCode" });

            Create.ForeignKey("AreaZipCodeToZipCode")
            .FromTable(Names.Tables.AreaZipCode)
            .InSchema(Names.Schemas.VideoStore)
            .ForeignColumn("ZipCode")
            .ToTable(Names.Tables.ZipCode)
            .InSchema(Names.Schemas.VideoStore)
            .PrimaryColumn("ZipCode");

            Create.ForeignKey("AreaZipCodeToArea")
            .FromTable(Names.Tables.AreaZipCode)
            .InSchema(Names.Schemas.VideoStore)
            .ForeignColumn("AreaID")
            .ToTable(Names.Tables.Area)
            .InSchema(Names.Schemas.VideoStore)
            .PrimaryColumn("AreaID");
        }
 public void AddStaticPage(StaticPage staticPage)
 {
     var create = new Create();
     create.AddStaticPage(staticPage);
 }
Exemple #47
0
 /// <summary>
 /// Context Menu 右鍵->新增
 /// </summary>
 private void rmenuAdd_Click(object sender, RoutedEventArgs e)
 {
     // 每次編輯都要確認權限
     if (!CheckRankOrActivity())
     {
         return;
     }
     if(GlobalHelper.AdminItem.Activity)
     // 在本層新增
     if (lvwClassify.SelectedItems.Count == 0 || Convert.ToInt32(lvwClassify.Tag) == 5)
     {
         StringBuilder pathServer = new StringBuilder();
         StringBuilder pathId = new StringBuilder();
         pathServer.Append(_ftpPath);
         pathId.Append(_idPath);
         // ShowDialog
         Create getinput = new Create(400, 200, pathServer.ToString());
         getinput.ShowDialog();
         if (getinput.IsDone)
         {
             string newFileName = getinput.SystemName;
             string newNickName = getinput.NickName;
             pathServer.Append(newFileName);
             // 產生目錄寫入db
             CreateFolder(pathServer.ToString(), pathId.ToString(), newNickName);
         }
     }
     // 在下一層新增
     else if (_isTileView)
     {
         StringBuilder pathServer = new StringBuilder();
         StringBuilder pathId = new StringBuilder();
         pathServer.Append(_ftpPath);
         pathId.Append(_idPath);
         Tile item = lvwClassify.SelectedItem as Tile;
         Dictionary<string, string> tag = item.Tag as Dictionary<string, string>;
         pathServer.Append(tag["Name"]);
         pathId.Append(tag["Id"]);
         Create getInput = new Create(400, 200, pathServer.ToString());
         getInput.ShowDialog();
         string newFileName = "/" + getInput.SystemName;
         string newNickName = getInput.NickName;
         pathServer.Append(newFileName);
         // 產生目錄寫入db
         CreateFolder(pathServer.ToString(), pathId.ToString(), newNickName);
     }
 }
        public ActionResult Create(Create.Command command)
        {
            _mediator.Send(command);

            return this.RedirectToActionJson("Index");
        }
        public void AddNewCategory(Category category)
        {
            var create = new Create();

            create.AddNewCategory(category);
        }
Exemple #50
0
        Lox      Get( String name, Create create= Create.Never )
        {
            try { ALIB.Lock.Acquire();

                // search
                name= name.ToUpper();
                foreach( Lox it in loxes )
                    if( it.GetName().Equals( name ) )
                        return it;

                // create?
                if ( create == Create.IfNotExistent )
                {
                    Lox newLox= new Lox( name, false );
                    loxes.Add( newLox );
                    return newLox;
                }

                // not found
                return null;

            } finally { ALIB.Lock.Release(); }
        }
Exemple #51
0
    // Use this for initialization
    void Start()
    {
        this.penguinScript = this.GetComponent<PenguinAngleReturn>();

        this.phidgetSetting = GameObject.Find("GamePhidgetSetting").GetComponent<PhidgetSetting>();

        this.cloneSoundObject = (GameObject)Instantiate(this.SoundObject, this.transform.position, Quaternion.identity);
        this.gameSoundScript = this.cloneSoundObject.GetComponent<GameSound>();

        this.create = this.transform.parent.GetComponent<Create>();
    }
Exemple #52
0
 public void FromBin(NetSocket.ByteArray bin, twp.app.unit.CityOperateType type_)
 {
     switch (type_) {
     case twp.app.unit.CityOperateType.AREA_CITY_OPERATION_TYPE_CONSTRUCT:
         create = new Create ();
         create.FromBin (bin);
         break;
     default:
         //TDMacro.Assert (false, "Wrong CityOperateType, when parsing");
         break;
     }
 }
 public SafeAutomationEventHandler(IUIItem uiItem, UIItemEventListener eventListener, Create createUserEvent)
 {
     this.uiItem = uiItem;
     this.eventListener = eventListener;
     this.createUserEvent = createUserEvent;
 }
Exemple #54
0
	/// <summary>
	/// Create the specified font.
	/// </summary>

	static void ImportFont (UIFont font, Create create, Material mat)
	{
		// New bitmap font
		font.dynamicFont = null;
		BMFontReader.Load(font.bmFont, NGUITools.GetHierarchy(font.gameObject), NGUISettings.fontData.bytes);

		if (NGUISettings.atlas == null)
		{
			font.atlas = null;
			font.material = mat;
		}
		else
		{
			font.spriteName = NGUISettings.fontTexture.name;
			font.atlas = NGUISettings.atlas;
		}
		NGUISettings.FMSize = font.defaultSize;
	}
 public string[] Create(Create request)
 {
     var response = base.SendRequest<HostGroupIds>("hostgroup.create", request);
     return response.groupids;
 }
 public async Task<IActionResult> Create(Create.Command model)
 {
     await Mediator.SendAsync(model);
     return RedirectToAction("Index");
 }
 public async Task<ActionResult> Create(Create.Command command)
 {
     await _mediator.SendAsync(command);
     return View();
 }
        public void SetUp()
        {
            Createrepo = new Create();
            Readrepo = new Read();
            Deleterepo = new Delete();
            Updaterepo = new Update();
            dropdownrepo = new DropDown();

            userID = "b75da91b - e39a - 42ce - b2f0 - 4834eda139e1";
        }
        public void EditPost(Post post)
        {
            // Overwrite post with edited data
            var update = new Update();

            update.EditPost(post);

            // Delete all hashtags associated with post from PostsXTags table
            var delete = new Delete();

            delete.DeleteAllTagsByPostID(post.PostID);

            // Split up tags string from UI into individual hashtags. Then remove all # symbols.
            // Afterwards, only tags that contain characters are added to the HashTags list.
            if (post.Tags != null)
            {
                var hashtags = post.Tags.Replace("#", "").Split(',');

                foreach (var hashtag in hashtags)
                {
                    if (hashtag != "")
                    {
                        var p = new HashTag();

                        p.ActualHashTag = hashtag;
                        post.HashTags.Add(p);
                    }
                }
            }

            // Iterate: Check if hashtag is in Tags table. If not, create a new record in that table
            // before creating a new record in PostsXTags. Else, just create new record in PostsXTags.
            if (post.HashTags.Count() != 0)
            {
                var create = new Create();

                foreach (var tag in post.HashTags)
                {
                    create.AddTag((int)post.PostID, tag);
                }
            }
        }
Exemple #60
0
        /// <summary>
        /// 创建文件(夹)
        /// </summary>
        /// <param name="path">相对于root的路径,包含文件名</param>
        /// <returns></returns>
        public Create Create(string path)
        {
            PHPArray array = new PHPArray();
            array.Add("root", "app_folder");
            array.Add("path", path);

            string url = this.GetUrl(string.Format(GlobalURL.CREATEFOLDER, GlobalURL.Version), array);
            string result = this.Http_Get(url);
            if (result == null)
            {
                return null;
            }

            PHPArray json = Common.JsonToPHPArray(result);
            if (json == null)
            {
                this.ErrMsg = "无法解析Json数据";
                return null;
            }

            Create create = new Create(json);
            return create;
        }