// POST: odata/SteelArchStrainTables
        public async Task <IHttpActionResult> Post(Original_ConcreteStrainTable concreteStrainTable)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            db.Original_ConcreteStrains.Add(concreteStrainTable);
            await db.SaveChangesAsync();

            return(Created(concreteStrainTable));
        }
        private static async Task PostConcreteStrainDatas(DefaultContainer container, Random random)
        {
            const int startNumberOfConcreteStrainPoints = 79;
            const int endNumberOfConcreteStrainPoints   = 94;

            for (int i = startNumberOfConcreteStrainPoints; i <= endNumberOfConcreteStrainPoints; i++)
            {
                var newConcreteStrainData = new Original_ConcreteStrainTable()
                {
                    PointsNumberId = i,
                    Temperature    = random.Next(0, 35),
                    Time           = DateTime.Now,
                };
                if ((newConcreteStrainData.PointsNumberId == 79 || newConcreteStrainData.PointsNumberId == 91) && newConcreteStrainData.Time.Hour == 7 && newConcreteStrainData.Time.Minute == 35)
                {
                    newConcreteStrainData.Strain = -1100;
                }
                //设置混凝土拱肋上缘的应变值
                else if (newConcreteStrainData.PointsNumberId == 84 || newConcreteStrainData.PointsNumberId == 90)
                {
                    if ((newConcreteStrainData.Time.Hour == 7 || newConcreteStrainData.Time.Hour == 17) && newConcreteStrainData.Time.Minute == 17)
                    {
                        newConcreteStrainData.Strain = random.Next(-230, -50);//可能红色报警
                    }
                    else
                    {
                        newConcreteStrainData.Strain = random.Next(-175, -90);
                    }
                }
                else
                {
                    newConcreteStrainData.Strain = random.Next(-175, -90);
                }
                await AddOriginal_ConcreteStrainTableEntity(container, newConcreteStrainData);
            }
        }
 static async Task AddOriginal_ConcreteStrainTableEntity(DefaultContainer container, Original_ConcreteStrainTable entity)
 {
     container.AddToOriginal_ConcreteStrains(entity);
     await container.SaveChangesAsync();
 }