Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge remote-tracking branch 'qicb/Develop' into Develop

Conflicts:
	Application/Code/CommonClass.cs
	Application/Code/SqlHelper.cs
	Application/Properties/Settings.Designer.cs
	Application/Properties/Settings.settings
	Application/WorkStation.csproj
	Application/app.config
	Application/frmAddItem.cs
	Application/frmAddPoint.Designer.cs
	Application/frmAddPoint.cs
	Application/frmAddRoute.Designer.cs
  • Loading branch information...
commit 2d1cde1ca2281fc46e2382ca5a089de63e0e4820 2 parents 68abee3 + 6b2e5c7
@katway authored
Showing with 9,058 additions and 880 deletions.
  1. +22 −0 Application/Code/CommonClass.cs.orig
  2. +4,785 −0 Application/Code/SqlHelper.cs.orig
  3. +37 −1 Application/Properties/Settings.Designer.cs
  4. +45 −25 Application/Properties/Settings.Designer.cs.orig
  5. +10 −1 Application/Properties/Settings.settings
  6. +37 −0 Application/Properties/Settings.settings.orig
  7. +24 −33 Application/WorkStation.csproj
  8. +271 −9 Application/WorkStation.csproj.orig
  9. +18 −1 Application/app.config
  10. +35 −0 Application/app.config.orig
  11. +271 −234 Application/frmAddItem.Designer.cs
  12. +189 −0 Application/frmAddItem.cs
  13. +232 −0 Application/frmAddItem.cs.orig
  14. +125 −119 Application/frmAddItem.resx
  15. +198 −0 Application/frmAddMachine.Designer.cs
  16. +136 −0 Application/frmAddMachine.cs
  17. +123 −0 Application/frmAddMachine.resx
  18. +82 −53 Application/frmAddPoint.Designer.cs
  19. +213 −0 Application/frmAddPoint.Designer.cs.orig
  20. +126 −1 Application/frmAddPoint.cs
  21. +158 −0 Application/frmAddPoint.cs.orig
  22. +125 −119 Application/frmAddPoint.resx
  23. +169 −0 Application/frmAddRoutName.Designer.cs
  24. +99 −0 Application/frmAddRoutName.cs
  25. +120 −0 Application/frmAddRoutName.resx
  26. +284 −144 Application/frmAddRoute.Designer.cs
  27. +487 −0 Application/frmAddRoute.Designer.cs.orig
  28. +486 −19 Application/frmAddRoute.cs
  29. +122 −119 Application/frmAddRoute.resx
  30. +4 −1 Application/frmMain.Designer.cs
  31. +25 −1 Application/frmMain.cs
