Skip to content

Commit

Permalink
移除杂项
Browse files Browse the repository at this point in the history
  • Loading branch information
aprilyush committed Jul 9, 2018
1 parent afb4a04 commit 556c451
Show file tree
Hide file tree
Showing 297 changed files with 237 additions and 321,221 deletions.
Binary file modified .vs/YIEternalMIS/v15/.suo
Binary file not shown.
Binary file modified .vs/YIEternalMIS/v15/Server/sqlite3/storage.ide
Binary file not shown.
Binary file modified .vs/YIEternalMIS/v15/Server/sqlite3/storage.ide-shm
Binary file not shown.
Binary file modified .vs/YIEternalMIS/v15/Server/sqlite3/storage.ide-wal
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@



namespace YIEternalMIS.DBUtility
namespace YIEternalMIS.Common
{
public enum EffentNextType
{
Expand Down
112 changes: 3 additions & 109 deletions DBUtility/DbHelperSQL.cs → Common/Dbhelper/DbHelperSQL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
using System.Collections.Generic;


namespace YIEternalMIS.DBUtility
namespace YIEternalMIS.Common
{
/// <summary>
/// 数据访问抽象基础类
/// Copyright (C) YIEternal
/// </summary>
public abstract class DbHelperSQL
public class DbHelperSQL
{
//数据库连接字符串(web.config来配置),多数据库可使用DbHelperSQLP来实现.
public static string connectionString = PubConstant.ConnectionString;
Expand Down Expand Up @@ -174,113 +174,7 @@ public static int ExecuteSqlByTime(string SQLString, int Times)
}
}

/// <summary>
/// 执行Sql和Oracle滴混合事务
/// </summary>
/// <param name="list">SQL命令行列表</param>
/// <param name="oracleCmdSqlList">Oracle命令行列表</param>
/// <returns>执行结果 0-由于SQL造成事务失败 -1 由于Oracle造成事务失败 1-整体事务执行成功</returns>
public static int ExecuteSqlTran(List<CommandInfo> list, List<CommandInfo> oracleCmdSqlList)
{
using (SqlConnection conn = new SqlConnection(connectionString))
{
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
SqlTransaction tx = conn.BeginTransaction();
cmd.Transaction = tx;
try
{
foreach (CommandInfo myDE in list)
{
string cmdText = myDE.CommandText;
SqlParameter[] cmdParms = (SqlParameter[])myDE.Parameters;
PrepareCommand(cmd, conn, tx, cmdText, cmdParms);
if (myDE.EffentNextType == EffentNextType.SolicitationEvent)
{
if (myDE.CommandText.ToLower().IndexOf("count(") == -1)
{
tx.Rollback();
throw new Exception("违背要求"+myDE.CommandText+"必须符合select count(..的格式");
//return 0;
}

object obj = cmd.ExecuteScalar();
bool isHave = false;
if (obj == null && obj == DBNull.Value)
{
isHave = false;
}
isHave = Convert.ToInt32(obj) > 0;
if (isHave)
{
//引发事件
myDE.OnSolicitationEvent();
}
}
if (myDE.EffentNextType == EffentNextType.WhenHaveContine || myDE.EffentNextType == EffentNextType.WhenNoHaveContine)
{
if (myDE.CommandText.ToLower().IndexOf("count(") == -1)
{
tx.Rollback();
throw new Exception("SQL:违背要求" + myDE.CommandText + "必须符合select count(..的格式");
//return 0;
}

object obj = cmd.ExecuteScalar();
bool isHave = false;
if (obj == null && obj == DBNull.Value)
{
isHave = false;
}
isHave = Convert.ToInt32(obj) > 0;

if (myDE.EffentNextType == EffentNextType.WhenHaveContine && !isHave)
{
tx.Rollback();
throw new Exception("SQL:违背要求" + myDE.CommandText + "返回值必须大于0");
//return 0;
}
if (myDE.EffentNextType == EffentNextType.WhenNoHaveContine && isHave)
{
tx.Rollback();
throw new Exception("SQL:违背要求" + myDE.CommandText + "返回值必须等于0");
//return 0;
}
continue;
}
int val = cmd.ExecuteNonQuery();
if (myDE.EffentNextType == EffentNextType.ExcuteEffectRows && val == 0)
{
tx.Rollback();
throw new Exception("SQL:违背要求" + myDE.CommandText + "必须有影响行");
//return 0;
}
cmd.Parameters.Clear();
}
string oraConnectionString = PubConstant.GetConnectionString("ConnectionStringPPC");
bool res = OracleHelper.ExecuteSqlTran(oraConnectionString, oracleCmdSqlList);
if (!res)
{
tx.Rollback();
throw new Exception("Oracle执行失败");
// return -1;
}
tx.Commit();
return 1;
}
catch (System.Data.SqlClient.SqlException e)
{
tx.Rollback();
throw e;
}
catch (Exception e)
{
tx.Rollback();
throw e;
}
}
}

/// <summary>
/// 执行多条SQL语句,实现数据库事务。
/// </summary>
Expand Down
11 changes: 5 additions & 6 deletions DBUtility/PubConstant.cs → Common/Dbhelper/PubConstant.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
using System;
using System.Configuration;
using YIEternalMIS.Common;
namespace YIEternalMIS.DBUtility
namespace YIEternalMIS.Common
{

public class PubConstant
{
private static string _Connstr;
private static string _SqliteConnstr;
private static string _connectionString;

public static string Connstr
public static string SqliteConnstr
{
set { _Connstr = value; }
get { return _Connstr; }
set { _SqliteConnstr = value; }
get { return _SqliteConnstr; }
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion DBUtility/SQLHelper.cs → Common/Dbhelper/SQLHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using System.Data.SqlClient;
using System.Collections;

namespace YIEternalMIS.DBUtility
namespace YIEternalMIS.Common
{

/// <summary>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
85 changes: 48 additions & 37 deletions Common/YIEternalMIS.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="DevExpress.Data.v15.1, Version=15.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
Expand Down Expand Up @@ -60,58 +61,68 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CCursor.cs" />
<Compile Include="CEncoder.cs" />
<Compile Include="CheckVision.cs" />
<Compile Include="ConfigHelper.cs" />
<Compile Include="Convertto.cs" />
<Compile Include="CustomException.cs" />
<Compile Include="DataCache.cs" />
<Compile Include="DataConverter.cs" />
<Compile Include="DEncrypt.cs" />
<Compile Include="DESEncrypt.cs" />
<Compile Include="DiskReg.cs" />
<Compile Include="Globals.cs" />
<Compile Include="IniFile.cs" />
<Compile Include="DataId\IdHelper.cs" />
<Compile Include="DataId\ObjectId.cs" />
<Compile Include="Dbhelper\CommandInfo.cs" />
<Compile Include="Dbhelper\DbHelperSQL.cs" />
<Compile Include="Dbhelper\PubConstant.cs" />
<Compile Include="Dbhelper\SQLHelper.cs" />
<Compile Include="Extends\Ext.Convert.cs" />
<Compile Include="Extends\TimeHelper.cs" />
<Compile Include="Validate\ValidateHelper.cs" />
<Compile Include="Winform\CCursor.cs" />
<Compile Include="Encrypt\CEncoder.cs" />
<Compile Include="Winform\CheckVision.cs" />
<Compile Include="File\ConfigHelper.cs" />
<Compile Include="Convert\Convertto.cs" />
<Compile Include="Devexpress\CustomException.cs" />
<Compile Include="Cache\DataCache.cs" />
<Compile Include="Convert\DataConverter.cs" />
<Compile Include="Encrypt\DEncrypt.cs" />
<Compile Include="Encrypt\DESEncrypt.cs" />
<Compile Include="File\DiskReg.cs" />
<Compile Include="Devexpress\Globals.cs" />
<Compile Include="File\IniFile.cs" />
<Compile Include="LoginUser.cs" />
<Compile Include="LogNHelper.cs" />
<Compile Include="ModelHandler.cs" />
<Compile Include="Msg.cs" />
<Compile Include="MyDateTimeHelper.cs" />
<Compile Include="MyDirHelper.cs" />
<Compile Include="MyFileDialogHelper.cs" />
<Compile Include="MyPinYinHelper.cs" />
<Compile Include="MyFtpHelper.cs" />
<Compile Include="MyValidateHelper.cs" />
<Compile Include="Log\LogNHelper.cs" />
<Compile Include="Convert\ModelHandler.cs" />
<Compile Include="Devexpress\Msg.cs" />
<Compile Include="Validate\MyDateTimeHelper.cs" />
<Compile Include="File\MyDirHelper.cs" />
<Compile Include="File\MyFileDialogHelper.cs" />
<Compile Include="Validate\MyPinYinHelper.cs" />
<Compile Include="File\MyFtpHelper.cs" />
<Compile Include="FormValidate\MyValidateHelper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RMBConvert.cs" />
<Compile Include="MyStringHelper.cs" />
<Compile Include="SerialPortConfig.cs" />
<Compile Include="SystemConfig.cs" />
<Compile Include="UpdateType.cs" />
<Compile Include="ValiControlRule.cs" />
<Compile Include="ValiCustomRuleByRegex.cs" />
<Compile Include="ValiCustomRuleUniformity.cs" />
<Compile Include="ValiCustomValidation.cs" />
<Compile Include="YIEBookConfig.cs" />
<Compile Include="YIEMsgType.cs" />
<Compile Include="YIESplashScreen.cs">
<Compile Include="Convert\RMBConvert.cs" />
<Compile Include="Validate\MyStringHelper.cs" />
<Compile Include="Winform\SerialPortConfig.cs" />
<Compile Include="Winform\SystemConfig.cs" />
<Compile Include="Winform\UpdateType.cs" />
<Compile Include="FormValidate\ValiControlRule.cs" />
<Compile Include="FormValidate\ValiCustomRuleByRegex.cs" />
<Compile Include="FormValidate\ValiCustomRuleUniformity.cs" />
<Compile Include="FormValidate\ValiCustomValidation.cs" />
<Compile Include="Devexpress\YIEBookConfig.cs" />
<Compile Include="Devexpress\YIEMsgType.cs" />
<Compile Include="Devexpress\YIESplashScreen.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="YIESplashScreen.Designer.cs">
<Compile Include="Devexpress\YIESplashScreen.Designer.cs">
<DependentUpon>YIESplashScreen.cs</DependentUpon>
</Compile>
<Compile Include="ZipTools.cs" />
<Compile Include="File\ZipTools.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\licenses.licx" />
<EmbeddedResource Include="YIESplashScreen.resx">
<EmbeddedResource Include="Devexpress\YIESplashScreen.resx">
<DependentUpon>YIESplashScreen.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<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.
Expand Down
2 changes: 1 addition & 1 deletion Common/YIEternalMIS.Common.csproj.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
</Project>
Loading

0 comments on commit 556c451

Please sign in to comment.