var article = context.Articles.FirstOrDefault(p => p.ArticleId == ArticleId);
int countViews = article.newCountViews++;
context.Database.ExecuteSqlCommand("UPDATE dbo.Articles SET CountViews = {0} WHERE ArticleId = {1}", countViews , ArticleId);
.container{
margin-left:-15px;
margin-right:-15px;
}
.block {
padding:15px;
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
:after,:before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
// Начало и конец
var dates = [new Date(2016, 10, 29), new Date(2016, 11, 1)];
var pricesPerMonth = {
"10": 2000,
"11": 1500
};
// Расчет цены
var price = 0;
for (var i = dates[0].getTime(); i <= dates[1].getTime(); i += 86400 * 1000) {
var d = new Date(i);
var m = d.getMonth();
if (pricesPerMonth[m]) {
price += pricesPerMonth[m];
}
}
console.log(pricesPerMonth);
console.log(price);
<div id="parent">
<div class="first">
<input value="25" type="checkbox" checked>
<input value="50" type="checkbox" checked>
<input value="100" type="checkbox">
<input value="150" type="checkbox">
</div>
<div class="second">
<input value="25" type="checkbox">
<input value="50" type="checkbox">
<input value="100" type="checkbox" checked>
<input value="150" type="checkbox" checked>
</div>
</div>
var list = {};
$('#parent>div').each(function(ii,div){
list[$(div).attr('class')] = $.map($(div).find('input'),function(el){
if($(el).is(':checked')) return parseInt($(el).val());
});
});
console.log(list);
{
first: [25,50],
second: [100,150]
}
var list = '';
$('#parent>div').each(function(ii,div){
list += $(div).attr('class')+': ';
list += $.map($(div).find('input'),function(el){
if($(el).is(':checked')) return parseInt($(el).val());
}).join(', ')+'; ';
});
alert(list);
first: 25, 50; second: 100, 150;