diff --git a/.vs/Diplom B/v16/.suo b/.vs/Diplom B/v16/.suo
index c3f774a..8f6bc7e 100644
Binary files a/.vs/Diplom B/v16/.suo and b/.vs/Diplom B/v16/.suo differ
diff --git a/DB/WorkDB.cs b/DB/WorkDB.cs
index 53caf59..6d78c3a 100644
--- a/DB/WorkDB.cs
+++ b/DB/WorkDB.cs
@@ -312,11 +312,11 @@ namespace Diplom_B.DB
var tmp = (from a in db.Dogovory
where
a.Id.ToString().ToLower().Contains(f) ||
- a.DogNum.ToLower().Contains(f) ||
+ (!string.IsNullOrEmpty(a.DogNum) && a.DogNum.ToLower().Contains(f)) ||
a.DataPostavky.ToString("yyyy.MM.dd").Contains(f) ||
- a.PrikazZapusk.ToLower().Contains(f) ||
- a.Garantiy.ToLower().Contains(f) ||
- a.Primechanie.ToLower().Contains(f)
+ (!string.IsNullOrEmpty(a.PrikazZapusk) && a.PrikazZapusk.ToLower().Contains(f)) ||
+ (!string.IsNullOrEmpty(a.Garantiy) && a.Garantiy.ToLower().Contains(f)) ||
+ (!string.IsNullOrEmpty(a.Primechanie) && a.Primechanie.ToLower().Contains(f))
select a).ToArray();
return tmp;
}
@@ -380,7 +380,7 @@ namespace Diplom_B.DB
var tmp = (from a in db.Users
where
a.Id.ToString().ToLower().Contains(f) ||
- a.Name.ToLower().Contains(f)
+ (!string.IsNullOrEmpty(a.Name) && a.Name.ToLower().Contains(f))
select a).ToArray();
return tmp;
}
@@ -456,14 +456,14 @@ namespace Diplom_B.DB
var tmp = (from a in db.Izdeliya
where
a.Id.ToString().ToLower().Contains(f) ||
- a.Name.ToLower().Contains(f) ||
- a.DecNum.ToLower().Contains(f) ||
- a.Shifr.ToLower().Contains(f) ||
- a.Litera.ToLower().Contains(f) ||
+ (!string.IsNullOrEmpty(a.Name) && a.Name.ToLower().Contains(f)) ||
+ (!string.IsNullOrEmpty(a.DecNum) && a.DecNum.ToLower().Contains(f)) ||
+ (!string.IsNullOrEmpty(a.Shifr) && a.Shifr.ToLower().Contains(f)) ||
+ (!string.IsNullOrEmpty(a.Litera) && a.Litera.ToLower().Contains(f)) ||
a.Cena.ToString("F2").ToLower().Contains(f) ||
a.OtdelRazrab.ToString().ToLower().Contains(f) ||
- a.Ved.ToLower().Contains(f) ||
- a.GlavKonstr.ToLower().Contains(f)
+ (!string.IsNullOrEmpty(a.Ved) && a.Ved.ToLower().Contains(f)) ||
+ (!string.IsNullOrEmpty(a.GlavKonstr) && a.GlavKonstr.ToLower().Contains(f))
select a).ToArray();
return tmp;
}
@@ -543,12 +543,12 @@ namespace Diplom_B.DB
var tmp = (from a in db.Izvescheniya
where
a.Id.ToString().ToLower().Contains(f) ||
- a.IzvNum.ToLower().Contains(f) ||
+ (!string.IsNullOrEmpty(a.IzvNum) && a.IzvNum.ToLower().Contains(f)) ||
a.InvNum.ToString().ToLower().Contains(f) ||
a.IzmNum.ToString().ToLower().Contains(f) ||
- a.UkazZad.ToLower().Contains(f) ||
- a.UkazVnedr.ToLower().Contains(f) ||
- a.FileName.ToLower().Contains(f)
+ (!string.IsNullOrEmpty(a.UkazZad) && a.UkazZad.ToLower().Contains(f)) ||
+ (!string.IsNullOrEmpty(a.UkazVnedr) && a.UkazVnedr.ToLower().Contains(f)) ||
+ (!string.IsNullOrEmpty(a.FileName) && a.FileName.ToLower().Contains(f))
select a).ToArray();
return tmp;
}
@@ -628,10 +628,10 @@ namespace Diplom_B.DB
var tmp = (from a in db.Zakazchiki
where
a.Id.ToString().ToLower().Contains(f) ||
- a.Name.ToLower().Contains(f) ||
- a.Adress.ToLower().Contains(f) ||
- a.Phone.ToLower().Contains(f) ||
- a.Email.ToLower().Contains(f)
+ (!string.IsNullOrEmpty(a.Name) && a.Name.ToLower().Contains(f)) ||
+ (!string.IsNullOrEmpty(a.Adress) && a.Adress.ToLower().Contains(f)) ||
+ (!string.IsNullOrEmpty(a.Phone) && a.Phone.ToLower().Contains(f)) ||
+ (!string.IsNullOrEmpty(a.Email) && a.Email.ToLower().Contains(f))
select a).ToArray();
return tmp;
}
@@ -802,10 +802,10 @@ namespace Diplom_B.DB
var tmp = (from a in db.Postavki
where
a.Id.ToString().ToLower().Contains(f) ||
- a.ZavNum.ToLower().Contains(f) ||
+ (!string.IsNullOrEmpty(a.ZavNum) && a.ZavNum.ToLower().Contains(f)) ||
a.DataPostavki.ToString("yyyy.MM.dd").ToLower().Contains(f) ||
a.Status.Stat.ToString().ToLower().Contains(f) ||
- a.Primechanie.ToLower().Contains(f)
+ (!string.IsNullOrEmpty(a.Primechanie) && a.Primechanie.ToLower().Contains(f))
select a).ToArray();
return tmp;
}
@@ -924,11 +924,11 @@ namespace Diplom_B.DB
var tmp = (from a in db.Documenty
where
a.Id.ToString().ToLower().Contains(f) ||
- a.InvNum.ToLower().Contains(f) ||
- a.DecNum.ToLower().Contains(f) ||
- a.Name.ToLower().Contains(f) ||
- a.FileName.ToLower().Contains(f) ||
- a.Primechanie.ToLower().Contains(f)
+ (!string.IsNullOrEmpty(a.InvNum) && a.InvNum.ToLower().Contains(f)) ||
+ (!string.IsNullOrEmpty(a.DecNum) && a.DecNum.ToLower().Contains(f)) ||
+ (!string.IsNullOrEmpty(a.Name) && a.Name.ToLower().Contains(f)) ||
+ (!string.IsNullOrEmpty(a.FileName) && a.FileName.ToLower().Contains(f)) ||
+ (!string.IsNullOrEmpty(a.Primechanie) && a.Primechanie.ToLower().Contains(f))
select a).ToArray();
return tmp;
}
diff --git a/DocForm.cs b/DocForm.cs
index 55b2539..d5c0dda 100644
--- a/DocForm.cs
+++ b/DocForm.cs
@@ -234,16 +234,20 @@ namespace Diplom_B
private Task filterDrop;
private void searchBox_TextChanged(object sender, EventArgs e)
{
- filterDrop = new Task(() =>
+ try
{
- var fd = filterDrop.Id;
- Task.Delay(1000).Wait();
- if (filterDrop.Id == fd)
- if (InvokeRequired) Invoke((Action)(() => { UpdateTable(WorkDB.ListDocumenty(searchBox.Text)); }));
- else UpdateTable(WorkDB.ListDocumenty(searchBox.Text));
+ filterDrop = new Task(() =>
+ {
+ var fd = filterDrop.Id;
+ Task.Delay(1000).Wait();
+ if (filterDrop.Id == fd)
+ if (InvokeRequired) Invoke((Action)(() => { UpdateTable(WorkDB.ListDocumenty(searchBox.Text)); }));
+ else UpdateTable(WorkDB.ListDocumenty(searchBox.Text));
- });
- filterDrop.Start();
+ });
+ filterDrop.Start();
+ }
+ catch (Exception ex) { ShowError(ex.Message); }
}
private void resetSearchButton_Click(object sender, EventArgs e)
{
diff --git a/obj/Debug/Diplom B.application b/obj/Debug/Diplom B.application
index 4abf49e..a6dd1c7 100644
--- a/obj/Debug/Diplom B.application
+++ b/obj/Debug/Diplom B.application
@@ -14,7 +14,7 @@
- X0hvKwTTHcE7anb0WonPeVSVBpfYZcFUxNBKIpU62qQ=
+ TzNPHv6M8mLAxSDQqyZLoIm9WvZPLJIFosQQ8OaR9jY=
diff --git a/obj/Debug/Diplom B.csproj.AssemblyReference.cache b/obj/Debug/Diplom B.csproj.AssemblyReference.cache
deleted file mode 100644
index f5e894a..0000000
Binary files a/obj/Debug/Diplom B.csproj.AssemblyReference.cache and /dev/null differ
diff --git a/obj/Debug/Diplom B.csproj.FileListAbsolute.txt b/obj/Debug/Diplom B.csproj.FileListAbsolute.txt
index f164f38..1478488 100644
--- a/obj/Debug/Diplom B.csproj.FileListAbsolute.txt
+++ b/obj/Debug/Diplom B.csproj.FileListAbsolute.txt
@@ -41,7 +41,6 @@ D:\GIT\Diplom B\bin\Debug\System.Collections.Immutable.xml
D:\GIT\Diplom B\bin\Debug\System.Diagnostics.DiagnosticSource.xml
D:\GIT\Diplom B\bin\Debug\System.Interactive.Async.xml
D:\GIT\Diplom B\bin\Debug\System.Runtime.CompilerServices.Unsafe.xml
-D:\GIT\Diplom B\obj\Debug\Diplom B.csproj.AssemblyReference.cache
D:\GIT\Diplom B\obj\Debug\Diplom_B.Properties.Resources.resources
D:\GIT\Diplom B\obj\Debug\Diplom B.csproj.GenerateResource.cache
D:\GIT\Diplom B\obj\Debug\Diplom B.csproj.CoreCompileInputs.cache
diff --git a/obj/Debug/Diplom B.csproj.GenerateResource.cache b/obj/Debug/Diplom B.csproj.GenerateResource.cache
index a420f27..a5f46e6 100644
Binary files a/obj/Debug/Diplom B.csproj.GenerateResource.cache and b/obj/Debug/Diplom B.csproj.GenerateResource.cache differ
diff --git a/obj/Debug/Diplom B.exe b/obj/Debug/Diplom B.exe
index e2cf9ac..acc318d 100644
Binary files a/obj/Debug/Diplom B.exe and b/obj/Debug/Diplom B.exe differ
diff --git a/obj/Debug/Diplom B.exe.manifest b/obj/Debug/Diplom B.exe.manifest
index 7c23736..4399c55 100644
--- a/obj/Debug/Diplom B.exe.manifest
+++ b/obj/Debug/Diplom B.exe.manifest
@@ -42,14 +42,14 @@
-
+
- PcItQ+GLTtgDVnU0grCE/UCpxJx55939ybCOeLAFj8s=
+ Lc+oIKpqjyk+uMl/kgdtTvFquZkAokG2jNhSx9lEB2Q=
diff --git a/obj/Debug/Diplom B.pdb b/obj/Debug/Diplom B.pdb
index 289bb28..9a534f6 100644
Binary files a/obj/Debug/Diplom B.pdb and b/obj/Debug/Diplom B.pdb differ
diff --git a/obj/Release/Diplom B.application b/obj/Release/Diplom B.application
index b110d6b..f776a2f 100644
--- a/obj/Release/Diplom B.application
+++ b/obj/Release/Diplom B.application
@@ -14,7 +14,7 @@
- fPKE9Ykhf57d+LLvJiCpB4OlTVuwhSJg0Bs+5QRYRBM=
+ lMmOGp1uIwtT2dNr3+3fWIPdX3FRGB1464GxGoN9k4o=
diff --git a/obj/Release/Diplom B.csproj.AssemblyReference.cache b/obj/Release/Diplom B.csproj.AssemblyReference.cache
deleted file mode 100644
index cbe8918..0000000
Binary files a/obj/Release/Diplom B.csproj.AssemblyReference.cache and /dev/null differ
diff --git a/obj/Release/Diplom B.csproj.FileListAbsolute.txt b/obj/Release/Diplom B.csproj.FileListAbsolute.txt
index 4a9dcad..57539f6 100644
--- a/obj/Release/Diplom B.csproj.FileListAbsolute.txt
+++ b/obj/Release/Diplom B.csproj.FileListAbsolute.txt
@@ -97,7 +97,6 @@ D:\GIT\Diplom B\bin\Release\System.Collections.Immutable.xml
D:\GIT\Diplom B\bin\Release\System.Diagnostics.DiagnosticSource.xml
D:\GIT\Diplom B\bin\Release\System.Interactive.Async.xml
D:\GIT\Diplom B\bin\Release\System.Runtime.CompilerServices.Unsafe.xml
-D:\GIT\Diplom B\obj\Release\Diplom B.csproj.AssemblyReference.cache
D:\GIT\Diplom B\obj\Release\Diplom_B.IzdForm.resources
D:\GIT\Diplom B\obj\Release\Diplom_B.Properties.Resources.resources
D:\GIT\Diplom B\obj\Release\Diplom B.csproj.GenerateResource.cache
diff --git a/obj/Release/Diplom B.csproj.GenerateResource.cache b/obj/Release/Diplom B.csproj.GenerateResource.cache
index e629ad2..a5f46e6 100644
Binary files a/obj/Release/Diplom B.csproj.GenerateResource.cache and b/obj/Release/Diplom B.csproj.GenerateResource.cache differ
diff --git a/obj/Release/Diplom B.exe b/obj/Release/Diplom B.exe
index 11a714f..cdaceab 100644
Binary files a/obj/Release/Diplom B.exe and b/obj/Release/Diplom B.exe differ
diff --git a/obj/Release/Diplom B.exe.manifest b/obj/Release/Diplom B.exe.manifest
index 301a0b1..8994a88 100644
--- a/obj/Release/Diplom B.exe.manifest
+++ b/obj/Release/Diplom B.exe.manifest
@@ -42,14 +42,14 @@
-
+
- wN4CjE2QB5CLoWcBFD3Ij2JAKDKNrasXYx1pqFfgHFQ=
+ 5IMSNokcUtxxd4wOofGAsTg3J4ncSjw4FjYzeZyZbis=
diff --git a/obj/Release/Diplom B.pdb b/obj/Release/Diplom B.pdb
index ece1193..1df6691 100644
Binary files a/obj/Release/Diplom B.pdb and b/obj/Release/Diplom B.pdb differ