View
22 Application/Code/CommonClass.cs.orig
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace WorkStation
+{
+ public class CommonClass
+ {
+ }
+ public class BoxItem
+ {
+ private string _text = null;
+ private object _value = null;
+ public string Text { get { return this._text; } set { this._text = value; } }
+ public object Value { get { return this._value; } set { this._value = value; } }
+ public override string ToString()
+ {
+ return this._text;
+ }
+ }
+}
View
4,785 Application/Code/SqlHelper.cs.orig
4,785 additions, 0 deletions not shown
View
38 Application/Properties/Settings.Designer.cs
@@ -13,7 +13,7 @@ namespace WorkStation.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+ public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -32,5 +32,41 @@ internal sealed partial class Settings : global::System.Configuration.Applicatio
return ((string)(this["ConnectionString"]));
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
+ public bool tvRoute {
+ get {
+ return ((bool)(this["tvRoute"]));
+ }
+ set {
+ this["tvRoute"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
+ public bool tvLogicalPoint {
+ get {
+ return ((bool)(this["tvLogicalPoint"]));
+ }
+ set {
+ this["tvLogicalPoint"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
+ public bool tvPhysicalPoint {
+ get {
+ return ((bool)(this["tvPhysicalPoint"]));
+ }
+ set {
+ this["tvPhysicalPoint"] = value;
+ }
+ }
}
}
View
70 Application/Properties/Settings.Designer.cs.orig
@@ -1,8 +1,7 @@
-<<<<<<< HEAD
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
-// 运行时版本:4.0.30319.17929
+// 运行时版本:4.0.30319.269
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
@@ -14,7 +13,7 @@ namespace WorkStation.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+ public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -23,33 +22,54 @@ namespace WorkStation.Properties {
return defaultInstance;
}
}
- }
-}
+
+ [global::System.Configuration.ApplicationScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
+ [global::System.Configuration.DefaultSettingValueAttribute("Data Source=192.168.1.221;Initial Catalog=Patrol;UserId=sa;Password=sa123")]
+ public string ConnectionString {
+ get {
+ return ((string)(this["ConnectionString"]));
+ }
+ }
+<<<<<<< HEAD
=======
-//------------------------------------------------------------------------------
-// <auto-generated>
-// 此代码由工具生成。
-// 运行时版本:4.0.30319.269
-//
-// 对此文件的更改可能会导致不正确的行为,并且如果
-// 重新生成代码,这些更改将会丢失。
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace Application.Properties {
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
+ public bool tvRoute {
+ get {
+ return ((bool)(this["tvRoute"]));
+ }
+ set {
+ this["tvRoute"] = value;
+ }
+ }
- public static Settings Default {
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
+ public bool tvLogicalPoint {
get {
- return defaultInstance;
+ return ((bool)(this["tvLogicalPoint"]));
+ }
+ set {
+ this["tvLogicalPoint"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
+ public bool tvPhysicalPoint {
+ get {
+ return ((bool)(this["tvPhysicalPoint"]));
+ }
+ set {
+ this["tvPhysicalPoint"] = value;
}
}
+>>>>>>> qicb/Develop
}
}
->>>>>>> hefl
View
11 Application/Properties/Settings.settings
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="DAL.Properties" GeneratedClassName="Settings">
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="WorkStation.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="ConnectionString" Type="(Connection string)" Scope="Application">
@@ -9,5 +9,14 @@
&lt;/SerializableConnectionString&gt;</DesignTimeValue>
<Value Profile="(Default)">Data Source=192.168.1.221;Initial Catalog=Patrol;UserId=sa;Password=sa123</Value>
</Setting>
+ <Setting Name="tvRoute" Type="System.Boolean" Scope="User">
+ <Value Profile="(Default)">True</Value>
+ </Setting>
+ <Setting Name="tvLogicalPoint" Type="System.Boolean" Scope="User">
+ <Value Profile="(Default)">True</Value>
+ </Setting>
+ <Setting Name="tvPhysicalPoint" Type="System.Boolean" Scope="User">
+ <Value Profile="(Default)">True</Value>
+ </Setting>
</Settings>
</SettingsFile>
View
37 Application/Properties/Settings.settings.orig
@@ -0,0 +1,37 @@
+<<<<<<< HEAD
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="DAL.Properties" GeneratedClassName="Settings">
+ <Profiles />
+ <Settings>
+ <Setting Name="ConnectionString" Type="(Connection string)" Scope="Application">
+ <DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
+&lt;SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
+ &lt;ConnectionString&gt;Data Source=192.168.1.221;Initial Catalog=Patrol;UserId=sa;Password=sa123&lt;/ConnectionString&gt;
+&lt;/SerializableConnectionString&gt;</DesignTimeValue>
+ <Value Profile="(Default)">Data Source=192.168.1.221;Initial Catalog=Patrol;UserId=sa;Password=sa123</Value>
+ </Setting>
+ </Settings>
+=======
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="WorkStation.Properties" GeneratedClassName="Settings">
+ <Profiles />
+ <Settings>
+ <Setting Name="ConnectionString" Type="(Connection string)" Scope="Application">
+ <DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
+&lt;SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
+ &lt;ConnectionString&gt;Data Source=192.168.1.221;Initial Catalog=Patrol;UserId=sa;Password=sa123&lt;/ConnectionString&gt;
+&lt;/SerializableConnectionString&gt;</DesignTimeValue>
+ <Value Profile="(Default)">Data Source=192.168.1.221;Initial Catalog=Patrol;UserId=sa;Password=sa123</Value>
+ </Setting>
+ <Setting Name="tvRoute" Type="System.Boolean" Scope="User">
+ <Value Profile="(Default)">True</Value>
+ </Setting>
+ <Setting Name="tvLogicalPoint" Type="System.Boolean" Scope="User">
+ <Value Profile="(Default)">True</Value>
+ </Setting>
+ <Setting Name="tvPhysicalPoint" Type="System.Boolean" Scope="User">
+ <Value Profile="(Default)">True</Value>
+ </Setting>
+ </Settings>
+>>>>>>> qicb/Develop
+</SettingsFile>
View
57 Application/WorkStation.csproj
@@ -37,7 +37,6 @@
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="Microsoft.VisualBasic.PowerPacks.Vs, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="System" />
- <Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Windows.Forms" />
@@ -70,17 +69,29 @@
<Compile Include="frmAddRoute.Designer.cs">
<DependentUpon>frmAddRoute.cs</DependentUpon>
</Compile>
+ <Compile Include="frmAddRoutName.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmAddRoutName.Designer.cs">
+ <DependentUpon>frmAddRoutName.cs</DependentUpon>
+ </Compile>
+ <Compile Include="frmAddMachine.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmAddMachine.Designer.cs">
+ <DependentUpon>frmAddMachine.cs</DependentUpon>
+ </Compile>
<Compile Include="frmAddTask.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmAddTask.Designer.cs">
<DependentUpon>frmAddTask.cs</DependentUpon>
</Compile>
- <Compile Include="frmMain.cs">
+ <Compile Include="frmain.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="frmMain.Designer.cs">
- <DependentUpon>frmMain.cs</DependentUpon>
+ <Compile Include="frmain.Designer.cs">
+ <DependentUpon>frmain.cs</DependentUpon>
</Compile>
<Compile Include="frmAddItem.cs">
<SubType>Form</SubType>
@@ -126,18 +137,6 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="SiteEditDelete.cs">
- <SubType>Form</SubType>
- </Compile>
- <Compile Include="SiteEditDelete.Designer.cs">
- <DependentUpon>SiteEditDelete.cs</DependentUpon>
- </Compile>
- <Compile Include="SiteNew.cs">
- <SubType>Form</SubType>
- </Compile>
- <Compile Include="SiteNew.Designer.cs">
- <DependentUpon>SiteNew.cs</DependentUpon>
- </Compile>
<EmbeddedResource Include="frmAddCard.resx">
<DependentUpon>frmAddCard.cs</DependentUpon>
</EmbeddedResource>
@@ -147,11 +146,17 @@
<EmbeddedResource Include="frmAddRoute.resx">
<DependentUpon>frmAddRoute.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="frmAddRoutName.resx">
+ <DependentUpon>frmAddRoutName.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="frmAddMachine.resx">
+ <DependentUpon>frmAddMachine.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="frmAddTask.resx">
<DependentUpon>frmAddTask.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="frmMain.resx">
- <DependentUpon>frmMain.cs</DependentUpon>
+ <EmbeddedResource Include="frmain.resx">
+ <DependentUpon>frmain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmAddItem.resx">
<DependentUpon>frmAddItem.cs</DependentUpon>
@@ -184,18 +189,10 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
- <EmbeddedResource Include="SiteEditDelete.resx">
- <DependentUpon>SiteEditDelete.cs</DependentUpon>
- </EmbeddedResource>
- <EmbeddedResource Include="SiteNew.resx">
- <DependentUpon>SiteNew.cs</DependentUpon>
- </EmbeddedResource>
<None Include="app.config" />
- <None Include="ClassDiagram1.cd" />
<None Include="Properties\Settings.settings">
- <Generator>SettingsSingleFileGenerator</Generator>
+ <Generator>PublicSettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
- <SubType>Designer</SubType>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
@@ -240,12 +237,6 @@
<Content Include="picture\确定1.bmp" />
<Content Include="picture\确定2.bmp" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Model\Model.csproj">
- <Project>{274882FC-F42C-4969-9BA1-EE5CBF5C37A0}</Project>
- <Name>Model</Name>
- </ProjectReference>
- </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
View
280 Application/WorkStation.csproj.orig
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
@@ -37,6 +38,7 @@
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="Microsoft.VisualBasic.PowerPacks.Vs, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="System" />
+ <Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Windows.Forms" />
@@ -49,12 +51,257 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
- <Compile Include="Main.cs">
+ <Compile Include="Code\CommonClass.cs" />
+ <Compile Include="Code\SqlHelper.cs" />
+ <Compile Include="frmAddCard.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmAddCard.Designer.cs">
+ <DependentUpon>frmAddCard.cs</DependentUpon>
+ </Compile>
+ <Compile Include="frmAddPoint.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmAddPoint.Designer.cs">
+ <DependentUpon>frmAddPoint.cs</DependentUpon>
+ </Compile>
+ <Compile Include="frmAddRoute.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmAddRoute.Designer.cs">
+ <DependentUpon>frmAddRoute.cs</DependentUpon>
+ </Compile>
+ <Compile Include="frmAddTask.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Main.Designer.cs">
- <DependentUpon>Main.cs</DependentUpon>
+ <Compile Include="frmAddTask.Designer.cs">
+ <DependentUpon>frmAddTask.cs</DependentUpon>
+ </Compile>
+ <Compile Include="frmMain.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmMain.Designer.cs">
+ <DependentUpon>frmMain.cs</DependentUpon>
+ </Compile>
+ <Compile Include="frmAddItem.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmAddItem.Designer.cs">
+ <DependentUpon>frmAddItem.cs</DependentUpon>
</Compile>
+ <Compile Include="frmEditAndDeleteCard.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmEditAndDeleteCard.Designer.cs">
+ <DependentUpon>frmEditAndDeleteCard.cs</DependentUpon>
+ </Compile>
+ <Compile Include="frmEditOrDeleteItem.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmEditOrDeleteItem.Designer.cs">
+ <DependentUpon>frmEditOrDeleteItem.cs</DependentUpon>
+ </Compile>
+ <Compile Include="frmEditOrDeletePoint.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmEditOrDeletePoint.Designer.cs">
+ <DependentUpon>frmEditOrDeletePoint.cs</DependentUpon>
+ </Compile>
+ <Compile Include="frmEditOrDeleteRoute.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmEditOrDeleteRoute.Designer.cs">
+ <DependentUpon>frmEditOrDeleteRoute.cs</DependentUpon>
+ </Compile>
+ <Compile Include="frmEditOrDeleteTask.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmEditOrDeleteTask.Designer.cs">
+ <DependentUpon>frmEditOrDeleteTask.cs</DependentUpon>
+ </Compile>
+ <Compile Include="frmIssueTask.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmIssueTask.Designer.cs">
+ <DependentUpon>frmIssueTask.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="SiteEditDelete.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="SiteEditDelete.Designer.cs">
+ <DependentUpon>SiteEditDelete.cs</DependentUpon>
+ </Compile>
+ <Compile Include="SiteNew.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="SiteNew.Designer.cs">
+ <DependentUpon>SiteNew.cs</DependentUpon>
+ </Compile>
+ <EmbeddedResource Include="frmAddCard.resx">
+ <DependentUpon>frmAddCard.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="frmAddPoint.resx">
+ <DependentUpon>frmAddPoint.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="frmAddRoute.resx">
+ <DependentUpon>frmAddRoute.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="frmAddTask.resx">
+ <DependentUpon>frmAddTask.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="frmMain.resx">
+ <DependentUpon>frmMain.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="frmAddItem.resx">
+ <DependentUpon>frmAddItem.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="frmEditAndDeleteCard.resx">
+ <DependentUpon>frmEditAndDeleteCard.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="frmEditOrDeleteItem.resx">
+ <DependentUpon>frmEditOrDeleteItem.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="frmEditOrDeletePoint.resx">
+ <DependentUpon>frmEditOrDeletePoint.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="frmEditOrDeleteRoute.resx">
+ <DependentUpon>frmEditOrDeleteRoute.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="frmEditOrDeleteTask.resx">
+ <DependentUpon>frmEditOrDeleteTask.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="frmIssueTask.resx">
+ <DependentUpon>frmIssueTask.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Properties\Resources.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <Compile Include="Properties\Resources.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Resources.resx</DependentUpon>
+ <DesignTime>True</DesignTime>
+ </Compile>
+ <EmbeddedResource Include="SiteEditDelete.resx">
+ <DependentUpon>SiteEditDelete.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="SiteNew.resx">
+ <DependentUpon>SiteNew.cs</DependentUpon>
+ </EmbeddedResource>
+ <None Include="app.config" />
+ <None Include="ClassDiagram1.cd" />
+ <None Include="Properties\Settings.settings">
+ <Generator>SettingsSingleFileGenerator</Generator>
+ <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+ <SubType>Designer</SubType>
+ </None>
+ <Compile Include="Properties\Settings.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Settings.settings</DependentUpon>
+ <DesignTimeSharedInput>True</DesignTimeSharedInput>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="picture\001.bmp" />
+ <Content Include="picture\002.bmp" />
+ <Content Include="picture\003.bmp" />
+ <Content Include="picture\004.bmp" />
+ <Content Include="picture\01.gif" />
+ <Content Include="picture\094.GIF" />
+ <Content Include="picture\096.GIF" />
+ <Content Include="picture\130.GIF" />
+ <Content Include="picture\1381ContentsButton.ico" />
+ <Content Include="picture\27.gif" />
+ <Content Include="picture\34.gif" />
+ <Content Include="picture\b087.gif" />
+ <Content Include="picture\ContentsButton.ico" />
+ <Content Include="picture\icon17.gif" />
+ <Content Include="picture\ic_download.gif" />
+ <Content Include="picture\kksd1183_9_m.gif" />
+ <Content Include="picture\login.gif" />
+ <Content Include="picture\picture\003.bmp" />
+ <Content Include="picture\picture\004.bmp" />
+ <Content Include="picture\picture\icon17.gif" />
+ <Content Include="picture\picture\TabAdvertisement.bmp" />
+ <Content Include="picture\picture\TabAppendix.bmp" />
+ <Content Include="picture\picture\TabIndex.bmp" />
+ <Content Include="picture\picture\TabSentence.bmp" />
+ <Content Include="picture\TabAdvertisement.bmp" />
+ <Content Include="picture\TabAppendix.bmp" />
+ <Content Include="picture\TabIndex.bmp" />
+ <Content Include="picture\TabSentence.bmp" />
+ <Content Include="picture\TabWizard.bmp" />
+ <Content Include="picture\u=3720357200,1595926406&amp;fm=0&amp;gp=20.jpg" />
+ <Content Include="picture\WB02085_.GIF" />
+ <Content Include="picture\取消1.bmp" />
+ <Content Include="picture\取消2.bmp" />
+ <Content Include="picture\确定1.bmp" />
+ <Content Include="picture\确定2.bmp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Model\Model.csproj">
+ <Project>{274882FC-F42C-4969-9BA1-EE5CBF5C37A0}</Project>
+ <Name>Model</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+=======
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{7E891505-264A-413F-B105-8AAE7A0E326A}</ProjectGuid>
+ <OutputType>WinExe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>WorkStation</RootNamespace>
+ <AssemblyName>WorkStation</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.VisualBasic" />
+ <Reference Include="Microsoft.VisualBasic.PowerPacks.Vs, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.ServiceProcess" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Deployment" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Code\CommonClass.cs" />
+ <Compile Include="Code\SqlHelper.cs" />
<Compile Include="frmAddCard.cs">
<SubType>Form</SubType>
</Compile>
@@ -73,6 +320,18 @@
<Compile Include="frmAddRoute.Designer.cs">
<DependentUpon>frmAddRoute.cs</DependentUpon>
</Compile>
+ <Compile Include="frmAddRoutName.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmAddRoutName.Designer.cs">
+ <DependentUpon>frmAddRoutName.cs</DependentUpon>
+ </Compile>
+ <Compile Include="frmAddMachine.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmAddMachine.Designer.cs">
+ <DependentUpon>frmAddMachine.cs</DependentUpon>
+ </Compile>
<Compile Include="frmAddTask.cs">
<SubType>Form</SubType>
</Compile>
@@ -129,10 +388,6 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
-<<<<<<< HEAD:Application/WorkStation.csproj
- <EmbeddedResource Include="Main.resx">
- <DependentUpon>Main.cs</DependentUpon>
-=======
<EmbeddedResource Include="frmAddCard.resx">
<DependentUpon>frmAddCard.cs</DependentUpon>
</EmbeddedResource>
@@ -142,6 +397,12 @@
<EmbeddedResource Include="frmAddRoute.resx">
<DependentUpon>frmAddRoute.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="frmAddRoutName.resx">
+ <DependentUpon>frmAddRoutName.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="frmAddMachine.resx">
+ <DependentUpon>frmAddMachine.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="frmAddTask.resx">
<DependentUpon>frmAddTask.cs</DependentUpon>
</EmbeddedResource>
@@ -168,7 +429,6 @@
</EmbeddedResource>
<EmbeddedResource Include="frmIssueTask.resx">
<DependentUpon>frmIssueTask.cs</DependentUpon>
->>>>>>> hefl:Application/Application.csproj
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
@@ -180,8 +440,9 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
+ <None Include="app.config" />
<None Include="Properties\Settings.settings">
- <Generator>SettingsSingleFileGenerator</Generator>
+ <Generator>PublicSettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
@@ -228,6 +489,7 @@
<Content Include="picture\确定2.bmp" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+>>>>>>> qicb/Develop
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
View
19 Application/app.config
@@ -1,8 +1,25 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
+ <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
+ <section name="WorkStation.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
+ </sectionGroup>
</configSections>
<connectionStrings>
- <add name="WorkStation.Properties.Settings.ConnectionString" connectionString="Data Source=192.168.1.221;Initial Catalog=Patrol;UserId=sa;Password=sa123" />
+ <add name="WorkStation.Properties.Settings.ConnectionString"
+ connectionString="Data Source=192.168.1.221;Initial Catalog=Patrol;UserId=sa;Password=sa123" />
</connectionStrings>
+ <userSettings>
+ <WorkStation.Properties.Settings>
+ <setting name="tvRoute" serializeAs="String">
+ <value>True</value>
+ </setting>
+ <setting name="tvLogicalPoint" serializeAs="String">
+ <value>True</value>
+ </setting>
+ <setting name="tvPhysicalPoint" serializeAs="String">
+ <value>True</value>
+ </setting>
+ </WorkStation.Properties.Settings>
+ </userSettings>
</configuration>
View
35 Application/app.config.orig
@@ -0,0 +1,35 @@
+<<<<<<< HEAD
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <configSections>
+ </configSections>
+ <connectionStrings>
+ <add name="WorkStation.Properties.Settings.ConnectionString" connectionString="Data Source=192.168.1.221;Initial Catalog=Patrol;UserId=sa;Password=sa123" />
+ </connectionStrings>
+=======
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <configSections>
+ <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
+ <section name="WorkStation.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
+ </sectionGroup>
+ </configSections>
+ <connectionStrings>
+ <add name="WorkStation.Properties.Settings.ConnectionString"
+ connectionString="Data Source=192.168.1.221;Initial Catalog=Patrol;UserId=sa;Password=sa123" />
+ </connectionStrings>
+ <userSettings>
+ <WorkStation.Properties.Settings>
+ <setting name="tvRoute" serializeAs="String">
+ <value>True</value>
+ </setting>
+ <setting name="tvLogicalPoint" serializeAs="String">
+ <value>True</value>
+ </setting>
+ <setting name="tvPhysicalPoint" serializeAs="String">
+ <value>True</value>
+ </setting>
+ </WorkStation.Properties.Settings>
+ </userSettings>
+>>>>>>> qicb/Develop
+</configuration>
View
505 Application/frmAddItem.Designer.cs
@@ -1,235 +1,272 @@
-namespace WorkStation
-{
- partial class frmAddItem
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.lblName = new System.Windows.Forms.Label();
- this.txtName = new System.Windows.Forms.TextBox();
- this.lblAlias = new System.Windows.Forms.Label();
- this.lblValue = new System.Windows.Forms.Label();
- this.lblPoints = new System.Windows.Forms.Label();
- this.lblRemarks = new System.Windows.Forms.Label();
- this.txtAlias = new System.Windows.Forms.TextBox();
- this.cboValue = new System.Windows.Forms.ComboBox();
- this.txtRemarks = new System.Windows.Forms.TextBox();
- this.comboBox1 = new System.Windows.Forms.ComboBox();
- this.btnSave = new System.Windows.Forms.Button();
- this.listView1 = new System.Windows.Forms.ListView();
- this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
- this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
- this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
- this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
- this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
- this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
- this.SuspendLayout();
- //
- // lblName
- //
- this.lblName.AutoSize = true;
- this.lblName.Location = new System.Drawing.Point(161, 46);
- this.lblName.Name = "lblName";
- this.lblName.Size = new System.Drawing.Size(29, 12);
- this.lblName.TabIndex = 0;
- this.lblName.Text = "名称";
- //
- // txtName
- //
- this.txtName.Location = new System.Drawing.Point(232, 37);
- this.txtName.Name = "txtName";
- this.txtName.Size = new System.Drawing.Size(173, 21);
- this.txtName.TabIndex = 1;
- //
- // lblAlias
- //
- this.lblAlias.AutoSize = true;
- this.lblAlias.Location = new System.Drawing.Point(161, 78);
- this.lblAlias.Name = "lblAlias";
- this.lblAlias.Size = new System.Drawing.Size(29, 12);
- this.lblAlias.TabIndex = 2;
- this.lblAlias.Text = "别名";
- //
- // lblValue
- //
- this.lblValue.AutoSize = true;
- this.lblValue.Location = new System.Drawing.Point(149, 117);
- this.lblValue.Name = "lblValue";
- this.lblValue.Size = new System.Drawing.Size(41, 12);
- this.lblValue.TabIndex = 3;
- this.lblValue.Text = "值类型";
- //
- // lblPoints
- //
- this.lblPoints.AutoSize = true;
- this.lblPoints.Location = new System.Drawing.Point(125, 162);
- this.lblPoints.Name = "lblPoints";
- this.lblPoints.Size = new System.Drawing.Size(65, 12);
- this.lblPoints.TabIndex = 4;
- this.lblPoints.Text = "所属巡检点";
- //
- // lblRemarks
- //
- this.lblRemarks.AutoSize = true;
- this.lblRemarks.Location = new System.Drawing.Point(161, 230);
- this.lblRemarks.Name = "lblRemarks";
- this.lblRemarks.Size = new System.Drawing.Size(29, 12);
- this.lblRemarks.TabIndex = 5;
- this.lblRemarks.Text = "备注";
- //
- // txtAlias
- //
- this.txtAlias.Location = new System.Drawing.Point(232, 69);
- this.txtAlias.Name = "txtAlias";
- this.txtAlias.Size = new System.Drawing.Size(173, 21);
- this.txtAlias.TabIndex = 6;
- //
- // cboValue
- //
- this.cboValue.FormattingEnabled = true;
- this.cboValue.Items.AddRange(new object[] {
- "正常/不正常",
- "数值"});
- this.cboValue.Location = new System.Drawing.Point(232, 109);
- this.cboValue.Name = "cboValue";
- this.cboValue.Size = new System.Drawing.Size(171, 20);
- this.cboValue.TabIndex = 7;
- //
- // txtRemarks
- //
- this.txtRemarks.Location = new System.Drawing.Point(232, 193);
- this.txtRemarks.Multiline = true;
- this.txtRemarks.Name = "txtRemarks";
- this.txtRemarks.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
- this.txtRemarks.Size = new System.Drawing.Size(173, 65);
- this.txtRemarks.TabIndex = 9;
- //
- // comboBox1
- //
- this.comboBox1.FormattingEnabled = true;
- this.comboBox1.Items.AddRange(new object[] {
- "所选巡检点"});
- this.comboBox1.Location = new System.Drawing.Point(232, 154);
- this.comboBox1.Name = "comboBox1";
- this.comboBox1.Size = new System.Drawing.Size(171, 20);
- this.comboBox1.TabIndex = 10;
- //
- // btnSave
- //
- this.btnSave.Location = new System.Drawing.Point(499, 235);
- this.btnSave.Name = "btnSave";
- this.btnSave.Size = new System.Drawing.Size(75, 23);
- this.btnSave.TabIndex = 11;
- this.btnSave.Text = "保存";
- this.btnSave.UseVisualStyleBackColor = true;
- //
- // listView1
- //
- this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
- this.columnHeader1,
- this.columnHeader2,
- this.columnHeader3,
- this.columnHeader4,
- this.columnHeader5,
- this.columnHeader6});
- this.listView1.GridLines = true;
- this.listView1.Location = new System.Drawing.Point(27, 322);
- this.listView1.Name = "listView1";
- this.listView1.Size = new System.Drawing.Size(587, 175);
- this.listView1.TabIndex = 12;
- this.listView1.UseCompatibleStateImageBehavior = false;
- this.listView1.View = System.Windows.Forms.View.Details;
- //
- // columnHeader1
- //
- this.columnHeader1.Text = "编号";
- //
- // columnHeader2
- //
- this.columnHeader2.Text = "名称";
- //
- // columnHeader3
- //
- this.columnHeader3.Text = "别名";
- //
- // columnHeader4
- //
- this.columnHeader4.Text = "值类型";
- //
- // columnHeader5
- //
- this.columnHeader5.Text = "所属巡检点";
- //
- // columnHeader6
- //
- this.columnHeader6.Text = "备注";
- //
- // frmBuildItem
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(716, 586);
- this.Controls.Add(this.listView1);
- this.Controls.Add(this.btnSave);
- this.Controls.Add(this.comboBox1);
- this.Controls.Add(this.txtRemarks);
- this.Controls.Add(this.cboValue);
- this.Controls.Add(this.txtAlias);
- this.Controls.Add(this.lblRemarks);
- this.Controls.Add(this.lblPoints);
- this.Controls.Add(this.lblValue);
- this.Controls.Add(this.lblAlias);
- this.Controls.Add(this.txtName);
- this.Controls.Add(this.lblName);
- this.Name = "frmBuildItem";
- this.Text = "新建巡检项";
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- private System.Windows.Forms.Label lblName;
- private System.Windows.Forms.TextBox txtName;
- private System.Windows.Forms.Label lblAlias;
- private System.Windows.Forms.Label lblValue;
- private System.Windows.Forms.Label lblPoints;
- private System.Windows.Forms.Label lblRemarks;
- private System.Windows.Forms.TextBox txtAlias;
- private System.Windows.Forms.ComboBox cboValue;
- private System.Windows.Forms.TextBox txtRemarks;
- private System.Windows.Forms.ComboBox comboBox1;
- private System.Windows.Forms.Button btnSave;
- private System.Windows.Forms.ListView listView1;
- private System.Windows.Forms.ColumnHeader columnHeader1;
- private System.Windows.Forms.ColumnHeader columnHeader2;
- private System.Windows.Forms.ColumnHeader columnHeader3;
- private System.Windows.Forms.ColumnHeader columnHeader4;
- private System.Windows.Forms.ColumnHeader columnHeader5;
- private System.Windows.Forms.ColumnHeader columnHeader6;
- }
+namespace WorkStation
+{
+ partial class frmAddItem
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.lblName = new System.Windows.Forms.Label();
+ this.txtName = new System.Windows.Forms.TextBox();
+ this.lblAlias = new System.Windows.Forms.Label();
+ this.lblValue = new System.Windows.Forms.Label();
+ this.lblPoints = new System.Windows.Forms.Label();
+ this.lblRemarks = new System.Windows.Forms.Label();
+ this.txtAlias = new System.Windows.Forms.TextBox();
+ this.cboValue = new System.Windows.Forms.ComboBox();
+ this.txtRemarks = new System.Windows.Forms.TextBox();
+ this.cboPoint = new System.Windows.Forms.ComboBox();
+ this.btnSave = new System.Windows.Forms.Button();
+ this.label1 = new System.Windows.Forms.Label();
+ this.cboMachine = new System.Windows.Forms.ComboBox();
+ this.btnUpdate = new System.Windows.Forms.Button();
+ this.btnDel = new System.Windows.Forms.Button();
+ this.dgvItems = new System.Windows.Forms.DataGridView();
+ this.chkColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+ this.labID = new System.Windows.Forms.Label();
+ ((System.ComponentModel.ISupportInitialize)(this.dgvItems)).BeginInit();
+ this.SuspendLayout();
+ //
+ // lblName
+ //
+ this.lblName.AutoSize = true;
+ this.lblName.Location = new System.Drawing.Point(30, 31);
+ this.lblName.Name = "lblName";
+ this.lblName.Size = new System.Drawing.Size(29, 12);
+ this.lblName.TabIndex = 0;
+ this.lblName.Text = "名称";
+ //
+ // txtName
+ //
+ this.txtName.Location = new System.Drawing.Point(101, 24);
+ this.txtName.Name = "txtName";
+ this.txtName.Size = new System.Drawing.Size(171, 21);
+ this.txtName.TabIndex = 1;
+ //
+ // lblAlias
+ //
+ this.lblAlias.AutoSize = true;
+ this.lblAlias.Location = new System.Drawing.Point(312, 31);
+ this.lblAlias.Name = "lblAlias";
+ this.lblAlias.Size = new System.Drawing.Size(29, 12);
+ this.lblAlias.TabIndex = 2;
+ this.lblAlias.Text = "别名";
+ //
+ // lblValue
+ //
+ this.lblValue.AutoSize = true;
+ this.lblValue.Location = new System.Drawing.Point(312, 79);
+ this.lblValue.Name = "lblValue";
+ this.lblValue.Size = new System.Drawing.Size(41, 12);
+ this.lblValue.TabIndex = 3;
+ this.lblValue.Text = "值类型";
+ //
+ // lblPoints
+ //
+ this.lblPoints.AutoSize = true;
+ this.lblPoints.Location = new System.Drawing.Point(12, 109);
+ this.lblPoints.Name = "lblPoints";
+ this.lblPoints.Size = new System.Drawing.Size(65, 12);
+ this.lblPoints.TabIndex = 4;
+ this.lblPoints.Text = "所属巡检点";
+ //
+ // lblRemarks
+ //
+ this.lblRemarks.AutoSize = true;
+ this.lblRemarks.Location = new System.Drawing.Point(30, 152);
+ this.lblRemarks.Name = "lblRemarks";
+ this.lblRemarks.Size = new System.Drawing.Size(29, 12);
+ this.lblRemarks.TabIndex = 5;
+ this.lblRemarks.Text = "备注";
+ //
+ // txtAlias
+ //
+ this.txtAlias.Location = new System.Drawing.Point(383, 24);
+ this.txtAlias.Name = "txtAlias";
+ this.txtAlias.Size = new System.Drawing.Size(171, 21);
+ this.txtAlias.TabIndex = 6;
+ //
+ // cboValue
+ //
+ this.cboValue.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cboValue.FormattingEnabled = true;
+ this.cboValue.Location = new System.Drawing.Point(383, 71);
+ this.cboValue.Name = "cboValue";
+ this.cboValue.Size = new System.Drawing.Size(171, 20);
+ this.cboValue.TabIndex = 7;
+ //
+ // txtRemarks
+ //
+ this.txtRemarks.Location = new System.Drawing.Point(101, 149);
+ this.txtRemarks.Multiline = true;
+ this.txtRemarks.Name = "txtRemarks";
+ this.txtRemarks.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+ this.txtRemarks.Size = new System.Drawing.Size(475, 65);
+ this.txtRemarks.TabIndex = 9;
+ //
+ // cboPoint
+ //
+ this.cboPoint.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cboPoint.FormattingEnabled = true;
+ this.cboPoint.Items.AddRange(new object[] {
+ "所选巡检点"});
+ this.cboPoint.Location = new System.Drawing.Point(101, 109);
+ this.cboPoint.Name = "cboPoint";
+ this.cboPoint.Size = new System.Drawing.Size(171, 20);
+ this.cboPoint.TabIndex = 10;
+ //
+ // btnSave
+ //
+ this.btnSave.Location = new System.Drawing.Point(278, 234);
+ this.btnSave.Name = "btnSave";
+ this.btnSave.Size = new System.Drawing.Size(75, 23);
+ this.btnSave.TabIndex = 11;
+ this.btnSave.Text = "保存";
+ this.btnSave.UseVisualStyleBackColor = true;
+ this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(30, 71);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(53, 12);
+ this.label1.TabIndex = 14;
+ this.label1.Text = "所属机器";
+ //
+ // cboMachine
+ //
+ this.cboMachine.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cboMachine.FormattingEnabled = true;
+ this.cboMachine.Location = new System.Drawing.Point(101, 68);
+ this.cboMachine.Name = "cboMachine";
+ this.cboMachine.Size = new System.Drawing.Size(171, 20);
+ this.cboMachine.TabIndex = 15;
+ //
+ // btnUpdate
+ //
+ this.btnUpdate.Location = new System.Drawing.Point(383, 234);
+ this.btnUpdate.Name = "btnUpdate";
+ this.btnUpdate.Size = new System.Drawing.Size(75, 23);
+ this.btnUpdate.TabIndex = 17;
+ this.btnUpdate.Text = "修改";
+ this.btnUpdate.UseVisualStyleBackColor = true;
+ this.btnUpdate.Click += new System.EventHandler(this.btnUpdate_Click);
+ //
+ // btnDel
+ //
+ this.btnDel.Location = new System.Drawing.Point(488, 234);
+ this.btnDel.Name = "btnDel";
+ this.btnDel.Size = new System.Drawing.Size(75, 23);
+ this.btnDel.TabIndex = 18;
+ this.btnDel.Text = "删除";
+ this.btnDel.UseVisualStyleBackColor = true;
+ this.btnDel.Click += new System.EventHandler(this.btnDel_Click);
+ //
+ // dgvItems
+ //
+ this.dgvItems.AllowUserToAddRows = false;
+ this.dgvItems.AllowUserToDeleteRows = false;
+ this.dgvItems.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ this.dgvItems.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+ this.chkColumn});
+ this.dgvItems.Location = new System.Drawing.Point(14, 318);
+ this.dgvItems.Name = "dgvItems";
+ this.dgvItems.ReadOnly = true;
+ this.dgvItems.RowTemplate.Height = 23;
+ this.dgvItems.Size = new System.Drawing.Size(659, 236);
+ this.dgvItems.TabIndex = 19;
+ this.dgvItems.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvItems_CellClick);
+ //
+ // chkColumn
+ //
+ this.chkColumn.HeaderText = "选择";
+ this.chkColumn.Name = "chkColumn";
+ this.chkColumn.ReadOnly = true;
+ this.chkColumn.Width = 38;
+ //
+ // labID
+ //
+ this.labID.AutoSize = true;
+ this.labID.Location = new System.Drawing.Point(383, 116);
+ this.labID.Name = "labID";
+ this.labID.Size = new System.Drawing.Size(53, 12);
+ this.labID.TabIndex = 20;
+ this.labID.Text = "巡检项ID";
+ this.labID.Visible = false;
+ //
+ // frmAddItem
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(716, 586);
+ this.Controls.Add(this.labID);
+ this.Controls.Add(this.dgvItems);
+ this.Controls.Add(this.btnDel);
+ this.Controls.Add(this.btnUpdate);
+ this.Controls.Add(this.cboMachine);
+ this.Controls.Add(this.label1);
+ this.Controls.Add(this.btnSave);
+ this.Controls.Add(this.cboPoint);
+ this.Controls.Add(this.txtRemarks);
+ this.Controls.Add(this.cboValue);
+ this.Controls.Add(this.txtAlias);
+ this.Controls.Add(this.lblRemarks);
+ this.Controls.Add(this.lblPoints);
+ this.Controls.Add(this.lblValue);
+ this.Controls.Add(this.lblAlias);
+ this.Controls.Add(this.txtName);
+ this.Controls.Add(this.lblName);
+ this.Name = "frmAddItem";
+ this.Text = "新建巡检项";
+ this.Load += new System.EventHandler(this.frmAddItem_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.dgvItems)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label lblName;
+ private System.Windows.Forms.TextBox txtName;
+ private System.Windows.Forms.Label lblAlias;
+ private System.Windows.Forms.Label lblValue;
+ private System.Windows.Forms.Label lblPoints;
+ private System.Windows.Forms.Label lblRemarks;
+ private System.Windows.Forms.TextBox txtAlias;
+ private System.Windows.Forms.ComboBox cboValue;
+ private System.Windows.Forms.TextBox txtRemarks;
+ private System.Windows.Forms.ComboBox cboPoint;
+ private System.Windows.Forms.Button btnSave;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.ComboBox cboMachine;
+ private System.Windows.Forms.Button btnUpdate;
+ private System.Windows.Forms.Button btnDel;
+ private System.Windows.Forms.DataGridView dgvItems;
+ private System.Windows.Forms.DataGridViewCheckBoxColumn chkColumn;
+ private System.Windows.Forms.Label labID;
+ }
}
View
189 Application/frmAddItem.cs
@@ -6,6 +6,7 @@
using System.Linq;
using System.Text;
using System.Windows.Forms;
+using System.Data.SqlClient;
namespace WorkStation
{
@@ -16,5 +17,193 @@ public frmAddItem()
InitializeComponent();
}
+ private void frmAddItem_Load(object sender, EventArgs e)
+ {
+ this.labID.Text = "";
+ getMachine();
+ getValueType();
+ getPoint();
+ bindDgvItems();
+ }
+
+ private void btnSave_Click(object sender, EventArgs e)
+ {
+
+ if (cboMachine.SelectedValue.ToString() == "")
+ {
+ MessageBox.Show("请选择所属机器");
+ return;
+ }
+ if (cboPoint.SelectedValue==null)
+ {
+ MessageBox.Show("请选择所属地点");
+ return;
+ }
+ //if(SqlHelper.ExecuteNonQuery("Select 1 From CheckItem Where "))
+ string str_insert = "Insert into CheckItem([Name],Alias,Machine_ID,ValueType,Phy_ID,Comment) Values(@name,@alias,@machineid,@valuetype,@pointid,@comment)";
+ SqlParameter[] pars = new SqlParameter[]{
+ new SqlParameter("@name",SqlDbType.NVarChar),
+ new SqlParameter("@alias",SqlDbType.NVarChar),
+ new SqlParameter("@machineid",SqlDbType.Int),
+ new SqlParameter("@valuetype",SqlDbType.Int),
+ new SqlParameter("@pointid",SqlDbType.Int),
+ new SqlParameter("@comment",SqlDbType.NText)
+ };
+ pars[0].Value = this.txtName.Text.ToString().Trim();
+ pars[1].Value = this.txtAlias.Text.ToString().Trim();
+ pars[2].Value = this.cboMachine.SelectedValue;
+ pars[3].Value = ((BoxItem)this.cboValue.SelectedItem).Value;
+ pars[4].Value = this.cboPoint.SelectedValue;
+ pars[5].Value = this.txtRemarks.Text;
+
+ int _ret = SqlHelper.ExecuteNonQuery(str_insert,pars);
+ if (_ret == 1)
+ {
+ MessageBox.Show("保存成功");
+ }
+ bindDgvItems();
+ }
+
+ private void getMachine()
+ {
+ DataSet ds= SqlHelper.ExecuteDataset("select ID,Name From Machine");
+ this.cboMachine.DataSource=ds.Tables[0];
+ this.cboMachine.DisplayMember = "Name";
+ this.cboMachine.ValueMember = "ID";
+ this.cboMachine.SelectedIndex = cboMachine.Items.Count>0?0:-1;
+ }
+ private void getValueType()
+ {
+ BoxItem bi1 = new BoxItem();
+ bi1.Text = "正常/不正常";
+ bi1.Value = "0";
+ this.cboValue.Items.Add(bi1);
+ BoxItem bi2 = new BoxItem();
+ bi2.Text = "数值";
+ bi2.Value = "1";
+ this.cboValue.Items.Add(bi2);
+ this.cboValue.SelectedIndex = cboMachine.Items.Count > 0 ? 0 : -1;
+ }
+ private void getPoint()
+ {
+ DataSet ds = SqlHelper.ExecuteDataset("select ID,Name From PhysicalCheckPoint");
+ this.cboPoint.DataSource=ds.Tables[0];
+ this.cboPoint.DisplayMember = "Name";
+ this.cboPoint.ValueMember = "ID";
+ this.cboPoint.SelectedIndex = cboPoint.Items.Count > 0 ? 0 : -1;
+ }
+
+ private void bindDgvItems()
+ {
+ string str_select = @"select
+ c.ID as 编号,
+ c.name as 名称,
+ c.alias as 别名,
+ (case c.ValueType when 0 then '正常/不正常' when 1 then '数值' end) as 值类型,
+ m.name as 所属机器,
+ p.name as 所属巡检点,
+ c.comment as 备注
+ from checkitem c,Machine m,PhysicalCheckPoint p
+ where c.machine_id=m.id and c.Phy_ID=p.id ";
+ DataSet ds = SqlHelper.ExecuteDataset(str_select);
+ dgvItems.DataSource=ds.Tables[0];
+ }
+
+ private void dgvItems_CellClick(object sender, DataGridViewCellEventArgs e)
+ {
+ if (e.RowIndex == -1) return;
+ if (e.ColumnIndex == 0)
+ {
+ if ((bool)dgvItems.Rows[e.RowIndex].Cells[0].EditedFormattedValue == false)
+ {
+ dgvItems.Rows[e.RowIndex].Cells[0].Value = true;
+ }
+ else
+ {
+ dgvItems.Rows[e.RowIndex].Cells[0].Value = false;
+ }
+ }
+ else
+ {
+ labID.Text = dgvItems.Rows[e.RowIndex].Cells[1].Value.ToString();
+ txtName.Text = dgvItems.Rows[e.RowIndex].Cells[2].Value.ToString();
+ txtAlias.Text = dgvItems.Rows[e.RowIndex].Cells[3].Value.ToString();
+ cboValue.Text = dgvItems.Rows[e.RowIndex].Cells[4].Value.ToString();
+ cboMachine.Text = dgvItems.Rows[e.RowIndex].Cells[5].Value.ToString();
+ cboPoint.Text = dgvItems.Rows[e.RowIndex].Cells[6].Value.ToString();
+ txtRemarks.Text = dgvItems.Rows[e.RowIndex].Cells[7].Value.ToString();
+ }
+ }
+
+ private void btnUpdate_Click(object sender, EventArgs e)
+ {
+ if (labID.Text == "")
+ {
+ return;
+ }
+ if (cboMachine.SelectedValue.ToString() == "")
+ {
+ MessageBox.Show("请选择所属机器");
+ return;
+ }
+ if (cboPoint.SelectedValue.ToString() == "")
+ {
+ MessageBox.Show("请选择所属地点");
+ return;
+ }
+
+ string str_insert = "Update CheckItem set [Name]=@name,Alias=@alias,Machine_ID=@machineid,ValueType=@valuetype,Phy_ID=@phyid,Comment=@comment where ID=" + labID.Text.Trim();
+ SqlParameter[] pars = new SqlParameter[]{
+ new SqlParameter("@name",SqlDbType.NVarChar),
+ new SqlParameter("@alias",SqlDbType.NVarChar),
+ new SqlParameter("@machineid",SqlDbType.Int),
+ new SqlParameter("@valuetype",SqlDbType.Int),
+ new SqlParameter("@phyid",SqlDbType.Int),
+ new SqlParameter("@comment",SqlDbType.NText)
+ };
+ pars[0].Value = this.txtName.Text.ToString().Trim();
+ pars[1].Value = this.txtAlias.Text.ToString().Trim();
+ pars[2].Value = this.cboMachine.SelectedValue;
+ pars[3].Value = ((BoxItem)this.cboValue.SelectedItem).Value;
+ pars[4].Value = this.cboPoint.SelectedValue;
+ pars[5].Value = this.txtRemarks.Text;
+
+ int _ret = SqlHelper.ExecuteNonQuery(str_insert, pars);
+ if (_ret == 1)
+ {
+ MessageBox.Show("保存成功");
+ }
+ bindDgvItems();
+ }
+ private void btnDel_Click(object sender, EventArgs e)
+ {
+ string Del = "";
+ string strsql = "Delete From CheckItem Where ID in(";
+ for (int i = 0; i < dgvItems.Rows.Count; i++)
+ {
+ try
+ {
+ if ((bool)dgvItems.Rows[i].Cells[0].Value == true)
+ {
+ Del += dgvItems.Rows[i].Cells[1].Value.ToString() + ",";
+ }
+ }
+ catch
+ {
+ continue;
+ }
+ }
+ if (Del != "")
+ {
+ Del = Del.Substring(0, Del.Length - 1);
+ strsql += Del + ")";
+ SqlHelper.ExecuteNonQuery(strsql);
+ bindDgvItems();
+ }
+ else
+ {
+ MessageBox.Show("请选择要删除的项");
+ }
+ }
}
}
View
232 Application/frmAddItem.cs.orig
@@ -0,0 +1,232 @@
+<<<<<<< HEAD
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace WorkStation
+{
+ public partial class frmAddItem : Form
+ {
+ public frmAddItem()
+ {
+ InitializeComponent();
+ }
+
+ }
+}
+=======
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using System.Data.SqlClient;
+
+namespace WorkStation
+{
+ public partial class frmAddItem : Form
+ {
+ public frmAddItem()
+ {
+ InitializeComponent();
+ }
+
+ private void frmAddItem_Load(object sender, EventArgs e)
+ {
+ this.labID.Text = "";
+ getMachine();
+ getValueType();
+ getPoint();
+ bindDgvItems();
+ }
+
+ private void btnSave_Click(object sender, EventArgs e)
+ {
+
+ if (cboMachine.SelectedValue.ToString() == "")
+ {
+ MessageBox.Show("请选择所属机器");
+ return;
+ }
+ if (cboPoint.SelectedValue==null)
+ {
+ MessageBox.Show("请选择所属地点");
+ return;
+ }
+ //if(SqlHelper.ExecuteNonQuery("Select 1 From CheckItem Where "))
+ string str_insert = "Insert into CheckItem([Name],Alias,Machine_ID,ValueType,Phy_ID,Comment) Values(@name,@alias,@machineid,@valuetype,@pointid,@comment)";
+ SqlParameter[] pars = new SqlParameter[]{
+ new SqlParameter("@name",SqlDbType.NVarChar),
+ new SqlParameter("@alias",SqlDbType.NVarChar),
+ new SqlParameter("@machineid",SqlDbType.Int),
+ new SqlParameter("@valuetype",SqlDbType.Int),
+ new SqlParameter("@pointid",SqlDbType.Int),
+ new SqlParameter("@comment",SqlDbType.NText)
+ };
+ pars[0].Value = this.txtName.Text.ToString().Trim();
+ pars[1].Value = this.txtAlias.Text.ToString().Trim();
+ pars[2].Value = this.cboMachine.SelectedValue;
+ pars[3].Value = ((BoxItem)this.cboValue.SelectedItem).Value;
+ pars[4].Value = this.cboPoint.SelectedValue;
+ pars[5].Value = this.txtRemarks.Text;
+
+ int _ret = SqlHelper.ExecuteNonQuery(str_insert,pars);
+ if (_ret == 1)
+ {
+ MessageBox.Show("保存成功");
+ }
+ bindDgvItems();
+ }
+
+ private void getMachine()
+ {
+ DataSet ds= SqlHelper.ExecuteDataset("select ID,Name From Machine");
+ this.cboMachine.DataSource=ds.Tables[0];
+ this.cboMachine.DisplayMember = "Name";
+ this.cboMachine.ValueMember = "ID";
+ this.cboMachine.SelectedIndex = cboMachine.Items.Count>0?0:-1;
+ }
+ private void getValueType()
+ {
+ BoxItem bi1 = new BoxItem();
+ bi1.Text = "正常/不正常";
+ bi1.Value = "0";
+ this.cboValue.Items.Add(bi1);
+ BoxItem bi2 = new BoxItem();
+ bi2.Text = "数值";
+ bi2.Value = "1";
+ this.cboValue.Items.Add(bi2);
+ this.cboValue.SelectedIndex = cboMachine.Items.Count > 0 ? 0 : -1;
+ }
+ private void getPoint()
+ {
+ DataSet ds = SqlHelper.ExecuteDataset("select ID,Name From PhysicalCheckPoint");
+ this.cboPoint.DataSource=ds.Tables[0];
+ this.cboPoint.DisplayMember = "Name";
+ this.cboPoint.ValueMember = "ID";
+ this.cboPoint.SelectedIndex = cboPoint.Items.Count > 0 ? 0 : -1;
+ }
+
+ private void bindDgvItems()
+ {
+ string str_select = @"select
+ c.ID as 编号,
+ c.name as 名称,
+ c.alias as 别名,
+ (case c.ValueType when 0 then '正常/不正常' when 1 then '数值' end) as 值类型,
+ m.name as 所属机器,
+ p.name as 所属巡检点,
+ c.comment as 备注
+ from checkitem c,Machine m,PhysicalCheckPoint p
+ where c.machine_id=m.id and c.Phy_ID=p.id ";
+ DataSet ds = SqlHelper.ExecuteDataset(str_select);
+ dgvItems.DataSource=ds.Tables[0];
+ }
+
+ private void dgvItems_CellClick(object sender, DataGridViewCellEventArgs e)
+ {
+ if (e.RowIndex == -1) return;
+ if (e.ColumnIndex == 0)
+ {
+ if ((bool)dgvItems.Rows[e.RowIndex].Cells[0].EditedFormattedValue == false)
+ {
+ dgvItems.Rows[e.RowIndex].Cells[0].Value = true;
+ }
+ else
+ {
+ dgvItems.Rows[e.RowIndex].Cells[0].Value = false;
+ }
+ }
+ else
+ {
+ labID.Text = dgvItems.Rows[e.RowIndex].Cells[1].Value.ToString();
+ txtName.Text = dgvItems.Rows[e.RowIndex].Cells[2].Value.ToString();
+ txtAlias.Text = dgvItems.Rows[e.RowIndex].Cells[3].Value.ToString();
+ cboValue.Text = dgvItems.Rows[e.RowIndex].Cells[4].Value.ToString();
+ cboMachine.Text = dgvItems.Rows[e.RowIndex].Cells[5].Value.ToString();
+ cboPoint.Text = dgvItems.Rows[e.RowIndex].Cells[6].Value.ToString();
+ txtRemarks.Text = dgvItems.Rows[e.RowIndex].Cells[7].Value.ToString();
+ }
+ }
+
+ private void btnUpdate_Click(object sender, EventArgs e)
+ {
+ if (labID.Text == "")
+ {
+ return;
+ }
+ if (cboMachine.SelectedValue.ToString() == "")
+ {
+ MessageBox.Show("请选择所属机器");
+ return;
+ }
+ if (cboPoint.SelectedValue.ToString() == "")
+ {
+ MessageBox.Show("请选择所属地点");
+ return;
+ }
+
+ string str_insert = "Update CheckItem set [Name]=@name,Alias=@alias,Machine_ID=@machineid,ValueType=@valuetype,Phy_ID=@phyid,Comment=@comment where ID=" + labID.Text.Trim();
+ SqlParameter[] pars = new SqlParameter[]{
+ new SqlParameter("@name",SqlDbType.NVarChar),
+ new SqlParameter("@alias",SqlDbType.NVarChar),
+ new SqlParameter("@machineid",SqlDbType.Int),
+ new SqlParameter("@valuetype",SqlDbType.Int),
+ new SqlParameter("@phyid",SqlDbType.Int),
+ new SqlParameter("@comment",SqlDbType.NText)
+ };
+ pars[0].Value = this.txtName.Text.ToString().Trim();
+ pars[1].Value = this.txtAlias.Text.ToString().Trim();
+ pars[2].Value = this.cboMachine.SelectedValue;
+ pars[3].Value = ((BoxItem)this.cboValue.SelectedItem).Value;
+ pars[4].Value = this.cboPoint.SelectedValue;
+ pars[5].Value = this.txtRemarks.Text;
+
+ int _ret = SqlHelper.ExecuteNonQuery(str_insert, pars);
+ if (_ret == 1)
+ {
+ MessageBox.Show("保存成功");
+ }
+ bindDgvItems();
+ }
+ private void btnDel_Click(object sender, EventArgs e)
+ {
+ string Del = "";
+ string strsql = "Delete From CheckItem Where ID in(";
+ for (int i = 0; i < dgvItems.Rows.Count; i++)
+ {
+ try
+ {
+ if ((bool)dgvItems.Rows[i].Cells[0].Value == true)
+ {
+ Del += dgvItems.Rows[i].Cells[1].Value.ToString() + ",";
+ }
+ }
+ catch
+ {
+ continue;
+ }
+ }
+ if (Del != "")
+ {
+ Del = Del.Substring(0, Del.Length - 1);
+ strsql += Del + ")";
+ SqlHelper.ExecuteNonQuery(strsql);
+ bindDgvItems();
+ }
+ else
+ {
+ MessageBox.Show("请选择要删除的项");
+ }
+ }
+ }
+}
+>>>>>>> qicb/Develop
View
244 Application/frmAddItem.resx
@@ -1,120 +1,126 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="chkColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
</root>
View
198 Application/frmAddMachine.Designer.cs
@@ -0,0 +1,198 @@
+namespace WorkStation
+{
+ partial class frmAddMachine
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.label1 = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
+ this.label3 = new System.Windows.Forms.Label();
+ this.tbName = new System.Windows.Forms.TextBox();
+ this.tbAlias = new System.Windows.Forms.TextBox();
+ this.cboArea = new System.Windows.Forms.ComboBox();
+ this.btnSave = new System.Windows.Forms.Button();
+ this.dgvMachine = new System.Windows.Forms.DataGridView();
+ this.chkColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+ this.btnDel = new System.Windows.Forms.Button();
+ this.labID = new System.Windows.Forms.Label();
+ this.btnUpdate = new System.Windows.Forms.Button();
+ ((System.ComponentModel.ISupportInitialize)(this.dgvMachine)).BeginInit();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(27, 38);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(53, 12);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "设备名称";
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(360, 39);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(53, 12);
+ this.label2.TabIndex = 1;
+ this.label2.Text = "设备别名";
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(27, 82);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(53, 12);
+ this.label3.TabIndex = 2;
+ this.label3.Text = "所属厂区";
+ //
+ // tbName
+ //
+ this.tbName.Location = new System.Drawing.Point(87, 36);
+ this.tbName.Name = "tbName";
+ this.tbName.Size = new System.Drawing.Size(245, 21);
+ this.tbName.TabIndex = 3;
+ //
+ // tbAlias
+ //
+ this.tbAlias.Location = new System.Drawing.Point(419, 36);
+ this.tbAlias.Name = "tbAlias";
+ this.tbAlias.Size = new System.Drawing.Size(211, 21);
+ this.tbAlias.TabIndex = 4;
+ //
+ // cboArea
+ //
+ this.cboArea.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cboArea.FormattingEnabled = true;
+ this.cboArea.Location = new System.Drawing.Point(87, 82);
+ this.cboArea.Name = "cboArea";
+ this.cboArea.Size = new System.Drawing.Size(244, 20);
+ this.cboArea.TabIndex = 5;
+ //
+ // btnSave
+ //
+ this.btnSave.Location = new System.Drawing.Point(419, 77);
+ this.btnSave.Name = "btnSave";
+ this.btnSave.Size = new System.Drawing.Size(61, 23);
+ this.btnSave.TabIndex = 6;
+ this.btnSave.Text = "保存";
+ this.btnSave.UseVisualStyleBackColor = true;
+ this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
+ //
+ // dgvMachine
+ //
+ this.dgvMachine.AllowUserToAddRows = false;
+ this.dgvMachine.AllowUserToDeleteRows = false;
+ this.dgvMachine.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ this.dgvMachine.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+ this.chkColumn});
+ this.dgvMachine.Location = new System.Drawing.Point(26, 161);
+ this.dgvMachine.Name = "dgvMachine";
+ this.dgvMachine.ReadOnly = true;
+ this.dgvMachine.RowTemplate.Height = 23;
+ this.dgvMachine.Size = new System.Drawing.Size(604, 236);
+ this.dgvMachine.TabIndex = 7;
+ this.dgvMachine.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvMachine_CellClick);
+ //
+ // chkColumn
+ //
+ this.chkColumn.HeaderText = "选择";
+ this.chkColumn.Name = "chkColumn";
+ this.chkColumn.ReadOnly = true;
+ this.chkColumn.Width = 38;
+ //
+ // btnDel
+ //
+ this.btnDel.Location = new System.Drawing.Point(556, 77);
+ this.btnDel.Name = "btnDel";
+ this.btnDel.Size = new System.Drawing.Size(59, 23);
+ this.btnDel.TabIndex = 8;
+ this.btnDel.Text = "删除";
+ this.btnDel.UseVisualStyleBackColor = true;
+ this.btnDel.Click += new System.EventHandler(this.btnDel_Click);
+ //
+ // labID
+ //
+ this.labID.AutoSize = true;
+ this.labID.Location = new System.Drawing.Point(337, 82);
+ this.labID.Name = "labID";
+ this.labID.Size = new System.Drawing.Size(17, 12);
+ this.labID.TabIndex = 9;
+ this.labID.Text = "ID";
+ this.labID.Visible = false;
+ //
+ // btnUpdate
+ //
+ this.btnUpdate.Location = new System.Drawing.Point(486, 77);
+ this.btnUpdate.Name = "btnUpdate";
+ this.btnUpdate.Size = new System.Drawing.Size(64, 23);
+ this.btnUpdate.TabIndex = 10;
+ this.btnUpdate.Text = "修改";
+ this.btnUpdate.UseVisualStyleBackColor = true;
+ this.btnUpdate.Click += new System.EventHandler(this.btnUpdate_Click);
+ //
+ // frmAddMachine
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(667, 460);
+ this.Controls.Add(this.btnUpdate);
+ this.Controls.Add(this.labID);
+ this.Controls.Add(this.btnDel);
+ this.Controls.Add(this.dgvMachine);
+ this.Controls.Add(this.btnSave);
+ this.Controls.Add(this.cboArea);
+ this.Controls.Add(this.tbAlias);
+ this.Controls.Add(this.tbName);
+ this.Controls.Add(this.label3);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.label1);
+ this.Name = "frmAddMachine";
+ this.Text = "添加设备";
+ this.Load += new System.EventHandler(this.frmAddSiteArea_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.dgvMachine)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.TextBox tbName;
+ private System.Windows.Forms.TextBox tbAlias;
+ private System.Windows.Forms.ComboBox cboArea;
+ private System.Windows.Forms.Button btnSave;
+ private System.Windows.Forms.DataGridView dgvMachine;
+ private System.Windows.Forms.Button btnDel;
+ private System.Windows.Forms.DataGridViewCheckBoxColumn chkColumn;
+ private System.Windows.Forms.Label labID;
+ private System.Windows.Forms.Button btnUpdate;
+ }
+}
View
136 Application/frmAddMachine.cs
@@ -0,0 +1,136 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using System.Data.SqlClient;
+
+namespace WorkStation
+{
+ public partial class frmAddMachine : Form
+ {
+ public frmAddMachine()
+ {
+ InitializeComponent();
+ }
+ private void frmAddSiteArea_Load(object sender, EventArgs e)
+ {
+ getArea();
+ bindDgvMachine();
+ }
+
+ private void btnSave_Click(object sender, EventArgs e)
+ {
+ SqlParameter[] pars = new SqlParameter[] {
+ new SqlParameter("@name",this.tbName.Text.Trim().ToString()),
+ new SqlParameter("@alias",this.tbAlias.Text.Trim().ToString()),
+ new SqlParameter("@site_id",SqlDbType.BigInt)
+ };
+ pars[2].Value = cboArea.SelectedValue;
+
+ string strSql = "insert into machine([Name],Alias,Site_ID) values(@name,@alias,@site_id)";
+
+ if (SqlHelper.ExecuteNonQuery(strSql, pars) == 1)
+ {
+ MessageBox.Show("保存成功");
+ bindDgvMachine();
+ }
+
+ }
+
+ private void getArea()
+ {
+ DataSet ds = SqlHelper.ExecuteDataset("select ID,Name From Site");
+ this.cboArea.DataSource = ds.Tables[0];
+ this.cboArea.DisplayMember = "Name";
+ this.cboArea.ValueMember = "ID";
+ this.cboArea.SelectedIndex = cboArea.Items.Count > 0 ? 0 : -1;
+ }
+
+ private void bindDgvMachine()
+ {
+ string str_select = @"select
+ m.id as 编号,
+ m.name as 设备名称,
+ m.alias as 别名,
+ s.name as 厂区
+ from machine m,site s
+ where m.site_id=s.id";
+ DataSet ds = SqlHelper.ExecuteDataset(str_select);
+ this.dgvMachine.DataSource=ds.Tables[0];
+ }
+
+ private void dgvMachine_CellClick(object sender, DataGridViewCellEventArgs e)
+ {
+ if (e.RowIndex == -1) return;
+ if (e.ColumnIndex == 0)
+ {
+ if ((bool)dgvMachine.Rows[e.RowIndex].Cells[0].EditedFormattedValue == false)
+ {
+ dgvMachine.Rows[e.RowIndex].Cells[0].Value = true;
+ }
+ else
+ {
+ dgvMachine.Rows[e.RowIndex].Cells[0].Value = false;
+ }
+ }
+ else
+ {
+ labID.Text = dgvMachine.Rows[e.RowIndex].Cells[1].Value.ToString();
+ tbName.Text = dgvMachine.Rows[e.RowIndex].Cells[2].Value.ToString();
+ tbAlias.Text = dgvMachine.Rows[e.RowIndex].Cells[3].Value.ToString();
+ cboArea.Text = dgvMachine.Rows[e.RowIndex].Cells[4].Value.ToString();
+ }
+
+ }
+
+ private void btnDel_Click(object sender, EventArgs e)
+ {
+ string Del = "";
+ string strsql = "Delete From Machine Where ID in(";
+ for (int i = 0; i < dgvMachine.Rows.Count; i++)
+ {
+ try
+ {
+ if ((bool)dgvMachine.Rows[i].Cells[0].Value == true)
+ {
+ Del += dgvMachine.Rows[i].Cells[1].Value.ToString() + ",";
+ }
+ }
+ catch
+ {
+ continue;
+ }
+ }
+ if (Del != "")
+ {
+ Del = Del.Substring(0, Del.Length - 1);
+ strsql += Del + ")";
+ SqlHelper.ExecuteNonQuery(strsql);
+ bindDgvMachine();
+ }
+
+ }
+
+ private void btnUpdate_Click(object sender, EventArgs e)
+ {
+ SqlParameter[] pars = new SqlParameter[] {
+ new SqlParameter("@name",this.tbName.Text.Trim().ToString()),
+ new SqlParameter("@alias",this.tbAlias.Text.Trim().ToString()),
+ new SqlParameter("@site_id",SqlDbType.BigInt)
+ };
+ pars[2].Value = cboArea.SelectedValue;
+ string strSql = "Update machine set [Name]=@name,Alias=@alias,Site_ID=@site_id where id=" + labID.Text;
+ if (SqlHelper.ExecuteNonQuery(strSql,pars) == 1)
+ {
+ MessageBox.Show("修改成功");
+ bindDgvMachine();
+ }
+ }
+
+
+ }
+}
View
123 Application/frmAddMachine.resx
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>