Почти готово

This commit is contained in:
GokaPek 2024-05-22 10:02:25 +04:00
parent e1bce48929
commit 810ef89776
5 changed files with 35 additions and 34 deletions

3
.gitignore vendored
View File

@ -14,6 +14,9 @@
# User-specific files (MonoDevelop/Xamarin Studio) # User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs *.userprefs
# dll files
*.dll
# Mono auto generated files # Mono auto generated files
mono_crash.* mono_crash.*

View File

@ -11,4 +11,8 @@
<ProjectReference Include="..\AbstractLawFirmDataModels\AbstractLawFirmDataModels\AbstractLawFirmDataModels.csproj" /> <ProjectReference Include="..\AbstractLawFirmDataModels\AbstractLawFirmDataModels\AbstractLawFirmDataModels.csproj" />
</ItemGroup> </ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy /Y &quot;$(TargetDir)*.dll&quot; &quot;$(SolutionDir)ImplementationExtensions\*.dll&quot;" />
</Target>
</Project> </Project>

View File

@ -52,7 +52,6 @@ namespace LawFirmView
private void пакетыДокументовToolStripMenuItem_Click(object sender, EventArgs e) private void пакетыДокументовToolStripMenuItem_Click(object sender, EventArgs e)
{ {
var service = Program.ServiceProvider?.GetService(typeof(FormDocuments));
var form = DependencyManager.Instance.Resolve<FormDocuments>(); var form = DependencyManager.Instance.Resolve<FormDocuments>();
form.ShowDialog(); form.ShowDialog();

View File

@ -46,6 +46,7 @@
buttonOrderReady = new Button(); buttonOrderReady = new Button();
buttonIssuedOrder = new Button(); buttonIssuedOrder = new Button();
buttonRef = new Button(); buttonRef = new Button();
создатьБекапToolStripMenuItem = new ToolStripMenuItem();
menuStrip1.SuspendLayout(); menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
SuspendLayout(); SuspendLayout();
@ -53,7 +54,7 @@
// menuStrip1 // menuStrip1
// //
menuStrip1.ImageScalingSize = new Size(20, 20); menuStrip1.ImageScalingSize = new Size(20, 20);
menuStrip1.Items.AddRange(new ToolStripItem[] { toolStripMenuItemCatalogs, отчётыToolStripMenuItem, ЗапускРаботToolStripMenuItem, почтаToolStripMenuItem }); menuStrip1.Items.AddRange(new ToolStripItem[] { toolStripMenuItemCatalogs, отчётыToolStripMenuItem, ЗапускРаботToolStripMenuItem, почтаToolStripMenuItem, создатьБекапToolStripMenuItem });
menuStrip1.Location = new Point(0, 0); menuStrip1.Location = new Point(0, 0);
menuStrip1.Name = "menuStrip1"; menuStrip1.Name = "menuStrip1";
menuStrip1.Padding = new Padding(7, 3, 0, 3); menuStrip1.Padding = new Padding(7, 3, 0, 3);
@ -205,6 +206,13 @@
buttonRef.UseVisualStyleBackColor = true; buttonRef.UseVisualStyleBackColor = true;
buttonRef.Click += buttonRef_Click; buttonRef.Click += buttonRef_Click;
// //
// создатьБекапToolStripMenuItem
//
создатьБекапToolStripMenuItem.Name = "создатьБекапToolStripMenuItem";
создатьБекапToolStripMenuItem.Size = new Size(123, 24);
создатьБекапToolStripMenuItem.Text = "Создать бекап";
создатьБекапToolStripMenuItem.Click += создатьБэкапToolStripMenuItem_Click;
//
// FormMain // FormMain
// //
AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleDimensions = new SizeF(8F, 20F);
@ -249,5 +257,6 @@
private ToolStripMenuItem ЗапускРаботToolStripMenuItem; private ToolStripMenuItem ЗапускРаботToolStripMenuItem;
private ToolStripMenuItem исполнителиToolStripMenuItem; private ToolStripMenuItem исполнителиToolStripMenuItem;
private ToolStripMenuItem почтаToolStripMenuItem; private ToolStripMenuItem почтаToolStripMenuItem;
private ToolStripMenuItem создатьБекапToolStripMenuItem;
} }
} }

View File

@ -17,50 +17,36 @@ using AbstractLawFirmContracts.BindingModels;
namespace LawFirmView namespace LawFirmView
{ {
internal static class Program internal static class Program
{ {
private static ServiceProvider? _serviceProvider; [STAThread]
public static ServiceProvider? ServiceProvider => _serviceProvider; static void Main()
/// <summary> {
/// The main entry point for the application. // To customize application configuration such as set high DPI settings or default font,
/// </summary> // see https://aka.ms/applicationconfiguration.
[STAThread] ApplicationConfiguration.Initialize();
static void Main()
{
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
InitDependency(); InitDependency();
try try
{ {
var mailSender = DependencyManager.Instance.Resolve<AbstractMailWorker>(); var mailSender = DependencyManager.Instance.Resolve<AbstractMailWorker>();
mailSender?.MailConfig(new MailConfigBindingModel mailSender?.MailConfig(new MailConfigBindingModel
{ {
MailLogin = MailLogin = System.Configuration.ConfigurationManager.AppSettings["MailLogin"] ?? string.Empty,
System.Configuration.ConfigurationManager.AppSettings["MailLogin"] ?? MailPassword = System.Configuration.ConfigurationManager.AppSettings["MailPassword"] ?? string.Empty,
string.Empty, SmtpClientHost = System.Configuration.ConfigurationManager.AppSettings["SmtpClientHost"] ?? string.Empty,
MailPassword = SmtpClientPort = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["SmtpClientPort"]),
System.Configuration.ConfigurationManager.AppSettings["MailPassword"] ?? PopHost = System.Configuration.ConfigurationManager.AppSettings["PopHost"] ?? string.Empty,
string.Empty, PopPort = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["PopPort"])
SmtpClientHost =
System.Configuration.ConfigurationManager.AppSettings["SmtpClientHost"] ??
string.Empty,
SmtpClientPort =
Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["SmtpClientPort"]),
PopHost =
System.Configuration.ConfigurationManager.AppSettings["PopHost"] ?? string.Empty,
PopPort =
Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["PopPort"])
}); });
var timer = new System.Threading.Timer(new
TimerCallback(MailCheck!), null, 0, 100000); var timer = new System.Threading.Timer(new TimerCallback(MailCheck!), null, 0, 100000);
} }
catch (Exception ex) catch (Exception ex)
{ {
var logger = _serviceProvider.GetService<ILogger>(); var logger = DependencyManager.Instance.Resolve<ILogger>();
logger?.LogError(ex, "Error"); logger?.LogError(ex, "Error");
} }
Application.Run(DependencyManager.Instance.Resolve<FormMain>()); Application.Run(DependencyManager.Instance.Resolve<FormMain>());
} }
private static void InitDependency() private static void InitDependency()