Диплом: Автоматизация управления проектами с студии ООО "Свежий ветер"

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
122
frm5.Show(this); //Show Form assigning this form as the forms owner
Hide();
}
private void label5_Click(object sender, EventArgs e)
{
if (frm6 == null)
{
frm6 = new Help(); //Create form if not created
frm6.FormClosed += frm6_FormClosed; //Add eventhandler to cleanup after
form closes
}
frm6.Show(this); //Show Form assigning this form as the forms owner
Hide();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace RadioManager
{
public partial class Help : Form
{
public Help()
{
InitializeComponent();
}
private void label14_Click(object sender, EventArgs e)
{
Owner.Show(); //Show the previous form
Hide();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace RadioManager
{
public partial class GreatPlayearList : Form
{
RadioManager DB = new RadioManager();
public GreatPlayearList()
{
InitializeComponent();
123
}
private void label7_Click(object sender, EventArgs e)
{
var tr = DB.Tracks.OrderBy(t => Guid.NewGuid()).Where(p => p.Status ==
"ХИТ").Select(s => new { s.TrackId }).Take(int.Parse(textBox6.Text));// BEGIN ХИТ
var pr1Q1 = tr.Take(int.Parse(textBox6.Text)).ToList();
//dataGridView1.DataSource = pr1Q1;
var masHit=pr1Q1.Take(int.Parse(textBox6.Text)).ToArray();
// MessageBox.Show("mas[0] = "+masHit[0].TrackId);// END ХИТ
var newt = DB.Tracks.OrderBy(r => Guid.NewGuid()).Where(p => p.Status ==
"НОВИНКА").Select(s => new { s.TrackId }).Take(int.Parse(textBox4.Text)); // BEGIN
НОВИНКА
var newmst = newt.Take(int.Parse(textBox4.Text)).ToArray();
//MessageBox.Show("mas[0] = " + newmst[0].TrackId);// END НОВИНКА
var pop = DB.Tracks.Join(DB.Genres, p => p.GenreId, g => g.GenreId, (p, g) =>
new { p.TrackId, g.Name }).Where(d => d.Name == "Классическая").Select(s => new {
s.TrackId }).Take(int.Parse(textBox3.Text));// BEGIN Классическая
var newpop = pop.Take(int.Parse(textBox3.Text)).ToArray();
// MessageBox.Show("mas[0] = " + newpop[0].TrackId);// END Классическая
var clasic = DB.Tracks.Join(DB.Genres, p => p.GenreId, g => g.GenreId, (p, g)
=> new { p.TrackId, g.Name }).Where(d => d.Name == "Поп").Select(s => new { s.TrackId
}).Take(int.Parse(textBox2.Text));// BEGIN ПОП
var newclasic = clasic.Take(int.Parse(textBox2.Text)).ToArray();
//MessageBox.Show("mas[0] = " + newclasic[0].TrackId);// END ПОП
var recl = DB.Tracks.Join(DB.Genres, p => p.GenreId, g => g.GenreId, (p, g)
=> new { p.TrackId, g.Name }).Where(d => d.Name == "Реклама").Select(s => new { s.TrackId
}).Take(int.Parse(textBox5.Text));// BEGIN РЕКЛАМА
var newrecl = recl.Take(int.Parse(textBox5.Text)).ToArray();
///MessageBox.Show("mas[0] = " + newrecl[0].TrackId);// END РЕКЛАМА
var y = ConcatArrays(masHit, newmst, newpop,newclasic,newrecl);
var addPlay = new PlayLetters
{
CountTreck = int.Parse(textBox1.Text),
RadioStationId = int.Parse(comboBox2.SelectedValue.ToString()),
DateCreate = DateTime.Today
/*GenreId = int.Parse(comboBox2.SelectedValue.ToString()),
PerformerId = int.Parse(comboBox3.SelectedValue.ToString())*/
};
DB.PlayLetters.Add(addPlay);
DB.SaveChanges();
for (int i = 0;i< int.Parse(textBox1.Text) - 1;i++)
{
if (y[i] == y[i+1] )
{
Array.Reverse(y, i, i+4);
}
//MessageBox.Show("mas["+i+"] = " + y[i].TrackId);
}
var lastidPone = DB.PlayTracks.Select(p => p.Number).Max();
var playLId = DB.PlayLetters.Select(p => p.PlayLetterId).Max();
if ((int.Parse(textBox2.Text) + int.Parse(textBox3.Text) + int.Parse(text-
Box4.Text) + int.Parse(textBox5.Text) + int.Parse(textBox6.Text)) == int.Parse(text-
Box1.Text)) {
for (int i = 0; i < int.Parse(textBox1.Text); i++)
124
{
var addPlayList = new PlayTracks
{
Number = lastidPone + 1,
PlayLetterId = playLId,
TrackId = y[i].TrackId
};
DB.PlayTracks.Add(addPlayList);
DB.SaveChanges();
//MessageBox.Show("mas[" + i + "] = " + y[i].TrackId);
lastidPone++;
}
MessageBox.Show("Плейлист сформирован!!!");
}
else
{
MessageBox.Show("Проверьте количество не сходится!!!");
}
}
private void label8_Click(object sender, EventArgs e)
{
Owner.Show(); //Show the previous form
Hide();
}
public static T[] ConcatArrays<T>(params T[][] list)
{
var result = new T[list.Sum(a => a.Length)];
int offset = 0;
for (int x = 0; x < list.Length; x++)
{
list[x].CopyTo(result, offset);
offset += list[x].Length;
}
return result;
}
private void GreatPlayearList_Load(object sender, EventArgs e)
{
var states = DB.RadioStations.Select(p => new { p.Name, p.RadioStationId });
var pr1Q1 = states.Take(300).ToList();
comboBox2.DataSource = pr1Q1;
comboBox2.DisplayMember = "Name";
comboBox2.ValueMember = "RadioStationId";
//something.OrderBy(r => Guid.NewGuid()).Take(5)
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
125
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace RadioManager
{
public partial class deleteTrackOrPlayList : Form
{
RadioManager DB = new RadioManager();
public deleteTrackOrPlayList()
{
InitializeComponent();
}
private void label14_Click(object sender, EventArgs e)
{
Owner.Show(); //Show the previous form
Hide();
}
private void label7_Click(object sender, EventArgs e)
{
var dlectePlayList = new PlayLetters
{
PlayLetterId = int.Parse(textBox1.Text),
DateCreate = dateTimePicker1.Value
};
DB.PlayLetters.Remove(dlectePlayList);
DB.SaveChanges();
MessageBox.Show("Плейлист удален!!!!");
}
private void label4_Click(object sender, EventArgs e)
{
var deleteTrack = new Tracks
{
Name = textBox5.Text,
DateOfIssue =dateTimePicker2.Value
};
DB.Tracks.Remove(deleteTrack);
DB.SaveChanges();
MessageBox.Show("Трек удален!!!!");
DirectoryInfo di = new DirectoryInfo(
ConfigurationManager.AppSettings.Get("TrackCatalog"));
File.Delete(di.FullName+@"\"+textBox5.Text+".mp3");
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Configuration;
using System.IO;
namespace RadioManager
{
public partial class addTrekAndGarde : Form
{
126
RadioManager DB = new RadioManager();
public addTrekAndGarde()
{
InitializeComponent();
}
private void label5_Click(object sender, EventArgs e)
{
}
private void label14_Click(object sender, EventArgs e)
{
Owner.Show(); //Show the previous form
Hide();
}
private void label9_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
}
//описываем обработчик события FileOk для openFileDialog1
private void openFileDialog1OnOpen(object sender, EventArgs e)
{
string newpath;
//подключаемся к папки через путь, которая храниться в App.config
DirectoryInfo di = new DirectoryInfo(
ConfigurationManager.AppSettings.Get("TrackCatalog"));
//если такой папки нету, создаем ее
if (!di.Exists) di.Create();
//по всем выбранным файлам
foreach (var filename in openFileDialog1.SafeFileNames)
{
//соединяем в переменную newpath полный путь к новому файлу
//(папка+название выбраного файла)
newpath = Path.Combine(di.FullName, filename);
//копируем выбранный файл в "новый путь"
File.Copy(openFileDialog1.FileName, newpath, true);
FileInfo fi = new FileInfo(newpath);
MessageBox.Show(fi.Attributes.ToString());
textBox7.Text = filename;
//вот задесь потом создаешь новый экземплаяр класса Track,
//инициализируешь его и добавляешь в бд
}
}
private void label4_Click(object sender, EventArgs e)
{
var addTrack = new Tracks
{
Name = textBox7.Text,
DateOfIssue = dateTimePicker1.Value,
Status = comboBox1.Text,
GenreId = int.Parse(comboBox2.SelectedValue.ToString()),
PerformerId = int.Parse(comboBox3.SelectedValue.ToString())
};
DB.Tracks.Add(addTrack);
DB.SaveChanges();
}
127
private void label7_Click(object sender, EventArgs e)
{
var addGanr = new Genres
{
Name = textBox1.Text
};
DB.Genres.Add(addGanr);
DB.SaveChanges();
MessageBox.Show("Жанр добавлен:");
}
private void addTrekAndGarde_Load(object sender, EventArgs e)
{
var states = DB.Genres.Select(p => new { p.Name,p.GenreId });
var pr1Q1 = states.Take(300).ToList();
comboBox2.DataSource = pr1Q1;
comboBox2.DisplayMember = "Name";
comboBox2.ValueMember = "GenreId";
// MessageBox.Show("G: " + comboBox2.SelectedValue.ToString());
var states1 = DB.Performers.Select(p => new { p.Name, p.PerformerId });
var pr1Q12 = states1.Take(300).ToList();
comboBox3.DataSource = pr1Q12;
comboBox3.DisplayMember = "Name";
comboBox3.ValueMember = "PerformerId";
//MessageBox.Show("P: "+ comboBox3.SelectedValue.ToString());
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.mi-
crosoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.Enti-
tyFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyTo-
ken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<appSettings>
<add key="TrackCatalog" value="E:\Заказы 2018\Делаю\Радио\Music" />
</appSettings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFac-
tory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.En-
tity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
providers>
</entityFramework>
128
<connectionStrings><add name="RadioManager" connectionString="data source=DESKTOP-
SCVVLOJ\SQLEXPRESS;initial catalog=RadioManager;integrated security=True;MultipleAc-
tiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" /></connec-
tionStrings></configuration>
129
Приложения Б (Формы)
130
131

Смотрите также:

"Автоматизация обработки заявок ООО "Проектно-Строительная Компания"
"Автоматизация процесса аттестации персонала для ООО "Нэт Бай Нэт Холдинг"
"Анализ интернет-активности конкурентов ( на примере конкурентов "Газпром нефть")
"Бухгалтерский учёт и аудит расчётов с подотчётними лицами в организации на примере ООО "ЛОЦ 10""
«Психологическое сопровождение персонала в организации на примере ООО «Крокус»
Cовершенствование деловой оценки персонала в организации (на примере ООО "Даймонд кейтеринг развитие")
IPO - инструмент финансирования деятельности организации. На примере ПАО «Нефтяная компания «Лукойл»
PR как средство продвижения организации (на примере ПАО "Тамбовский завод "Комсомолец им. Н.С. Артемова")
PR-коммуникации в сфере общественного питания (на примере кафе-кондитерской «Cream Cheese»)
SMM как средство повышения эффективности работы учреждений социокультурной сферы (на примере Малого театра)