var getBatchOfPlayers = QueryOver.Of<PlayerInfoEntity>()
.Where(entity => entity.IsSimulation == player.IsSimulation && entity.Role.IsIn(roles))
.OrderBy(entity => entity.Login).Asc
.Select(entity => entity.Id) // Исправили Login на Id
.Skip(startOffset).Take(limit);
res = session.QueryOver<ItemsEntity>()
.WithSubquery.WhereProperty(entity => entity.Player.Id).In(getBatchOfPlayers) // Исправили Login на Id
.Cacheable().CacheMode(CacheMode.Normal)
.List().GroupBy(x => x.Player.Login)
.Select(ConvertSpecial)
.ToList();
BitmapDecoder decoder = BitmapDecoder.Create(detectDate, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
InPlaceBitmapMetadataWriter pngInplace = decoder.Frames[0].CreateInPlaceBitmapMetadataWriter();
private async void smartButton_Click(object sender, RoutedEventArgs e)
{
FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();
folderBrowserDialog.ShowDialog();
if (folderBrowserDialog.SelectedPath != "")
{
string selectedPath = folderBrowserDialog.SelectedPath;
folderBrowserDialog.Dispose();
string[] photos = Directory.GetFiles(selectedPath);
foreach (ModelGroupItem item in listGroupItem)
{
foreach (string photo in photos)
{
using (FileStream detectDate = File.Open(photo, FileMode.Open))
{
BitmapDecoder decoder = BitmapDecoder.Create(detectDate, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
InPlaceBitmapMetadataWriter pngInplace = decoder.Frames[0].CreateInPlaceBitmapMetadataWriter();
DateTime photoDate = DateTime.Parse(pngInplace.DateTaken); // Дата съемки
// Если фотография соответствует условиям, то перекидываем ее в папку
if (item.timeTo.TimeOfDay > photoDate.TimeOfDay &
item.timeFrom.TimeOfDay < photoDate.TimeOfDay &
photoDate.DayOfWeek.ToString() == item.day &
photoDate.Month == DateTime.Today.Month)
{
string StartDirectory = selectedPath; // Стартовая директория
string EndDirectory = item.path; // Конечная
// Освобождаем файл перед копированием
detectDate.Dispose();
using (FileStream imageStreamSource = File.Open(photo, FileMode.Open))
{
using (FileStream DestinationStream = File.Create(EndDirectory + photo.Substring(photo.LastIndexOf('\\'))))
{
await imageStreamSource.CopyToAsync(DestinationStream);
}
}
}
}
}
}
}
}
<Grid.Triggers>
<EventTrigger RoutedEvent="Grid.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard Name="rotateStoryBoardBegin">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Image" Storyboard.TargetProperty="RenderTransform.Angle"
To="180" Duration="0:0:0.4">
</DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<Grid.Triggers>
0 1 * * * bash /bin/bash /usr/share/script.sh >/dev/null 2>&1
0 2 * * * bash /bin/bash /usr/share/script2.sh >/dev/null 2>&1
* * * * 1 bash /bin/bash /usr/share/script3.sh >/dev/null 2>&1
#!/bin/bash
rsync --archive /home/share --delete /mnt/backup/neon_backup
rsync --archive /var/www/html/vtgr --delete /mnt/backup/neon_backup
#!/bin/bash
cd /mnt/backup/neon_backup/MySQL_backup
mysqldump -u root -pnppwd --all-databases > mysql_backup.sql
set > /tmp/script-environment
tar cvjf back_mysql.tar.bz2 mysql_backup.sql