Browse Source

first commit

zhuyiyi 9 months ago
commit
c0ef279e38
100 changed files with 15387 additions and 0 deletions
  1. 10 0
      .gitignore
  2. 0 0
      BizCom/.editorconfig
  3. 191 0
      BizCom/BizCom.csproj
  4. 6 0
      BizCom/BizCom.csproj.user
  5. 188 0
      BizCom/BizCom2022.csproj
  6. 6 0
      BizCom/BizCom2022.csproj.user
  7. 35 0
      BizCom/CategoryService.cs
  8. 19 0
      BizCom/Cls/MenuItem.cs
  9. 477 0
      BizCom/ComBase.cs
  10. 18 0
      BizCom/Dao/CEErpPrintModel.cs
  11. 74 0
      BizCom/Dao/CeColumns.cs
  12. 502 0
      BizCom/Dao/CeErpBagOrder.cs
  13. 58 0
      BizCom/Dao/CeErpBagShopGoods.cs
  14. 364 0
      BizCom/Dao/CeErpBill.cs
  15. 199 0
      BizCom/Dao/CeErpCustomer.cs
  16. 98 0
      BizCom/Dao/CeErpDataSendOrderInfo.cs
  17. 76 0
      BizCom/Dao/CeErpDesignInfo.cs
  18. 300 0
      BizCom/Dao/CeErpDesignerBill.cs
  19. 86 0
      BizCom/Dao/CeErpDesignerBillLog.cs
  20. 119 0
      BizCom/Dao/CeErpDesignerFinishRate.cs
  21. 199 0
      BizCom/Dao/CeErpDesignerFinishRateNew.cs
  22. 207 0
      BizCom/Dao/CeErpExpressInfo.cs
  23. 145 0
      BizCom/Dao/CeErpInvoicingInfo.cs
  24. 75 0
      BizCom/Dao/CeErpMailInfo.cs
  25. 84 0
      BizCom/Dao/CeErpMessageAPI.cs
  26. 72 0
      BizCom/Dao/CeErpMessageTip.cs
  27. 40 0
      BizCom/Dao/CeErpMethod.cs
  28. 138 0
      BizCom/Dao/CeErpModular.cs
  29. 111 0
      BizCom/Dao/CeErpNotice.cs
  30. 70 0
      BizCom/Dao/CeErpNoticeCell.cs
  31. 33 0
      BizCom/Dao/CeErpOpt.cs
  32. 67 0
      BizCom/Dao/CeErpOrderFormData.cs
  33. 43 0
      BizCom/Dao/CeErpOrganization.cs
  34. 121 0
      BizCom/Dao/CeErpPermission.cs
  35. 132 0
      BizCom/Dao/CeErpPersuade.cs
  36. 204 0
      BizCom/Dao/CeErpPlaceRegister.cs
  37. 121 0
      BizCom/Dao/CeErpPost.cs
  38. 75 0
      BizCom/Dao/CeErpProcessList.cs
  39. 523 0
      BizCom/Dao/CeErpProduct.cs
  40. 111 0
      BizCom/Dao/CeErpProductHour.cs
  41. 123 0
      BizCom/Dao/CeErpProductPrice.cs
  42. 53 0
      BizCom/Dao/CeErpProfession.cs
  43. 186 0
      BizCom/Dao/CeErpReturnCash.cs
  44. 104 0
      BizCom/Dao/CeErpSampleCustomer.cs
  45. 214 0
      BizCom/Dao/CeErpShop.cs
  46. 50 0
      BizCom/Dao/CeErpSpecialRefund.cs
  47. 179 0
      BizCom/Dao/CeErpStayGoods.cs
  48. 64 0
      BizCom/Dao/CeErpSukuraData.cs
  49. 141 0
      BizCom/Dao/CeErpSupplier.cs
  50. 158 0
      BizCom/Dao/CeErpSupplierProduct.cs
  51. 53 0
      BizCom/Dao/CeErpTmcLog.cs
  52. 36 0
      BizCom/Dao/CeErpToManagement.cs
  53. 497 0
      BizCom/Dao/CeErpTrade.cs
  54. 187 0
      BizCom/Dao/CeErpTradeAfterSaleExtend.cs
  55. 90 0
      BizCom/Dao/CeErpTradeAfterSaleLog.cs
  56. 1210 0
      BizCom/Dao/CeErpTradeCell.cs
  57. 450 0
      BizCom/Dao/CeErpTradeCellExtend.cs
  58. 120 0
      BizCom/Dao/CeErpTradeLog.cs
  59. 324 0
      BizCom/Dao/CeErpTradeOrder.cs
  60. 287 0
      BizCom/Dao/CeErpTradeRefund.cs
  61. 184 0
      BizCom/Dao/CeErpTradeResponsible.cs
  62. 119 0
      BizCom/Dao/CeErpTradeSample.cs
  63. 154 0
      BizCom/Dao/CeErpTradeSpu.cs
  64. 352 0
      BizCom/Dao/CeErpUser.cs
  65. 347 0
      BizCom/Dao/CeErpUserInfo.cs
  66. 90 0
      BizCom/Dao/CeErpUserPost.cs
  67. 241 0
      BizCom/Dao/CeErpZhangDan.cs
  68. 84 0
      BizCom/Dao/CeWithdraw.cs
  69. 84 0
      BizCom/Dao/LogOperate.cs
  70. 84 0
      BizCom/Dao/Log_Login.cs
  71. 423 0
      BizCom/Dao/SUser.cs
  72. 120 0
      BizCom/Dao/SZcItem.cs
  73. 119 0
      BizCom/Dao/S_BuChaJia.cs
  74. 58 0
      BizCom/Dao/S_CdrToPng.cs
  75. 168 0
      BizCom/Dao/S_ErpModular.cs
  76. 97 0
      BizCom/Dao/S_RefundTmc.cs
  77. 97 0
      BizCom/Dao/S_TaoBaoTmc2.cs
  78. 97 0
      BizCom/Dao/S_TaoBaoTmc3.cs
  79. 96 0
      BizCom/Dao/Sheet1$.cs
  80. 118 0
      BizCom/Dao/Sheet2$.cs
  81. 30 0
      BizCom/Dao/Sheet3$.cs
  82. 168 0
      BizCom/Dao/SiteInfo.cs
  83. 75 0
      BizCom/Dao/SupplierLog.cs
  84. 27 0
      BizCom/Dao/UserObj.cs
  85. 108 0
      BizCom/Dao/XLog.cs
  86. 111 0
      BizCom/Dao/XModular.cs
  87. 98 0
      BizCom/Dao/XPermission.cs
  88. 181 0
      BizCom/Dao/XUser.cs
  89. 75 0
      BizCom/Dao/X_Log.cs
  90. 53 0
      BizCom/Dao/X_Log_Dispatch.cs
  91. 120 0
      BizCom/Dao/X_User.cs
  92. 829 0
      BizCom/Dao/test.cs
  93. 342 0
      BizCom/DicSysBase.cs
  94. 10 0
      BizCom/Enum/GoodsState.cs
  95. 10 0
      BizCom/Enum/LabOrderState.cs
  96. 9 0
      BizCom/Enum/MessageState.cs
  97. 24 0
      BizCom/Enum/ModelType.cs
  98. 18 0
      BizCom/Enum/OrderState.cs
  99. 30 0
      BizCom/Enum/ProductCategory.cs
  100. 14 0
      BizCom/Enum/TaskPersonState.cs

+ 10 - 0
.gitignore

@@ -0,0 +1,10 @@
+.vs
+BizCom/bin/
+BizCom/obj/
+ecomServer/bin/
+ecomServer/obj/
+SiteCore/bin/
+SiteCore/obj/
+ThridCore/bin/
+ThridCore/obj/
+packages/*

+ 0 - 0
BizCom/.editorconfig


+ 191 - 0
BizCom/BizCom.csproj

@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{604A4141-248D-4A34-9985-CB19E3B00B39}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>BizCom</RootNamespace>
+    <AssemblyName>BizCom</AssemblyName>
+    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\Web\Bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Castle.ActiveRecord">
+      <HintPath>..\Support\Castle.ActiveRecord.dll</HintPath>
+    </Reference>
+    <Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath>
+    </Reference>
+    <Reference Include="NHibernate">
+      <HintPath>..\Support\NHibernate.dll</HintPath>
+    </Reference>
+    <Reference Include="SQLData, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\Support\SQLData.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="CategoryService.cs" />
+    <Compile Include="Dao\CeErpDataSendOrderInfo.cs" />
+    <Compile Include="Dao\CeErpDesignerFinishRateNew.cs" />
+    <Compile Include="Dao\CeErpDesignInfo.cs" />
+    <Compile Include="Dao\CeErpMessageAPI.cs" />
+    <Compile Include="Dao\CeErpSampleCustomer.cs" />
+    <Compile Include="Dao\CeErpSukuraData.cs" />
+    <Compile Include="Dao\CeErpToManagement.cs" />
+    <Compile Include="Dao\CeErpSpecialRefund.cs" />
+    <Compile Include="Dao\CeErpOrderFormData.cs" />
+    <Compile Include="Cls\MenuItem.cs" />
+    <Compile Include="ComBase.cs" />
+    <Compile Include="Dao\CeErpBill.cs" />
+    <Compile Include="Dao\CeErpCustomer.cs" />
+    <Compile Include="Dao\CeErpDesignerBill.cs" />
+    <Compile Include="Dao\CeErpDesignerBillLog.cs" />
+    <Compile Include="Dao\CeErpDesignerFinishRate.cs" />
+    <Compile Include="Dao\CeErpExpressInfo.cs" />
+    <Compile Include="Dao\CeErpInvoicingInfo.cs" />
+    <Compile Include="Dao\CeErpMailInfo.cs" />
+    <Compile Include="Dao\CeErpMethod.cs" />
+    <Compile Include="Dao\CeErpModular.cs" />
+    <Compile Include="Dao\CeErpNotice.cs" />
+    <Compile Include="Dao\CeErpNoticeCell.cs" />
+    <Compile Include="Dao\CeErpOpt.cs" />
+    <Compile Include="Dao\CeErpOrganization.cs" />
+    <Compile Include="Dao\CeErpPermission.cs" />
+    <Compile Include="Dao\CeErpPersuade.cs" />
+    <Compile Include="Dao\CeErpPlaceRegister.cs" />
+    <Compile Include="Dao\CeErpProcessList.cs" />
+    <Compile Include="Dao\CeErpProfession.cs" />
+    <Compile Include="Dao\CeErpStayGoods.cs" />
+    <Compile Include="Dao\CeErpTmcLog.cs" />
+    <Compile Include="Dao\CeErpTradeAfterSaleLog.cs" />
+    <Compile Include="Dao\CeErpTradeCell.cs" />
+    <Compile Include="Dao\CeErpTradeCellExtend.cs" />
+    <Compile Include="Dao\CeErpTradeLog.cs" />
+    <Compile Include="Dao\CeErpTradeRefund.cs" />
+    <Compile Include="Dao\CeErpTradeResponsible.cs" />
+    <Compile Include="Dao\CeErpTradeSample.cs" />
+    <Compile Include="Dao\CeErpTradeSpu.cs" />
+    <Compile Include="Dao\CeErpUserInfo.cs" />
+    <Compile Include="Dao\CeErpPost.cs" />
+    <Compile Include="Dao\CeErpProduct.cs" />
+    <Compile Include="Dao\CeErpProductHour.cs" />
+    <Compile Include="Dao\CeErpReturnCash.cs" />
+    <Compile Include="Dao\CeErpShop.cs" />
+    <Compile Include="Dao\CeErpSupplier.cs" />
+    <Compile Include="Dao\CeErpSupplierProduct.cs" />
+    <Compile Include="Dao\CeErpTrade.cs" />
+    <Compile Include="Dao\CeErpTradeOrder.cs" />
+    <Compile Include="Dao\CeErpUser.cs" />
+    <Compile Include="Dao\CeErpUserPost.cs" />
+    <Compile Include="Dao\CeErpZhangDan.cs" />
+    <Compile Include="Dao\CeErpProductPrice.cs" />
+    <Compile Include="Dao\CeWithdraw.cs" />
+    <Compile Include="Dao\CeErpTradeAfterSaleExtend.cs" />
+    <Compile Include="Dao\LogOperate.cs" />
+    <Compile Include="Dao\Log_Login.cs" />
+    <Compile Include="Dao\CeErpMessageTip.cs" />
+    <Compile Include="Dao\SiteInfo.cs" />
+    <Compile Include="Dao\SupplierLog.cs" />
+    <Compile Include="Dao\SUser.cs" />
+    <Compile Include="Dao\SZcItem.cs" />
+    <Compile Include="Dao\UserObj.cs" />
+    <Compile Include="Dao\CEErpPrintModel.cs" />
+    <Compile Include="Enum\MessageState.cs" />
+    <Compile Include="Enum\ProductCategory.cs" />
+    <Compile Include="Enum\OrderState.cs" />
+    <Compile Include="Enum\ProductCategory.cs" />
+    <Compile Include="Enum\XiuState.cs" />
+    <Compile Include="SiteDao\dic\SConcealType.cs" />
+    <Compile Include="Dao\XPermission.cs" />
+    <Compile Include="Enum\LabOrderState.cs" />
+    <Compile Include="Enum\ModelType.cs" />
+    <Compile Include="Enum\TaskState.cs" />
+    <Compile Include="Enum\TaskPersonState.cs" />
+    <Compile Include="Dao\XLog.cs" />
+    <Compile Include="Dao\XModular.cs" />
+    <Compile Include="Dao\XUser.cs" />
+    <Compile Include="DicSysBase.cs" />
+    <Compile Include="Enum\GoodsState.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include=".editorconfig" />
+  </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.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 6 - 0
BizCom/BizCom.csproj.user

@@ -0,0 +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>
+  </PropertyGroup>
+</Project>

+ 188 - 0
BizCom/BizCom2022.csproj

@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{604A4141-248D-4A34-9985-CB19E3B00B39}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>BizCom</RootNamespace>
+    <AssemblyName>BizCom</AssemblyName>
+    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\Web\Bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Castle.ActiveRecord">
+      <HintPath>..\Support\Castle.ActiveRecord.dll</HintPath>
+    </Reference>
+    <Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
+      <HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath>
+    </Reference>
+    <Reference Include="NHibernate">
+      <HintPath>..\Support\NHibernate.dll</HintPath>
+    </Reference>
+    <Reference Include="SQLData, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\Support\SQLData.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Configuration" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Web" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="CategoryService.cs" />
+    <Compile Include="Cls\MenuItem.cs" />
+    <Compile Include="ComBase.cs" />
+    <Compile Include="Dao\CeColumns.cs" />
+    <Compile Include="Dao\CeErpBagOrder.cs" />
+    <Compile Include="Dao\CeErpBagShopGoods.cs" />
+    <Compile Include="Dao\CeErpBill.cs" />
+    <Compile Include="Dao\CeErpCustomer.cs" />
+    <Compile Include="Dao\CeErpDesignerBill.cs" />
+    <Compile Include="Dao\CeErpDesignerBillLog.cs" />
+    <Compile Include="Dao\CeErpDesignerFinishRate.cs" />
+    <Compile Include="Dao\CeErpExpressInfo.cs" />
+    <Compile Include="Dao\CeErpInvoicingInfo.cs" />
+    <Compile Include="Dao\CeErpMailInfo.cs" />
+    <Compile Include="Dao\CeErpMethod.cs" />
+    <Compile Include="Dao\CeErpModular.cs" />
+    <Compile Include="Dao\CeErpNotice.cs" />
+    <Compile Include="Dao\CeErpNoticeCell.cs" />
+    <Compile Include="Dao\CeErpOpt.cs" />
+    <Compile Include="Dao\CeErpOrganization.cs" />
+    <Compile Include="Dao\CeErpOrderFormData.cs" />
+    <Compile Include="Enum\MessageState.cs" />
+    <Compile Include="Dao\CeErpPermission.cs" />
+    <Compile Include="Dao\CeErpPersuade.cs" />
+    <Compile Include="Dao\CeErpPlaceRegister.cs" />
+    <Compile Include="Dao\CeErpProcessList.cs" />
+    <Compile Include="Dao\CeErpProductPrice.cs" />
+    <Compile Include="Dao\CeErpProfession.cs" />
+    <Compile Include="Dao\CeErpStayGoods.cs" />
+    <Compile Include="Dao\CeErpTmcLog.cs" />
+    <Compile Include="Dao\CeErpTradeCell.cs" />
+    <Compile Include="Dao\CeErpTradeLog.cs" />
+    <Compile Include="Dao\CeErpTradeRefund.cs" />
+    <Compile Include="Dao\CeErpTradeResponsible.cs" />
+    <Compile Include="Dao\CeErpTradeAfterSaleExtend.cs" />
+    <Compile Include="Dao\CeErpTradeAfterSaleLog.cs" />
+    <Compile Include="Dao\CeErpTradeSample.cs" />
+    <Compile Include="Dao\CeErpUserInfo.cs" />
+    <Compile Include="Dao\CeErpPost.cs" />
+    <Compile Include="Dao\CeErpProduct.cs" />
+    <Compile Include="Dao\CeErpProductHour.cs" />
+    <Compile Include="Dao\CeErpReturnCash.cs" />
+    <Compile Include="Dao\CeErpShop.cs" />
+    <Compile Include="Dao\CeErpSupplier.cs" />
+    <Compile Include="Dao\CeErpSupplierProduct.cs" />
+    <Compile Include="Dao\CeErpTrade.cs" />
+    <Compile Include="Dao\CeErpTradeOrder.cs" />
+    <Compile Include="Dao\CeErpUser.cs" />
+    <Compile Include="Dao\CeErpUserPost.cs" />
+    <Compile Include="Dao\CeErpZhangDan.cs" />
+    <Compile Include="Dao\LogOperate.cs" />
+    <Compile Include="Dao\Log_Login.cs" />
+    <Compile Include="Dao\SiteInfo.cs" />
+    <Compile Include="Dao\SupplierLog.cs" />
+    <Compile Include="Dao\SUser.cs" />
+    <Compile Include="Dao\SZcItem.cs" />
+    <Compile Include="Dao\S_BuChaJia.cs" />
+    <Compile Include="Dao\S_CdrToPng.cs" />
+    <Compile Include="Dao\S_ErpModular.cs" />
+    <Compile Include="Dao\S_RefundTmc.cs" />
+    <Compile Include="Dao\UserObj.cs" />
+    <Compile Include="Dao\CEErpPrintModel.cs" />
+    <Compile Include="Dao\X_Log.cs" />
+    <Compile Include="Dao\X_Log_Dispatch.cs" />
+    <Compile Include="Dao\X_User.cs" />
+    <Compile Include="Enum\OrderState.cs" />
+    <Compile Include="Enum\XiuState.cs" />
+    <Compile Include="SiteDao\dic\SConcealType.cs" />
+    <Compile Include="Dao\XPermission.cs" />
+    <Compile Include="Enum\LabOrderState.cs" />
+    <Compile Include="Enum\ModelType.cs" />
+    <Compile Include="Enum\TaskState.cs" />
+    <Compile Include="Enum\TaskPersonState.cs" />
+    <Compile Include="Dao\XLog.cs" />
+    <Compile Include="Dao\XModular.cs" />
+    <Compile Include="Dao\XUser.cs" />
+    <Compile Include="DicSysBase.cs" />
+    <Compile Include="Enum\GoodsState.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="packages.config" />
+  </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.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 6 - 0
BizCom/BizCom2022.csproj.user

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <ProjectView>ShowAllFiles</ProjectView>
+  </PropertyGroup>
+</Project>

+ 35 - 0
BizCom/CategoryService.cs

@@ -0,0 +1,35 @@
+using SQLData;
+using System.Data;
+using System.Text;
+
+namespace BizCom
+{
+    public class CategoryService
+    {
+        public static void SaveCategory(string table, string name, int id)
+        {
+            StringBuilder sql = new StringBuilder();
+            if (id > 0) sql.AppendFormat("update {0} set name='{1}' where id={2} ;", table, name, id);
+            else
+            {
+                sql.AppendFormat("insert into {0}(name) values('{1}') ;", table, name);
+            }
+            DbHelper.DbConn.ExecuteNonQuery(sql.ToString());
+        }
+
+        public static void DelCategory(string table, int id)
+        {
+            string sql = string.Format("delete from {0} where id={1} ;", table, id);
+            DbHelper.DbConn.ExecuteNonQuery(sql);
+        }
+
+        public static DataTable GetCategory(string table, string where)
+        {
+            string sql = "";
+            if (where == "") sql = string.Format("select * from {0}  ;", table);
+            else sql = string.Format("select * from {0} where {1} ;", table, where);
+            return DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
+        }
+
+    }
+}

+ 19 - 0
BizCom/Cls/MenuItem.cs

@@ -0,0 +1,19 @@
+using System.Collections.Generic;
+
+namespace BizCom
+{
+    public class MyMenu
+    {
+        public List<MyMenuItem> MList { get; set; }
+    }
+
+
+    public class MyMenuItem
+    {
+        public string id { get; set; }
+        public string iconCls { get; set; }
+        public string text { get; set; }
+        public string url { get; set; }
+        public List<MyMenuItem> children { get; set; }
+    }
+}

+ 477 - 0
BizCom/ComBase.cs

@@ -0,0 +1,477 @@
+using Castle.ActiveRecord;
+using Castle.ActiveRecord.Framework;
+using NHibernate.Criterion;
+using SQLData;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text.RegularExpressions;
+
+namespace BizCom
+{
+    public class ComBase<T> : ActiveRecordBase<T>
+    {
+        #region 自定义
+
+        private static readonly Dictionary<Type, string> _dicTable = new Dictionary<Type, string>();
+
+        private static object dicTable_Flag = 1;
+        /// <summary>
+        /// 表名
+        /// </summary>
+        public string TName
+        {
+            get { return GetTableName(); }
+        }
+
+        public static IDataAccess DbConn
+        {
+            get { return DbHelper.DbConn; }
+        }
+
+        public static DbTrans DbTran
+        {
+            get { return DbHelper.DbTran; }
+        }
+
+        /// <summary>
+        /// 返回ProgID
+        /// </summary>
+        /// <returns>ProgId</returns>
+        public virtual string GetTableName()
+        {
+            Type lType = GetType();
+            if (!_dicTable.ContainsKey(lType))
+            {
+                lock (dicTable_Flag)
+                {
+                    if (!_dicTable.ContainsKey(lType))
+                    {
+                        var attribute = GetAttribute<ActiveRecordAttribute>(lType);
+                        _dicTable.Add(lType, attribute.Table);
+                    }
+                }
+            }
+            return _dicTable[lType];
+        }
+
+
+        private T GetAttribute<T>(Type lType) where T : Attribute
+        {
+            object[] aArr = lType.GetCustomAttributes(false);
+            for (int i = 0; i < aArr.Length; i++)
+            {
+                if (typeof(T) == aArr[i].GetType())
+                    return (T)aArr[i];
+            }
+            return null;
+        }
+
+
+        /// <summary>
+        /// 返回ProgID
+        /// </summary>
+        /// <returns>ProgId</returns>
+        public static string GetViewName()
+        {
+            string gName = GetName();
+            gName = Regex.Replace(gName, "X_", "view_", RegexOptions.IgnoreCase);
+            gName = Regex.Replace(gName, "S_", "view_", RegexOptions.IgnoreCase);
+            return gName;
+        }
+        /// <summary>
+        /// 返回ProgID
+        /// </summary>
+        /// <returns>ProgId</returns>
+        public static string GetName()
+        {
+            Type lType = typeof(T);
+            if (!_dicTable.ContainsKey(lType))
+            {
+                lock (dicTable_Flag)
+                {
+                    if (!_dicTable.ContainsKey(lType))
+                    {
+                        var attribute = GetAttributeByView<ActiveRecordAttribute>(lType);
+                        _dicTable.Add(lType, attribute.Table);
+                    }
+                }
+            }
+            return _dicTable[lType];
+        }
+
+        private static T GetAttributeByView<T>(Type lType) where T : Attribute
+        {
+            object[] aArr = lType.GetCustomAttributes(false);
+            for (int i = 0; i < aArr.Length; i++)
+            {
+                if (typeof(T) == aArr[i].GetType())
+                    return (T)aArr[i];
+            }
+            return null;
+        }
+
+
+        #region 单表查询
+
+        public static DataTable SimpleQuery()
+        {
+            return SimpleQuery(0, "", "", "");
+        }
+
+        public static DataTable SimpleQuery(string where)
+        {
+            return SimpleQuery(0, "", "", where);
+        }
+
+        public static DataTable SimpleQuery(int top, string filter, string orderby, string where)
+        {
+            string topRecord = "";
+            if (top > 0) topRecord = " top " + top;
+            if (filter == "") filter = "*";
+            if (orderby != "") orderby = " order by " + orderby;
+            if (where != "") where = " where " + where;
+            string sql = string.Format("select {4} {0} from {1} {2} {3}", filter, GetName(), where, orderby, topRecord);
+            WirteLog(sql);
+            return DbConn.ExecuteDataset(sql).Tables[0];
+        }
+        #endregion
+
+
+        public static DataSet MultiQuery(string sql)
+        {
+            WirteLog(sql);
+            return DbConn.ExecuteDataset(sql);
+        }
+
+
+        #region 视图查询
+        /// <summary>
+        /// 查询
+        /// </summary>
+        /// <param name="top">取记录数</param>
+        /// <param name="filter">字段</param>
+        /// <param name="orderby">排序</param>
+        /// <param name="where">条件</param>
+        /// <returns></returns>
+        public static DataTable Query(int top, string filter, string orderby, string where)
+        {
+            string topRecord = "";
+            if (top > 0) topRecord = " top " + top;
+            if (filter == "") filter = "*";
+            if (orderby != "") orderby = " order by " + orderby;
+            if (where != "") where = " where " + where;
+            string sql = string.Format("select {4} {0} from {1} {2} {3}", filter, GetViewName(), where, orderby, topRecord);
+            WirteLog(sql);
+            return DbConn.ExecuteDataset(sql).Tables[0];
+        }
+
+        /// <summary>
+        /// 查询
+        /// </summary>
+        /// <param name="top">取记录数</param>
+        /// <param name="where">条件</param>
+        /// <returns></returns>
+        public static DataTable Query(int top, string where)
+        {
+            return Query(top, "", "", where);
+        }
+
+        /// <summary>
+        /// 查询
+        /// </summary>
+        /// <param name="topRecord">取几条</param>
+        /// <returns></returns>
+        public static DataTable Query(int topRecord)
+        {
+            return Query(topRecord, "");
+        }
+
+        /// <summary>
+        /// 查询
+        /// </summary>
+        /// <param name="filter"></param>
+        /// <param name="orderby"></param>
+        /// <param name="where"></param>
+        /// <returns></returns>
+        public static DataTable Query(string filter, string orderby, string where)
+        {
+            return Query(0, filter, orderby, where);
+        }
+        /// <summary>
+        /// 查询
+        /// </summary>
+        /// <param name="orderby"></param>
+        /// <param name="where"></param>
+        /// <returns></returns>
+        public static DataTable Query(string orderby, string where)
+        {
+            return Query(0, "", orderby, where);
+        }
+
+        /// <summary>
+        /// 查询
+        /// </summary>
+        /// <param name="where">条件</param>
+        /// <returns></returns>
+        public static DataTable Query(string where)
+        {
+            return Query(0, where);
+        }
+
+        /// <summary>
+        /// 查询
+        /// </summary>
+        /// <returns></returns>
+        public static DataTable Query()
+        {
+            return Query("");
+        }
+        #endregion
+
+        /// <summary>
+        /// 事务执行
+        /// </summary>
+        /// <param name="sql">多条语句,单条少用</param>
+        public static void TransExecuteNonQuery(string sql)
+        {
+            WirteLog(sql);
+            using (TransactionScope transaction = new TransactionScope())
+            {
+                try
+                {
+                    ExecuteNonQuery(sql);
+                    transaction.VoteCommit();
+                }
+                catch (Exception ex)
+                {
+                    transaction.VoteRollBack();
+                    throw;
+                }
+            }
+        }
+        #endregion
+
+        public static string CreateCode(string field, string table, string tag)
+        {
+            DateTime dt = DateTime.Now;
+            string prev = dt.ToString("yyMM");
+            string sql = string.Format("select isnull(max({1}),'') from {2} where {1} like '{0}%'", tag + prev, field, table);
+            object result = ExecuteScalar(sql);
+            if (result != null && result.ToString() != "")
+            {
+                string tmp = result.ToString();
+                tmp = tmp.Replace(tag + prev, "");
+                int num = Convert.ToInt32(tmp) + 1;
+                return tag + prev + num.ToString().PadLeft(4, '0');
+            }
+            else
+            {
+                return tag + prev + "0001";
+            }
+        }
+
+        public static string CreateNoPrevCode(string field, string table, string tag)
+        {
+            DateTime dt = DateTime.Now;
+            string sql = string.Format("select isnull(max({1}),'') from {2} where {1} like '{0}%'", tag, field, table);
+            object result = ExecuteScalar(sql);
+            if (result != null && result.ToString() != "")
+            {
+                string tmp = result.ToString();
+                tmp = tmp.Replace(tag, "");
+                int num = Convert.ToInt32(tmp) + 1;
+                return tag + num.ToString().PadLeft(5, '0');
+            }
+            else
+            {
+                return tag + "00001";
+            }
+        }
+
+        public static string AutoCode(string field, string table, string tag, int len)
+        {
+            DateTime dt = DateTime.Now;
+            string sql = string.Format("select isnull(max({1}),'') from {2} where {1} like '{0}%'", tag, field, table);
+            object result = ExecuteScalar(sql);
+            if (result != null && result.ToString() != "")
+            {
+                string tmp = result.ToString();
+                tmp = tmp.Replace(tag, "");
+                int num = Convert.ToInt32(tmp) + 1;
+                return tag + num.ToString().PadLeft(len, '0');
+            }
+            else
+            {
+                return tag + "1".PadLeft(len, '0');
+            }
+        }
+
+        public static object genCode = new object();
+        public static string GetGenCode(string tag, string prefix, int len)
+        {
+            SqlParameter[] sqlParameter ={
+                        new SqlParameter("@tag", SqlDbType.VarChar,20),
+                        new SqlParameter("@prefix", SqlDbType.VarChar, 20),
+                        new SqlParameter("@codelen", SqlDbType.Int, 4),
+                        new SqlParameter("@otag", SqlDbType.VarChar, 50)};
+
+            sqlParameter[0].Value = tag;
+            sqlParameter[1].Value = prefix;
+            sqlParameter[2].Value = len;
+            sqlParameter[3].Direction = ParameterDirection.Output;
+            lock (genCode)
+            {
+                ExecuteNonQueryStore("sp_getgencode", sqlParameter);
+                return sqlParameter[3].Value.ToString();
+            }
+        }
+
+        public static object genCode2 = new object();
+        public static string GetGenCode2(string tag, string prefix, int len)
+        {
+            SqlParameter[] sqlParameter ={
+                        new SqlParameter("@tag", SqlDbType.VarChar,20),
+                        new SqlParameter("@prefix", SqlDbType.VarChar, 20),
+                        new SqlParameter("@codelen", SqlDbType.Int, 4),
+                        new SqlParameter("@otag", SqlDbType.VarChar, 50)};
+
+            sqlParameter[0].Value = tag;
+            sqlParameter[1].Value = prefix;
+            sqlParameter[2].Value = len;
+            sqlParameter[3].Direction = ParameterDirection.Output;
+            lock (genCode2)
+            {
+                ExecuteNonQueryStore("sp_getgencode2", sqlParameter);
+                return sqlParameter[3].Value.ToString();
+            }
+        }
+
+        public static string GetHid(string tag, string prefix)
+        {
+            SqlParameter[] sqlParameter ={
+                        new SqlParameter("@compid", SqlDbType.NVarChar,10),
+                        new SqlParameter("@ls_hid", SqlDbType.NVarChar, 10),
+                        new SqlParameter("@indate", SqlDbType.NVarChar, 10),
+                        new SqlParameter("@inupd", SqlDbType.NVarChar, 10),
+                        new SqlParameter("@ls_rhid", SqlDbType.VarChar, 20)};
+
+            sqlParameter[0].Value = "01";
+            sqlParameter[1].Value = tag;
+            sqlParameter[2].Value = prefix;
+            sqlParameter[3].Value = "yes";
+            sqlParameter[4].Direction = ParameterDirection.Output;
+            ExecuteNonQueryStore("gf_GetHid", sqlParameter);
+
+            return sqlParameter[4].Value.ToString();
+        }
+
+
+        public static T Get(object id)
+        {
+            return FindFirst(Expression.Eq("ID", Convert.ToInt32(id)));
+        }
+
+
+
+        public static DataSet ExecuteDataset(string sql)
+        {
+            WirteLog(sql);
+            ISessionFactoryHolder sessionFactoryHolder = ActiveRecordMediator.GetSessionFactoryHolder();
+            using (NHibernate.ISession session = sessionFactoryHolder.CreateSession(typeof(T)))
+            {
+                IDbCommand command = session.Connection.CreateCommand();
+                command.CommandText = sql;
+                if (session.Transaction.IsActive) session.Transaction.Enlist(command);
+                IDbDataAdapter da = new SqlDataAdapter(command as SqlCommand);
+                DataSet ds = new DataSet();
+                da.Fill(ds);
+                return ds;
+            }
+            //return command.ExecuteNonQuery();
+        }
+
+        public static int ExecuteNonQuery(string sql)
+        {
+            WirteLog(sql);
+            ISessionFactoryHolder sessionFactoryHolder = ActiveRecordMediator.GetSessionFactoryHolder();
+            using (NHibernate.ISession session = sessionFactoryHolder.CreateSession(typeof(T)))
+            {
+                IDbCommand command = session.Connection.CreateCommand();
+                command.CommandText = sql;
+                if (session.Transaction.IsActive) session.Transaction.Enlist(command);
+                return command.ExecuteNonQuery();
+            }
+
+        }
+
+        public static DataSet ExecuteDataSetStore(string sql, SqlParameter[] paras)
+        {
+            WirteLog(sql);
+            ISessionFactoryHolder sessionFactoryHolder = ActiveRecordMediator.GetSessionFactoryHolder();
+            using (NHibernate.ISession session = sessionFactoryHolder.CreateSession(typeof(T)))
+            {
+                IDbCommand command = session.Connection.CreateCommand();
+                command.CommandType = CommandType.StoredProcedure;
+                if (paras != null)
+                {
+                    for (int j = 0; j < paras.Length; j++)
+                    {
+                        command.Parameters.Add(paras[j]);
+                    }
+                }
+                command.CommandText = sql;
+                if (session.Transaction.IsActive) session.Transaction.Enlist(command);
+                IDbDataAdapter da = new SqlDataAdapter(command as SqlCommand);
+                DataSet ds = new DataSet();
+                da.Fill(ds);
+                return ds;
+            }
+        }
+
+        public static int ExecuteNonQueryStore(string sql, SqlParameter[] paras)
+        {
+            WirteLog(sql);
+            ISessionFactoryHolder sessionFactoryHolder = ActiveRecordMediator.GetSessionFactoryHolder();
+            using (NHibernate.ISession session = sessionFactoryHolder.CreateSession(typeof(T)))
+            {
+                IDbCommand command = session.Connection.CreateCommand();
+                command.CommandType = CommandType.StoredProcedure;
+                //IDataParameterCollection
+                if (paras != null)
+                {
+                    for (int j = 0; j < paras.Length; j++)
+                    {
+                        command.Parameters.Add(paras[j]);
+                    }
+                }
+                command.CommandText = sql;
+                if (session.Transaction.IsActive) session.Transaction.Enlist(command);
+                return command.ExecuteNonQuery();
+            }
+        }
+
+        public static object ExecuteScalar(string sql)
+        {
+            WirteLog(sql);
+            ISessionFactoryHolder sessionFactoryHolder = ActiveRecordMediator.GetSessionFactoryHolder();
+            //NHibernate.ISession session = sessionFactoryHolder.GetSessionFactory(typeof(CeErpInventory)).GetCurrentSession();
+            //NHibernate.ISession  session=sessionFactoryHolder.GetConfiguration(typeof(ActiveRecordBase)).BuildSessionFactory().OpenSession();
+            using (NHibernate.ISession session = sessionFactoryHolder.CreateSession(typeof(T)))
+            {
+                IDbCommand command = session.Connection.CreateCommand();
+                command.CommandText = sql;
+                if (session.Transaction.IsActive) session.Transaction.Enlist(command);
+                return command.ExecuteScalar();
+            }
+        }
+
+
+        static log4net.ILog logger = log4net.LogManager.GetLogger("ComBase");//获取一个日志记录器
+        private static void WirteLog(string text)
+        {
+            logger.Info(text);
+        }
+    }
+}

+ 18 - 0
BizCom/Dao/CEErpPrintModel.cs

@@ -0,0 +1,18 @@
+using Castle.ActiveRecord;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpPrintModel")]
+    public class CEErpPrintModel : DicSysBase
+    {
+
+        public CEErpPrintModel()
+        {
+            rootName = "打印模块";
+            titleName = "打印模块根结点";
+            tableName = "CE_ErpPrintModel";
+        }
+
+    }
+}
+

+ 74 - 0
BizCom/Dao/CeColumns.cs

@@ -0,0 +1,74 @@
+using System;
+using Castle.ActiveRecord;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_Columns")]
+    public class CeColumns : ComBase<CeColumns>
+    {
+
+        private string _name="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Name
+        {
+             get{ return _name; }
+             set{ _name=value; }
+        }
+
+        private int _userID=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int UserID
+        {
+             get{ return _userID; }
+             set{ _userID=value; }
+        }
+
+        private string _con="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Con
+        {
+             get{ return _con; }
+             set{ _con=value; }
+        }
+
+        private string _cpath="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string cpath
+        {
+             get{ return _cpath; }
+             set{ _cpath=value; }
+        }
+
+        private bool _issys=false;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public bool issys
+        {
+             get{ return _issys; }
+             set{ _issys=value; }
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_Columns where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 502 - 0
BizCom/Dao/CeErpBagOrder.cs

@@ -0,0 +1,502 @@
+using System;
+using Castle.ActiveRecord;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpBagOrder")]
+    public class CeErpBagOrder : ComBase<CeErpBagOrder>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _oid="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string oid
+        {
+             get{ return _oid; }
+             set{ _oid=value; }
+        }
+
+        private string _tid="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string tid
+        {
+             get{ return _tid; }
+             set{ _tid=value; }
+        }
+
+        private double _num=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public double num
+        {
+             get{ return _num; }
+             set{ _num=value; }
+        }
+
+        private string _status="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string status
+        {
+             get{ return _status; }
+             set{ _status=value; }
+        }
+
+        private string _type="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string type
+        {
+             get{ return _type; }
+             set{ _type=value; }
+        }
+
+        private string _price="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string price
+        {
+             get{ return _price; }
+             set{ _price=value; }
+        }
+
+        private double _discount_fee=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public double discount_fee
+        {
+             get{ return _discount_fee; }
+             set{ _discount_fee=value; }
+        }
+
+        private string _total_fee="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string total_fee
+        {
+             get{ return _total_fee; }
+             set{ _total_fee=value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? created { get; set; }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? pay_time { get; set; }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? modified { get; set; }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? end_time { get; set; }
+
+        private string _buyer_nick="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string buyer_nick
+        {
+             get{ return _buyer_nick; }
+             set{ _buyer_nick=value; }
+        }
+
+        private string _step_trade_status="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string step_trade_status
+        {
+             get{ return _step_trade_status; }
+             set{ _step_trade_status=value; }
+        }
+
+        private string _step_paid_fee="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string step_paid_fee
+        {
+             get{ return _step_paid_fee; }
+             set{ _step_paid_fee=value; }
+        }
+
+        private string _shipping_type="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string shipping_type
+        {
+             get{ return _shipping_type; }
+             set{ _shipping_type=value; }
+        }
+
+        private string _adjust_fee="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string adjust_fee
+        {
+             get{ return _adjust_fee; }
+             set{ _adjust_fee=value; }
+        }
+
+        private string _trade_from="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string trade_from
+        {
+             get{ return _trade_from; }
+             set{ _trade_from=value; }
+        }
+
+        private string _seller_flag="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string seller_flag
+        {
+             get{ return _seller_flag; }
+             set{ _seller_flag=value; }
+        }
+
+        private string _seller_nick="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string seller_nick
+        {
+             get{ return _seller_nick; }
+             set{ _seller_nick=value; }
+        }
+
+        private string _payment="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string payment
+        {
+             get{ return _payment; }
+             set{ _payment=value; }
+        }
+
+        private bool _seller_rate=false;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public bool seller_rate
+        {
+             get{ return _seller_rate; }
+             set{ _seller_rate=value; }
+        }
+
+        private string _post_fee="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string post_fee
+        {
+             get{ return _post_fee; }
+             set{ _post_fee=value; }
+        }
+
+        private string _receiver_name="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string receiver_name
+        {
+             get{ return _receiver_name; }
+             set{ _receiver_name=value; }
+        }
+
+        private string _receiver_country="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string receiver_country
+        {
+             get{ return _receiver_country; }
+             set{ _receiver_country=value; }
+        }
+
+        private string _receiver_state="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string receiver_state
+        {
+             get{ return _receiver_state; }
+             set{ _receiver_state=value; }
+        }
+
+        private string _receiver_city="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string receiver_city
+        {
+             get{ return _receiver_city; }
+             set{ _receiver_city=value; }
+        }
+
+        private string _receiver_town="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string receiver_town
+        {
+             get{ return _receiver_town; }
+             set{ _receiver_town=value; }
+        }
+
+        private string _receiver_district="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string receiver_district
+        {
+             get{ return _receiver_district; }
+             set{ _receiver_district=value; }
+        }
+
+        private string _receiver_address="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string receiver_address
+        {
+             get{ return _receiver_address; }
+             set{ _receiver_address=value; }
+        }
+
+        private string _receiver_zip="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string receiver_zip
+        {
+             get{ return _receiver_zip; }
+             set{ _receiver_zip=value; }
+        }
+
+        private string _receiver_mobile="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string receiver_mobile
+        {
+             get{ return _receiver_mobile; }
+             set{ _receiver_mobile=value; }
+        }
+
+        private string _receiver_phone="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string receiver_phone
+        {
+             get{ return _receiver_phone; }
+             set{ _receiver_phone=value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? consign_time { get; set; }
+
+        private string _received_payment="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string received_payment
+        {
+             get{ return _received_payment; }
+             set{ _received_payment=value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? delivery_time { get; set; }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? collect_time { get; set; }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? sign_time { get; set; }
+
+        private string _buyer_message="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string buyer_message
+        {
+             get{ return _buyer_message; }
+             set{ _buyer_message=value; }
+        }
+
+        private string _buyer_memo="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string buyer_memo
+        {
+             get{ return _buyer_memo; }
+             set{ _buyer_memo=value; }
+        }
+
+        private string _seller_memo="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string seller_memo
+        {
+             get{ return _seller_memo; }
+             set{ _seller_memo=value; }
+        }
+
+        private string _posCode="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string posCode
+        {
+             get{ return _posCode; }
+             set{ _posCode=value; }
+        }
+
+        private string _productType="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ProductType
+        {
+             get{ return _productType; }
+             set{ _productType=value; }
+        }
+
+        private string _productSize="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ProductSize
+        {
+             get{ return _productSize; }
+             set{ _productSize=value; }
+        }
+
+        private string _productStandards="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ProductStandards
+        {
+             get{ return _productStandards; }
+             set{ _productStandards=value; }
+        }
+
+        private int _productCount=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int ProductCount
+        {
+             get{ return _productCount; }
+             set{ _productCount=value; }
+        }
+
+        private string _sku_con="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string sku_con
+        {
+             get{ return _sku_con; }
+             set{ _sku_con=value; }
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpBagOrder where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 58 - 0
BizCom/Dao/CeErpBagShopGoods.cs

@@ -0,0 +1,58 @@
+using System;
+using Castle.ActiveRecord;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpBagShopGoods")]
+    public class CeErpBagShopGoods : ComBase<CeErpBagShopGoods>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _bcount="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string bcount
+        {
+             get{ return _bcount; }
+             set{ _bcount=value; }
+        }
+
+        private string _bsize="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string bsize
+        {
+             get{ return _bsize; }
+             set{ _bsize=value; }
+        }
+
+        private string _bname="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string bname
+        {
+             get{ return _bname; }
+             set{ _bname=value; }
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpBagShopGoods where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 364 - 0
BizCom/Dao/CeErpBill.cs

@@ -0,0 +1,364 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpBill")]
+    public class CeErpBill : ComBase<CeErpBill>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _tid = "";
+        /// <summary>
+        ///订单tid
+        /// </summary>
+        [Property]
+        public string tid
+        {
+            get { return _tid; }
+            set { _tid = value; }
+        }
+
+        private string _title = "";
+        /// <summary>
+        ///发票抬头
+        /// </summary>
+        [Property]
+        public string title
+        {
+            get { return _title; }
+            set { _title = value; }
+        }
+
+        private string _tax = "";
+        /// <summary>
+        ///发票税号
+        /// </summary>
+        [Property]
+        public string tax
+        {
+            get { return _tax; }
+            set { _tax = value; }
+        }
+
+        private string _bank = "";
+        /// <summary>
+        ///开户行
+        /// </summary>
+        [Property]
+        public string bank
+        {
+            get { return _bank; }
+            set { _bank = value; }
+        }
+
+        private string _bankac = "";
+        /// <summary>
+        ///账号
+        /// </summary>
+        [Property]
+        public string bankac
+        {
+            get { return _bankac; }
+            set { _bankac = value; }
+        }
+
+        private string _address = "";
+        /// <summary>
+        ///地址
+        /// </summary>
+        [Property]
+        public string address
+        {
+            get { return _address; }
+            set { _address = value; }
+        }
+
+        private string _phone = "";
+        /// <summary>
+        ///电话
+        /// </summary>
+        [Property]
+        public string phone
+        {
+            get { return _phone; }
+            set { _phone = value; }
+        }
+
+        private string _price = "";
+        /// <summary>
+        ///总价
+        /// </summary>
+        [Property]
+        public string price
+        {
+            get { return _price; }
+            set { _price = value; }
+        }
+
+        private int _productId = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int productId
+        {
+            get { return _productId; }
+            set { _productId = value; }
+        }
+
+        private int _num = 0;
+        /// <summary>
+        ///数量
+        /// </summary>
+        [Property]
+        public int num
+        {
+            get { return _num; }
+            set { _num = value; }
+        }
+
+        private string _type = "";
+        /// <summary>
+        ///发票规格类型
+        /// </summary>
+        [Property]
+        public string type
+        {
+            get { return _type; }
+            set { _type = value; }
+        }
+
+        private string _sendType = "";
+        /// <summary>
+        ///寄送类型
+        /// </summary>
+        [Property]
+        public string sendType
+        {
+            get { return _sendType; }
+            set { _sendType = value; }
+        }
+
+        private string _email = "";
+        /// <summary>
+        ///邮箱地址
+        /// </summary>
+        [Property]
+        public string email
+        {
+            get { return _email; }
+            set { _email = value; }
+        }
+
+        private string _shopName = "";
+        /// <summary>
+        ///店铺
+        /// </summary>
+        [Property]
+        public string shopName
+        {
+            get { return _shopName; }
+            set { _shopName = value; }
+        }
+
+        private string _buyer_nick = "";
+        /// <summary>
+        ///买家旺旺
+        /// </summary>
+        [Property]
+        public string buyer_nick
+        {
+            get { return _buyer_nick; }
+            set { _buyer_nick = value; }
+        }
+
+        /// <summary>
+        ///申请时间
+        /// </summary>
+        [Property]
+        public DateTime? createTime { get; set; }
+
+        /// <summary>
+        ///开具时间
+        /// </summary>
+        [Property]
+        public DateTime? executeTime { get; set; }
+
+        private int _state = 0;
+        /// <summary>
+        ///当前状态
+        /// </summary>
+        [Property]
+        public int state
+        {
+            get { return _state; }
+            set { _state = value; }
+        }
+
+        private int _userId = 0;
+        /// <summary>
+        ///申请人
+        /// </summary>
+        [Property]
+        public int userId
+        {
+            get { return _userId; }
+            set { _userId = value; }
+        }
+
+        private string _returnReason = "";
+        /// <summary>
+        ///驳回原因
+        /// </summary>
+        [Property]
+        public string returnReason
+        {
+            get { return _returnReason; }
+            set { _returnReason = value; }
+        }
+
+        /// <summary>
+        ///修改时间
+        /// </summary>
+        [Property]
+        public DateTime? modifyTime { get; set; }
+
+        private int _comId = 0;
+        /// <summary>
+        ///开票公司ID
+        /// </summary>
+        [Property]
+        public int comId
+        {
+            get { return _comId; }
+            set { _comId = value; }
+        }
+
+        private string _fplsh = "";
+        /// <summary>
+        ///发票流水号
+        /// </summary>
+        [Property]
+        public string fplsh
+        {
+            get { return _fplsh; }
+            set { _fplsh = value; }
+        }
+
+        private string _fpdm = "";
+        /// <summary>
+        ///发票代码
+        /// </summary>
+        [Property]
+        public string fpdm
+        {
+            get { return _fpdm; }
+            set { _fpdm = value; }
+        }
+
+        private string _fphm = "";
+        /// <summary>
+        ///发票号码
+        /// </summary>
+        [Property]
+        public string fphm
+        {
+            get { return _fphm; }
+            set { _fphm = value; }
+        }
+
+        private string _failerror = "";
+        /// <summary>
+        ///开票失败错误解释
+        /// </summary>
+        [Property]
+        public string failerror
+        {
+            get { return _failerror; }
+            set { _failerror = value; }
+        }
+
+        private string _img = "";
+        /// <summary>
+        ///纸质发票图片
+        /// </summary>
+        [Property]
+        public string img
+        {
+            get { return _img; }
+            set { _img = value; }
+        }
+
+        private string _applymemo = "";
+        /// <summary>
+        ///客服申请时备注
+        /// </summary>
+        [Property]
+        public string applymemo
+        {
+            get { return _applymemo; }
+            set { _applymemo = value; }
+        }
+
+        private string _executeUser = "";
+        /// <summary>
+        ///开具发票的人
+        /// </summary>
+        [Property]
+        public string executeUser
+        {
+            get { return _executeUser; }
+            set { _executeUser = value; }
+        }
+
+        private string _billOrderId = "";
+        /// <summary>
+        ///发票的订单编号
+        /// </summary>
+        [Property]
+        public string billOrderId
+        {
+            get { return _billOrderId; }
+            set { _billOrderId = value; }
+        }
+
+        private string _unit = "";
+        /// <summary>
+        ///单位
+        /// </summary>
+        [Property]
+        public string unit
+        {
+            get { return _unit; }
+            set { _unit = value; }
+        }
+
+        public static CeErpBill GetByTid(string tid)
+        {
+            return FindFirst(Expression.Eq("tid", tid));
+        }
+
+        public static void DelByTid(object tid)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpBill where tid='" + tid + "'");
+            ExecuteNonQuery(sql.ToString());
+
+        }
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpBill where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 199 - 0
BizCom/Dao/CeErpCustomer.cs

@@ -0,0 +1,199 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpCustomer")]
+    public class CeErpCustomer : ComBase<CeErpCustomer>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _buyer_nick = "";
+        /// <summary>
+        ///买家昵称
+        /// </summary>
+        [Property]
+        public string buyer_nick
+        {
+            get { return _buyer_nick; }
+            set { _buyer_nick = value; }
+        }
+
+        private string _star_flag = "";
+        /// <summary>
+        ///星标
+        /// </summary>
+        [Property]
+        public string star_flag
+        {
+            get { return _star_flag; }
+            set { _star_flag = value; }
+        }
+
+        private int _buy_day = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int buy_day
+        {
+            get { return _buy_day; }
+            set { _buy_day = value; }
+        }
+
+        private string _phone = "";
+        /// <summary>
+        ///电话
+        /// </summary>
+        [Property]
+        public string phone
+        {
+            get { return _phone; }
+            set { _phone = value; }
+        }
+
+        private string _address = "";
+        /// <summary>
+        ///地址
+        /// </summary>
+        [Property]
+        public string address
+        {
+            get { return _address; }
+            set { _address = value; }
+        }
+
+        private double _total_fee = 0;
+        /// <summary>
+        ///总金额
+        /// </summary>
+        [Property]
+        public double total_fee
+        {
+            get { return _total_fee; }
+            set { _total_fee = value; }
+        }
+
+        private int _buy_count = 0;
+        /// <summary>
+        ///购买次数
+        /// </summary>
+        [Property]
+        public int buy_count
+        {
+            get { return _buy_count; }
+            set { _buy_count = value; }
+        }
+
+        /// <summary>
+        ///最后购买时间
+        /// </summary>
+        [Property]
+        public DateTime? lastbuy_time { get; set; }
+
+        private string _seller_nick = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string seller_nick
+        {
+            get { return _seller_nick; }
+            set { _seller_nick = value; }
+        }
+
+        private int _product_count = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int product_count
+        {
+            get { return _product_count; }
+            set { _product_count = value; }
+        }
+
+
+        private string _lastTid = "";
+        /// <summary>
+        ///上次购买订单号
+        /// </summary>
+        [Property]
+        public string lastTid
+        {
+            get { return _lastTid; }
+            set { _lastTid = value; }
+        }
+
+
+
+        private int _isMore = 0;
+        /// <summary>
+        ///是否比上次买更多
+        /// </summary>
+        [Property]
+        public int isMore
+        {
+            get { return _isMore; }
+            set { _isMore = value; }
+        }
+
+
+        private string _lastTid2 = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string lastTid2
+        {
+            get { return _lastTid2; }
+            set { _lastTid2 = value; }
+        }
+        private string _buyer_id = "";
+        /// <summary>
+        ///客户id
+        /// </summary>
+        [Property]
+        public string buyer_id
+        {
+            get { return _buyer_id; }
+            set { _buyer_id = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? lastbuy_time2 { get; set; }
+
+
+
+        public static CeErpCustomer GetByNick(string nick)
+        {
+            return FindFirst(Expression.Eq("buyer_nick", nick));
+        }
+
+        public static CeErpCustomer GetByNickAndShop(string nick, string shopname)
+        {
+            return FindFirst(Expression.Sql(string.Format("(buyer_nick='{0}' and seller_nick='{1}')", nick, shopname)));
+        }
+        public static CeErpCustomer GetByIdAndShop(string id, string shopname)
+        {
+            return FindFirst(Expression.Sql(string.Format("(buyer_id='{0}' and seller_nick='{1}')", id, shopname)));
+        }
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpCustomer where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 98 - 0
BizCom/Dao/CeErpDataSendOrderInfo.cs

@@ -0,0 +1,98 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpDataSendOrderInfo")]
+    public class CeErpDataSendOrderInfo : ComBase<CeErpDataSendOrderInfo>
+    {
+
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _ctid = "";
+        /// <summary>
+        ///订单编号
+        /// </summary>
+        [Property]
+        public string ctid
+        {
+            get { return _ctid; }
+            set { _ctid = value; }
+        }
+
+
+        private bool _isSync = false;
+
+        /// <summary>
+        ///是否同步过
+        /// </summary>
+        [Property]
+        public bool isSync
+        {
+            get { return _isSync; }
+            set { _isSync = value; }
+        }
+
+        private string _errorBack = "";
+        /// <summary>
+        ///失败信息
+        /// </summary>
+        [Property]
+        public string errorBack
+        {
+            get { return _errorBack; }
+            set { _errorBack = value; }
+        }
+        [Property]
+        public DateTime? updateTime { get; set; }
+
+        private string _dataJson = "";
+        /// <summary>
+        ///信息
+        /// </summary>
+        [Property]
+        public string dataJson
+        {
+            get { return _dataJson; }
+            set { _dataJson = value; }
+        }
+
+        public static CeErpDataSendOrderInfo GetByCtid(string ctid)
+        {
+            return FindFirst(Expression.Sql(string.Format("ctid='{0}'", ctid)));
+        }
+
+        public static void createObject(string ctid)
+        {
+            if (ctid == null || ctid.Length == 0)
+            {
+                return;
+            }
+            CeErpDataSendOrderInfo ceErpDataSendOrderInfo = GetByCtid(ctid);
+            if (ceErpDataSendOrderInfo == null)
+            {
+                ceErpDataSendOrderInfo = new CeErpDataSendOrderInfo();
+                ceErpDataSendOrderInfo.ctid = ctid;
+                ceErpDataSendOrderInfo.Create();
+            }
+            else
+            {
+                ceErpDataSendOrderInfo.isSync = false;
+                ceErpDataSendOrderInfo.Update();
+            }
+        }
+
+        public static void updateAsync(string ctid, string json)
+        {
+            ExecuteNonQuery(string.Format("update CE_ErpDataSendOrderInfo set isSync=1,dataJson='{1}',errorBack='',updateTime=GETDATE() where ctid='{0}'", ctid, json));
+        }
+
+        public static void updateError(string ctid, string errmsg, string json)
+        {
+            ExecuteNonQuery(string.Format("update CE_ErpDataSendOrderInfo set errorBack='{1}',dataJson='{2}',updateTime=GETDATE() where ctid='{0}'", ctid, errmsg, json));
+        }
+    }
+}

+ 76 - 0
BizCom/Dao/CeErpDesignInfo.cs

@@ -0,0 +1,76 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+namespace BizCom
+{
+    [ActiveRecord("Ce_ErpDesignInfo")]
+    public class CeErpDesignInfo : ComBase<CeErpDesignInfo>
+    {
+        /// <summary>
+        /// ID
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        /// <summary>
+        /// 0组织1用户
+        /// </summary>
+        [Property]
+        public int type
+        {
+            get { return _type; }
+            set { _type = value; }
+        }
+
+        private int _type;
+        /// <summary>
+        /// 目标id
+        /// </summary>
+        [Property]
+        public int tarId
+        {
+            get { return _tarId; }
+            set { _tarId = value; }
+        }
+
+        private int _tarId;
+        /// <summary>
+        /// 店铺id
+        /// </summary>
+        [Property]
+        public int shopId
+        {
+            get { return _shopId; }
+            set { _shopId = value; }
+        }
+
+        private int _shopId;
+
+        /// <summary>
+        /// 技能id,没有技能id则是店铺排序
+        /// </summary>
+        [Property]
+        public int designId
+        {
+            get { return _designId; }
+            set { _designId = value; }
+        }
+
+        private int _designId;
+        /// <summary>
+        /// 排序
+        /// </summary>
+        [Property]
+        public int orders
+        {
+            get { return _orders; }
+            set { _orders = value; }
+        }
+
+        private int _orders;
+
+        public static CeErpDesignInfo GetByShopDesign(int tarId, int shopId, int designId)
+        {
+            return FindFirst(Expression.Sql(string.Format("(type = 1 and tarId = {0} and shopId={1} and designId={2})", tarId, shopId, designId)));
+        }
+    }
+}

+ 300 - 0
BizCom/Dao/CeErpDesignerBill.cs

@@ -0,0 +1,300 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpDesignerBill")]
+    public class CeErpDesignerBill : ComBase<CeErpDesignerBill>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _tid = "";
+        /// <summary>
+        ///订单编号
+        /// </summary>
+        [Property]
+        public string tid
+        {
+            get { return _tid; }
+            set { _tid = value; }
+        }
+
+        private string _oid = "";
+        /// <summary>
+        ///原订单号
+        /// </summary>
+        [Property]
+        public string oid
+        {
+            get { return _oid; }
+            set { _oid = value; }
+        }
+
+        private int _uid = 0;
+        /// <summary>
+        ///设计师用户Id
+        /// </summary>
+        [Property]
+        public int uid
+        {
+            get { return _uid; }
+            set { _uid = value; }
+        }
+
+        private string _userName = "";
+        /// <summary>
+        ///设计师名称
+        /// </summary>
+        [Property]
+        public string userName
+        {
+            get { return _userName; }
+            set { _userName = value; }
+        }
+
+        private int _designerType = 0;
+        /// <summary>
+        ///设计师类型:1内部设计师 2外协设计师
+        /// </summary>
+        [Property]
+        public int designerType
+        {
+            get { return _designerType; }
+            set { _designerType = value; }
+        }
+
+        private string _designerTypeText = "";
+        /// <summary>
+        ///设计师类型
+        /// </summary>
+        [Property]
+        public string designerTypeText
+        {
+            get { return _designerTypeText; }
+            set { _designerTypeText = value; }
+        }
+
+        private int _designNum = 0;
+        /// <summary>
+        ///设计款数
+        /// </summary>
+        [Property]
+        public int designNum
+        {
+            get { return _designNum; }
+            set { _designNum = value; }
+        }
+
+        private string _designSize = "";
+        /// <summary>
+        ///设计尺寸
+        /// </summary>
+        [Property]
+        public string designSize
+        {
+            get { return _designSize; }
+            set { _designSize = value; }
+        }
+
+        private int _modifyNum = 0;
+        /// <summary>
+        ///改稿款数
+        /// </summary>
+        [Property]
+        public int modifyNum
+        {
+            get { return _modifyNum; }
+            set { _modifyNum = value; }
+        }
+
+        private string _modifySize = "";
+        /// <summary>
+        ///改稿尺寸
+        /// </summary>
+        [Property]
+        public string modifySize
+        {
+            get { return _modifySize; }
+            set { _modifySize = value; }
+        }
+
+        private double _price = 0;
+        /// <summary>
+        ///设计师填写价格
+        /// </summary>
+        [Property]
+        public double price
+        {
+            get { return _price; }
+            set { _price = value; }
+        }
+
+        private double _realPrice = 0;
+        /// <summary>
+        ///实际价格
+        /// </summary>
+        [Property]
+        public double realPrice
+        {
+            get { return _realPrice; }
+            set { _realPrice = value; }
+        }
+
+        /// <summary>
+        ///创建时间
+        /// </summary>
+        [Property]
+        public DateTime? create_time { get; set; }
+
+        private int _create_u_id = 0;
+        /// <summary>
+        ///创建人uid
+        /// </summary>
+        [Property]
+        public int create_u_id
+        {
+            get { return _create_u_id; }
+            set { _create_u_id = value; }
+        }
+
+        private string _create_u_name = "";
+        /// <summary>
+        ///创建人名称
+        /// </summary>
+        [Property]
+        public string create_u_name
+        {
+            get { return _create_u_name; }
+            set { _create_u_name = value; }
+        }
+
+        /// <summary>
+        ///修改时间
+        /// </summary>
+        [Property]
+        public DateTime? update_time { get; set; }
+
+        private int _update_u_id = 0;
+        /// <summary>
+        ///更新人uid
+        /// </summary>
+        [Property]
+        public int update_u_id
+        {
+            get { return _update_u_id; }
+            set { _update_u_id = value; }
+        }
+
+        private string _update_u_name = "";
+        /// <summary>
+        ///更新人名称
+        /// </summary>
+        [Property]
+        public string update_u_name
+        {
+            get { return _update_u_name; }
+            set { _update_u_name = value; }
+        }
+
+        private int _isAudit = 0;
+        /// <summary>
+        ///已审核
+        /// </summary>
+        [Property]
+        public int isAudit
+        {
+            get { return _isAudit; }
+            set { _isAudit = value; }
+        }
+
+        private int _isDel = 0;
+        /// <summary>
+        ///删除标识
+        /// </summary>
+        [Property]
+        public int isDel
+        {
+            get { return _isDel; }
+            set { _isDel = value; }
+        }
+
+        public static void Del(string tid)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("update CE_ErpDesignerBill set isDel=1 where tid='" + tid + "'");
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        public static CeErpDesignerBill GetByTid(string eid)
+        {
+            return FindFirst(Expression.Sql(string.Format("tid='{0}'", eid)));
+        }
+
+        public static void updateDesignerBill(string tid, int pid)//系统自动核算卡片设计费
+        {
+            if (tid.Length <= 0) return;
+            double realPrice = 0, designLength = 0, designWidth = 0;
+            double designWs = 0, designPrice = 0, modifyPrice = 1;
+            CeErpDesignerBill ceErpDesignerBill = GetByTid(tid);
+            if (ceErpDesignerBill == null) return;
+            if (ceErpDesignerBill.realPrice != 0) return;
+            if (ceErpDesignerBill.designSize.IndexOf("x") >= 0)
+            {
+                designLength = Convert.ToDouble(ceErpDesignerBill.designSize.Split('x')[0]);
+                designWidth = Convert.ToDouble(ceErpDesignerBill.designSize.Split('x')[1]);
+                double l1 = Math.Ceiling(designLength / 90);
+                double w1 = Math.Ceiling(designWidth / 54);
+                double l2 = Math.Ceiling(designLength / 54);
+                double w2 = Math.Ceiling(designWidth / 90);
+                designWs = Math.Min(l1 * w1, l2 * w2);
+            }
+
+            CeErpProductPrice entitys = CeErpProductPrice.GetByPType(pid, designWs);
+            if (entitys == null) return;
+            designPrice = entitys.designPrice;
+            realPrice = designPrice * ceErpDesignerBill.designNum + modifyPrice * ceErpDesignerBill.modifyNum;
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("update CE_ErpDesignerBill set realPrice = " + realPrice + " where tid = '" + tid + "'");
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        public static void updateBill(string tid, int pid, string bz)//手提袋自动核算
+        {
+            if (tid.Length <= 0) return;
+            string[] cz = bz.Split('-');
+            string memo = "";
+            for (int i = 0; i < cz.Length; i++)
+            {
+                if (cz[i].IndexOf("mm") > 0)
+                {
+                    if (cz[i + 2].IndexOf("白卡纸") >= 0)
+                    {
+                        memo = "白卡纸";
+                    }
+                    else
+                    {
+                        memo = "牛皮纸";
+                    }
+                }
+            }
+            double realPrice = 0;
+            double designPrice = 0, modifyPrice = 0;
+            CeErpDesignerBill ceErpDesignerBill = GetByTid(tid);
+            if (ceErpDesignerBill == null) return;
+            CeErpProductPrice entitys = CeErpProductPrice.GetByPType(pid, memo);
+            if (entitys == null) return;
+            realPrice = designPrice * ceErpDesignerBill.designNum + modifyPrice * ceErpDesignerBill.modifyNum;
+
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("update CE_ErpDesginerBill set realPrice = " + realPrice + " where tid = '" + tid + "'");
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 86 - 0
BizCom/Dao/CeErpDesignerBillLog.cs

@@ -0,0 +1,86 @@
+using Castle.ActiveRecord;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpDesignerBillLog")]
+    public class CeErpDesignerBillLog : ComBase<CeErpDesignerBillLog>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _tid = "";
+        /// <summary>
+        ///订单编号
+        /// </summary>
+        [Property]
+        public string tid
+        {
+            get { return _tid; }
+            set { _tid = value; }
+        }
+
+        private int _orderState = 0;
+        /// <summary>
+        ///订单状态
+        /// </summary>
+        [Property]
+        public int orderState
+        {
+            get { return _orderState; }
+            set { _orderState = value; }
+        }
+
+        /// <summary>
+        ///操作时间
+        /// </summary>
+        [Property]
+        public DateTime? create_time { get; set; }
+
+        private string _cont = "";
+        /// <summary>
+        ///操作内容
+        /// </summary>
+        [Property]
+        public string cont
+        {
+            get { return _cont; }
+            set { _cont = value; }
+        }
+
+        private int _uId = 0;
+        /// <summary>
+        ///用户id
+        /// </summary>
+        [Property]
+        public int uId
+        {
+            get { return _uId; }
+            set { _uId = value; }
+        }
+
+        private string _userName = "";
+        /// <summary>
+        ///用户名称
+        /// </summary>
+        [Property]
+        public string userName
+        {
+            get { return _userName; }
+            set { _userName = value; }
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpDesignerBillLog where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 119 - 0
BizCom/Dao/CeErpDesignerFinishRate.cs

@@ -0,0 +1,119 @@
+using Castle.ActiveRecord;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpDesignerFinishRate")]
+    public class CeErpDesignerFinishRate : ComBase<CeErpDesignerFinishRate>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private int _did = 0;
+        /// <summary>
+        ///设计师ID
+        /// </summary>
+        [Property]
+        public int did
+        {
+            get { return _did; }
+            set { _did = value; }
+        }
+
+        private string _amount = "";
+        /// <summary>
+        ///当天总金额
+        /// </summary>
+        [Property]
+        public string Amount
+        {
+            get { return _amount; }
+            set { _amount = value; }
+        }
+
+        private int _allOrder = 0;
+        /// <summary>
+        ///当天总数量
+        /// </summary>
+        [Property]
+        public int AllOrder
+        {
+            get { return _allOrder; }
+            set { _allOrder = value; }
+        }
+
+        private int _waitDesign = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int WaitDesign
+        {
+            get { return _waitDesign; }
+            set { _waitDesign = value; }
+        }
+
+        private int _designing = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int Designing
+        {
+            get { return _designing; }
+            set { _designing = value; }
+        }
+
+        private int _designFinish = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int DesignFinish
+        {
+            get { return _designFinish; }
+            set { _designFinish = value; }
+        }
+
+        private string _finalizationRate = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string FinalizationRate
+        {
+            get { return _finalizationRate; }
+            set { _finalizationRate = value; }
+        }
+
+        private string _payPrice = "";
+        /// <summary>
+        ///当天奖励金额
+        /// </summary>
+        [Property]
+        public string PayPrice
+        {
+            get { return _payPrice; }
+            set { _payPrice = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? CTime { get; set; }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpDesignerFinishRate where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 199 - 0
BizCom/Dao/CeErpDesignerFinishRateNew.cs

@@ -0,0 +1,199 @@
+using Castle.ActiveRecord;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("Ce_ErpDesignerFinishRateNew")]
+    public class CeErpDesignerFinishRateNew : ComBase<CeErpDesignerFinishRateNew>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private int _did = 0;
+        /// <summary>
+        ///设计师ID
+        /// </summary>
+        [Property]
+        public int did
+        {
+            get { return _did; }
+            set { _did = value; }
+        }
+
+        private string _amount = "";
+        /// <summary>
+        ///当天总金额
+        /// </summary>
+        [Property]
+        public string Amount
+        {
+            get { return _amount; }
+            set { _amount = value; }
+        }
+
+        private int _allOrder = 0;
+        /// <summary>
+        ///当天总数量
+        /// </summary>
+        [Property]
+        public int AllOrder
+        {
+            get { return _allOrder; }
+            set { _allOrder = value; }
+        }
+
+        private int _orgid = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int orgid
+        {
+            get { return _orgid; }
+            set { _orgid = value; }
+        }
+
+
+        private string _name = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string name
+        {
+            get { return _name; }
+            set { _name = value; }
+        }
+
+
+        private int _FinalizationRate = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int FinalizationRate
+        {
+            get { return _FinalizationRate; }
+            set { _FinalizationRate = value; }
+        }
+
+        private int _FinalizationRate2 = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int FinalizationRate2
+        {
+            get { return _FinalizationRate2; }
+            set { _FinalizationRate2 = value; }
+        }
+
+
+        private int _afterSaleSum = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int afterSaleSum
+        {
+            get { return _afterSaleSum; }
+            set { _afterSaleSum = value; }
+        }
+
+
+        private int _resolutionSum = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int resolutionSum
+        {
+            get { return _resolutionSum; }
+            set { _resolutionSum = value; }
+        }
+
+        private int _splitSum = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int splitSum
+        {
+            get { return _splitSum; }
+            set { _splitSum = value; }
+        }
+
+        private int _csplitum = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int refund
+        {
+            get { return _refund; }
+            set { _refund = value; }
+        }
+
+        private int _refund = 0;
+
+
+        private string _onRefund = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string onRefund
+        {
+            get { return _onRefund; }
+            set { _onRefund = value; }
+        }
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int csplitum
+        {
+            get { return _csplitum; }
+            set { _csplitum = value; }
+        }
+
+        private int _designFinish = 0;
+        /// <summary>
+        ///
+        /// </summary>
+
+        [Property]
+        public DateTime? Createtime { get; set; }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? ctime { get; set; }
+
+
+        private string _onFinalizationRate = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string onFinalizationRate
+        {
+            get { return _onFinalizationRate; }
+            set { _onFinalizationRate = value; }
+        }
+
+        //根据日期删除
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from Ce_ErpDesignerFinishRateNew where ctime = '" + id + "'");
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 207 - 0
BizCom/Dao/CeErpExpressInfo.cs

@@ -0,0 +1,207 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpExpressInfo")]
+    public class CeErpExpressInfo : ComBase<CeErpExpressInfo>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _tid = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string tid
+        {
+            get { return _tid; }
+            set { _tid = value; }
+        }
+
+        private string _out_sid = "";
+        /// <summary>
+        ///运单号
+        /// </summary>
+        [Property]
+        public string out_sid
+        {
+            get { return _out_sid; }
+            set { _out_sid = value; }
+        }
+
+        private string _company_code = "";
+        /// <summary>
+        ///快递公司编码
+        /// </summary>
+        [Property]
+        public string company_code
+        {
+            get { return _company_code; }
+            set { _company_code = value; }
+        }
+
+        private string _company_name = "";
+        /// <summary>
+        ///快递公司名字
+        /// </summary>
+        [Property]
+        public string company_name
+        {
+            get { return _company_name; }
+            set { _company_name = value; }
+        }
+
+        private string _import_file = "";
+        /// <summary>
+        ///导入文件名
+        /// </summary>
+        [Property]
+        public string import_file
+        {
+            get { return _import_file; }
+            set { _import_file = value; }
+        }
+
+        private string _supplierUserName = "";
+        /// <summary>
+        ///供应商
+        /// </summary>
+        [Property]
+        public string supplierUserName
+        {
+            get { return _supplierUserName; }
+            set { _supplierUserName = value; }
+        }
+
+        private string _state = "";
+        /// <summary>
+        ///发货状态描述
+        /// </summary>
+        [Property]
+        public string state
+        {
+            get { return _state; }
+            set { _state = value; }
+        }
+
+        private string _delivery_memo = "";
+        /// <summary>
+        ///发货备注
+        /// </summary>
+        [Property]
+        public string delivery_memo
+        {
+            get { return _delivery_memo; }
+            set { _delivery_memo = value; }
+        }
+
+        /// <summary>
+        ///导入时间
+        /// </summary>
+        [Property]
+        public DateTime? import_time { get; set; }
+
+        private int _importUserId = 0;
+        /// <summary>
+        ///导入人
+        /// </summary>
+        [Property]
+        public int importUserId
+        {
+            get { return _importUserId; }
+            set { _importUserId = value; }
+        }
+
+        private int _print_state = 0;
+        /// <summary>
+        ///打印状态
+        /// </summary>
+        [Property]
+        public int print_state
+        {
+            get { return _print_state; }
+            set { _print_state = value; }
+        }
+
+        private string _province = "";
+        /// <summary>
+        ///省份
+        /// </summary>
+        [Property]
+        public string province
+        {
+            get { return _province; }
+            set { _province = value; }
+        }
+
+        private string _order_memo = "";
+        /// <summary>
+        ///订单备注
+        /// </summary>
+        [Property]
+        public string order_memo
+        {
+            get { return _order_memo; }
+            set { _order_memo = value; }
+        }
+
+        /// <summary>
+        ///打印时间
+        /// </summary>
+        [Property]
+        public DateTime? print_time { get; set; }
+
+        private string _printUser = "";
+        /// <summary>
+        ///打印人
+        /// </summary>
+        [Property]
+        public string printUser
+        {
+            get { return _printUser; }
+            set { _printUser = value; }
+        }
+        private string _deliveryType = "";
+        /// <summary>
+        ///发货类型物流、虚拟
+        /// </summary>
+        [Property]
+        public string deliveryType
+        {
+            get { return _deliveryType; }
+            set { _deliveryType = value; }
+        }
+
+        private int _isMultiDelivery = 0;
+        /// <summary>
+        ///导入后是否批量发货了
+        /// </summary>
+        [Property]
+        public int isMultiDelivery
+        {
+            get { return _isMultiDelivery; }
+            set { _isMultiDelivery = value; }
+        }
+
+
+        public static CeErpExpressInfo GetByCtid(string ctid)
+        {
+            return FindFirst(Expression.Eq("tid", ctid));
+        }
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpExpressInfo where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 145 - 0
BizCom/Dao/CeErpInvoicingInfo.cs

@@ -0,0 +1,145 @@
+using Castle.ActiveRecord;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpInvoicingInfo")]
+    public class CeErpInvoicingInfo : ComBase<CeErpInvoicingInfo>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _comName = "";
+        /// <summary>
+        ///公司全名
+        /// </summary>
+        [Property]
+        public string ComName
+        {
+            get { return _comName; }
+            set { _comName = value; }
+        }
+
+        private string _cName = "";
+        /// <summary>
+        ///公司简称
+        /// </summary>
+        [Property]
+        public string CName
+        {
+            get { return _cName; }
+            set { _cName = value; }
+        }
+
+        private string _tax = "";
+        /// <summary>
+        ///税号
+        /// </summary>
+        [Property]
+        public string Tax
+        {
+            get { return _tax; }
+            set { _tax = value; }
+        }
+
+        private string _address = "";
+        /// <summary>
+        ///注册地址
+        /// </summary>
+        [Property]
+        public string Address
+        {
+            get { return _address; }
+            set { _address = value; }
+        }
+
+        private string _phone = "";
+        /// <summary>
+        ///注册电话
+        /// </summary>
+        [Property]
+        public string Phone
+        {
+            get { return _phone; }
+            set { _phone = value; }
+        }
+
+        private string _bank = "";
+        /// <summary>
+        ///开户行
+        /// </summary>
+        [Property]
+        public string Bank
+        {
+            get { return _bank; }
+            set { _bank = value; }
+        }
+
+        private string _bankAcc = "";
+        /// <summary>
+        ///开户账号
+        /// </summary>
+        [Property]
+        public string BankAcc
+        {
+            get { return _bankAcc; }
+            set { _bankAcc = value; }
+        }
+
+        private string _billKey = "";
+        /// <summary>
+        ///开票身份认证
+        /// </summary>
+        [Property]
+        public string BillKey
+        {
+            get { return _billKey; }
+            set { _billKey = value; }
+        }
+
+        private string _legal = "";
+        /// <summary>
+        ///法人
+        /// </summary>
+        [Property]
+        public string legal
+        {
+            get { return _legal; }
+            set { _legal = value; }
+        }
+
+        private string _taxrate = "";
+        /// <summary>
+        ///税率
+        /// </summary>
+        [Property]
+        public string taxrate
+        {
+            get { return _taxrate; }
+            set { _taxrate = value; }
+        }
+
+        private double _limitPrice = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public double LimitPrice
+        {
+            get { return _limitPrice; }
+            set { _limitPrice = value; }
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpInvoicingInfo where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 75 - 0
BizCom/Dao/CeErpMailInfo.cs

@@ -0,0 +1,75 @@
+using Castle.ActiveRecord;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpMailInfo")]
+    public class CeErpMailInfo : ComBase<CeErpMailInfo>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _name = "";
+        /// <summary>
+        ///우뒵츰俚
+        /// </summary>
+        [Property]
+        public string name
+        {
+            get { return _name; }
+            set { _name = value; }
+        }
+
+        private string _code = "";
+        /// <summary>
+        ///우뒵긍뵀
+        /// </summary>
+        [Property]
+        public string code
+        {
+            get { return _code; }
+            set { _code = value; }
+        }
+
+        private string _cpCode = "";
+        /// <summary>
+        ///듐힛溝固우뒵긍뵀
+        /// </summary>
+        [Property]
+        public string cpCode
+        {
+            get { return _cpCode; }
+            set { _cpCode = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? addTime { get; set; }
+
+
+        private int _isAuth = 0;
+        /// <summary>
+        ///角뤠竿홈
+        /// </summary>
+        [Property]
+        public int isAuth
+        {
+            get { return _isAuth; }
+            set { _isAuth = value; }
+        }
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpMailInfo where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 84 - 0
BizCom/Dao/CeErpMessageAPI.cs

@@ -0,0 +1,84 @@
+using Castle.ActiveRecord;
+using System;
+using System.Text;
+using NHibernate.Criterion;
+
+namespace BizCom
+{
+    [ActiveRecord("Ce_ErpMessageAPI")]
+    public class CeErpMessageAPI : ComBase<CeErpMessageAPI>
+    {
+
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _tid = "";
+        /// <summary>
+        ///交易编号
+        /// </summary>
+        [Property]
+        public string tid
+        {
+            get { return _tid; }
+            set { _tid = value; }
+        }
+
+
+        private string _ctid = "";
+        /// <summary>
+        ///交易编号
+        /// </summary>
+        [Property]
+        public string ctid
+        {
+            get { return _ctid; }
+            set { _ctid = value; }
+        }
+
+       
+        //用户id
+        private int _userId = 0;
+
+        [Property]
+        public int userId
+        {
+            get { return _userId; }
+            set { _userId = value; }
+        }
+
+        //是否成功
+        private Boolean _isVisit = false;
+        [Property]
+        public Boolean isVisit
+        {
+            get { return _isVisit; }
+            set { _isVisit = value; }
+        }
+
+
+        //是否已经推送
+        private Boolean _getToApi = false;
+        [Property]
+        public Boolean getToApi
+        {
+            get { return _getToApi; }
+            set { _getToApi = value; }
+        }
+
+        /// <summary>
+        ///发起时间
+        /// </summary>
+        [Property]
+        public DateTime? creationtime { get; set; }
+
+        //通知内容
+        private string _content = "";
+        [Property]
+
+        public string content
+        {
+            get { return _content; }
+            set { _content = value; }
+        }
+    }
+}

+ 72 - 0
BizCom/Dao/CeErpMessageTip.cs

@@ -0,0 +1,72 @@
+using Castle.ActiveRecord;
+using System;
+using System.Text;
+using NHibernate.Criterion;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpMessageTip")]
+    public class CeErpMessageTip : ComBase<CeErpMessageTip>
+    {
+
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _tid = "";
+        /// <summary>
+        ///交易编号
+        /// </summary>
+        [Property]
+        public string tid
+        {
+            get { return _tid; }
+            set { _tid = value; }
+        }
+
+        private int _type = 0;
+
+        [Property]
+        public int type
+        {
+            get { return _type; }
+            set { _type = value; }
+        }
+
+        //用户id
+        private int _userId = 0;
+
+        [Property]
+        public int userId
+        {
+            get { return _userId; }
+            set { _userId = value; }
+        }
+
+        private int _sectionId = 0;
+
+        [Property]
+        public int sectionId
+        {
+            get { return _sectionId; }
+            set { _sectionId = value; }
+        }
+
+        //是否已读
+        private Boolean _isVisit = false;
+        [Property]
+        public Boolean isVisit
+        {
+            get { return _isVisit; }
+            set { _isVisit = value; }
+        }
+        //通知内容
+        private string _content = "";
+        [Property]
+
+        public string content
+        {
+            get { return _content; }
+            set { _content = value; }
+        }
+    }
+}

+ 40 - 0
BizCom/Dao/CeErpMethod.cs

@@ -0,0 +1,40 @@
+using Castle.ActiveRecord;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpMethod")]
+    public class CeErpMethod : ComBase<CeErpMethod>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int id { get; set; }
+
+        private string _con = "";
+        /// <summary>
+        ///´¦Àí·½°¸
+        /// </summary>
+        [Property]
+        public string con
+        {
+            get { return _con; }
+            set { _con = value; }
+        }
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? addTime { get; set; }
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpMethod where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 138 - 0
BizCom/Dao/CeErpModular.cs

@@ -0,0 +1,138 @@
+using Castle.ActiveRecord;
+using System.Data;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpModular")]
+    public class CeErpModular : DicSysBase
+    {
+
+        public CeErpModular()
+        {
+            rootName = "系统模块";
+            titleName = "系统模块根结点";
+            tableName = "CE_ErpModular";
+        }
+
+        [Property]
+        public new string Url
+        {
+            get { return _url; }
+            set { _url = value; }
+        }
+
+        [Property]
+        public new string Tag
+        {
+            get { return _tag; }
+            set { _tag = value; }
+        }
+
+        /// <summary>
+        ///是否操作
+        /// </summary>
+        [Property]
+        public new bool isOperate
+        {
+            get { return _isOperate; }
+            set { _isOperate = value; }
+        }
+
+        /// <summary>
+        ///图标
+        /// </summary>
+        [Property]
+        public new string Icon
+        {
+            get { return _icon; }
+            set { _icon = value; }
+        }
+
+
+
+
+        public static DataTable GetModular()
+        {
+            return DbConn.ExecuteDataset("select * from CE_ErpModular where isdel=0 order by sort asc").Tables[0];
+        }
+
+        public static DataTable GetOrgModular(string oId)
+        {
+            string sql = "select * from CE_ErpModular where ID in( select ModularID from ce_erppermission where orgid=" + oId + " and postID=0) and isDel=0 order by sort asc";
+            return DbConn.ExecuteDataset(sql).Tables[0];
+        }
+
+        public static DataTable GetModularNoOperate()
+        {
+            string sql = "select * from CE_ErpModular where isdel=0 and isoperate=0 order by path asc, sort asc";
+            return DbConn.ExecuteDataset(sql).Tables[0];
+        }
+
+        //public static void TransModular(object id,object pId,int sort)
+        //{
+        //    StringBuilder sql=new StringBuilder();
+        //    sql.AppendFormat("declare @oldid int;");
+        //    sql.AppendFormat("select @oldid=parentid from ce_erpmodular where id={0} ;",id);
+        //    sql.AppendFormat("update ce_erpmodular set path=REPLACE(Path,@oldid,'{0}') where path like  '%|'+(select Convert(varchar,id) from CE_ErpModular where ID={1})+'%|' or ID={1} ;", pId, id);
+        //    sql.AppendFormat("update ce_erpmodular set parentid={0},sort={1} where id={2} ;", pId,sort,id);
+        //    TransExecuteNonQuery(sql.ToString());
+        //}
+
+
+
+        //获取角色模块
+        public static DataTable GetResourceByRoleID(int roleId)
+        {
+            string sql = "select * from CE_ErpModular where Code in(select ResCode from LC_SysRoleToResource where RoleID={0}) and IsDel=0 order by parentid,ordernum ";
+            return DbConn.ExecuteDataset(string.Format(sql, roleId)).Tables[0];
+        }
+
+
+        public static void BuilderOperate(string mId)
+        {
+            StringBuilder sql = new StringBuilder();
+            DataTable dt = DbConn.ExecuteDataset("select * from ce_erpmodular where id=" + mId).Tables[0];
+            if (dt == null || dt.Rows.Count < 1) return;
+            DataRow dr = dt.Rows[0];
+            string tag = dr["Tag"].ToString();
+            string path = dr["Path"] + mId + "|";
+            sql.AppendFormat("insert into ce_erpmodular(parentid,name,tag,path,sort,isoperate) Values({0},'{1}','{2}','{3}',{4},1) ;",
+                mId, "查看", tag + "_view", path, 0);
+            sql.AppendFormat("insert into ce_erpmodular(parentid,name,tag,path,sort,isoperate) Values({0},'{1}','{2}','{3}',{4},1) ;",
+                mId, "添加", tag + "_add", path, 1);
+            sql.AppendFormat("insert into ce_erpmodular(parentid,name,tag,path,sort,isoperate) Values({0},'{1}','{2}','{3}',{4},1) ;",
+                mId, "修改", tag + "_edit", path, 2);
+            sql.AppendFormat("insert into ce_erpmodular(parentid,name,tag,path,sort,isoperate) Values({0},'{1}','{2}','{3}',{4},1) ;",
+                mId, "删除", tag + "_del", path, 3);
+
+            TransExecuteNonQuery(sql.ToString());
+
+        }
+
+        public static void AddPermission(string mId)
+        {
+            StringBuilder sql = new StringBuilder();
+            DataTable dt = DbConn.ExecuteDataset("select * from ce_erpmodular where id=" + mId).Tables[0];
+            if (dt == null || dt.Rows.Count < 1) return;
+            DataRow dr = dt.Rows[0];
+            string pid = dr["ParentID"].ToString();
+            //string tag = dr["Tag"].ToString();
+            //string path = dr["Path"] + mId + "|";
+            sql = new StringBuilder();
+            sql.AppendFormat("select OrgID,postid from CE_ErpPermission where OrgID>0 and ModularID={0} group by orgid,postid;", pid);
+            dt = DbConn.ExecuteDataset(sql.ToString()).Tables[0];
+            sql = new StringBuilder();
+            foreach (DataRow dr2 in dt.Rows)
+            {
+                sql.AppendFormat("if (select count(0) from CE_ErpPermission where orgid={0} and postid={1} and modularid={2})<1 begin ", dr2["orgid"], dr2["postid"], mId);
+                sql.AppendFormat("insert into CE_ErpPermission(orgid,postid,modularid) values({0},{1},{2}) ; end ", dr2["orgid"], dr2["postid"], mId);
+            }
+            if (sql.Length > 0)
+                DbConn.ExecuteNonQuery(sql.ToString());
+            //TransExecuteNonQuery(sql.ToString());
+        }
+
+
+    }
+}

+ 111 - 0
BizCom/Dao/CeErpNotice.cs

@@ -0,0 +1,111 @@
+using Castle.ActiveRecord;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpNotice")]
+    public class CeErpNotice : ComBase<CeErpNotice>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _title = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Title
+        {
+            get { return _title; }
+            set { _title = value; }
+        }
+
+        private string _con = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Con
+        {
+            get { return _con; }
+            set { _con = value; }
+        }
+
+        private string _receiver = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Receiver
+        {
+            get { return _receiver; }
+            set { _receiver = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? CreatedTime { get; set; }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? NoticeTime { get; set; }
+
+        private int _readedCount = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int ReadedCount
+        {
+            get { return _readedCount; }
+            set { _readedCount = value; }
+        }
+
+        private int _senderId = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int senderId
+        {
+            get { return _senderId; }
+            set { _senderId = value; }
+        }
+        private string _receiverStr = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ReceiverStr
+        {
+            get { return _receiverStr; }
+            set { _receiverStr = value; }
+        }
+
+        private string _noticeType = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string NoticeType
+        {
+            get { return _noticeType; }
+            set { _noticeType = value; }
+        }
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpNotice where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 70 - 0
BizCom/Dao/CeErpNoticeCell.cs

@@ -0,0 +1,70 @@
+using Castle.ActiveRecord;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpNoticeCell")]
+    public class CeErpNoticeCell : ComBase<CeErpNoticeCell>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private int _nid = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int nid
+        {
+            get { return _nid; }
+            set { _nid = value; }
+        }
+
+        private int _isRead = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int IsRead
+        {
+            get { return _isRead; }
+            set { _isRead = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? ReadTime { get; set; }
+
+        private int _uid = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int uid
+        {
+            get { return _uid; }
+            set { _uid = value; }
+        }
+
+        public static void DelByNid(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpNoticeCell where nid=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpNoticeCell where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 33 - 0
BizCom/Dao/CeErpOpt.cs

@@ -0,0 +1,33 @@
+using Castle.ActiveRecord;
+using System.Data;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpOpt")]
+    public class CeErpOpt : DicSysBase
+    {
+
+        public CeErpOpt()
+        {
+            rootName = "参数类型";
+            titleName = "参数类型";
+            tableName = "CE_ErpOpt";
+        }
+
+        /// <summary>
+        ///最大库存
+        /// </summary>
+        [Property]
+        public new string PCode
+        {
+            get { return _pCode; }
+            set { _pCode = value; }
+        }
+
+        public static DataTable GetTable()
+        {
+            DataTable dt = DbConn.ExecuteDataset("select * from CE_ErpOpt ;").Tables[0];
+            return dt;
+        }
+    }
+}

+ 67 - 0
BizCom/Dao/CeErpOrderFormData.cs

@@ -0,0 +1,67 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpOrderFormData")]
+    public class CeErpOrderFormData : ComBase<CeErpOrderFormData>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _tid = "";
+        /// <summary>
+        ///订单tid
+        /// </summary>
+        [Property]
+        public string tid
+        {
+            get { return _tid; }
+            set { _tid = value; }
+        }
+        //內容
+        public string _content = "";
+
+        [Property]
+        public string content
+        {
+            get { return _content; }
+            set { _content = value; }
+        }
+        //用戶id
+        public int _userId = 0;
+
+        [Property]
+        public int userId
+        {
+            get { return _userId; }
+            set { _userId = value; }
+        }
+
+
+        public static CeErpOrderFormData GetByTid(string tid)
+        {
+            return FindFirst(Expression.Eq("tid", tid));
+        }
+
+        public static void DelByTid(object tid)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpOrderFormData where tid='" + tid + "'");
+            ExecuteNonQuery(sql.ToString());
+
+        }
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpOrderFormData where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 43 - 0
BizCom/Dao/CeErpOrganization.cs

@@ -0,0 +1,43 @@
+using Castle.ActiveRecord;
+using System.Data;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpOrganization")]
+    public class CeErpOrganization : DicSysBase
+    {
+
+        public CeErpOrganization()
+        {
+            rootName = "组织机构";
+            titleName = "组织机构根结点";
+            tableName = "CE_ErpOrganization";
+        }
+
+        [Property]
+        public new string pemShop
+        {
+            get { return _pemShop; }
+            set { _pemShop = value; }
+        }
+
+        public static DataTable Get()
+        {
+            string sql = "select * from ce_erporganization order by  parentid,sort asc";
+            return DbConn.ExecuteDataset(sql).Tables[0];
+        }
+
+        public static DataTable Get(int orgId)
+        {
+            string sql = string.Format("select * from ce_erporganization where id={0} or path like '%|{0}|%' order by  parentid,sort asc", orgId);
+            return DbConn.ExecuteDataset(sql).Tables[0];
+        }
+
+        public static DataTable GetSite()
+        {
+            string sql = "select id,name from ce_erporganization where parentid=0 order by sort asc";
+            return DbConn.ExecuteDataset(sql).Tables[0];
+        }
+
+    }
+}

+ 121 - 0
BizCom/Dao/CeErpPermission.cs

@@ -0,0 +1,121 @@
+using Castle.ActiveRecord;
+using System;
+using System.Data;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpPermission ")]
+    public class CeErpPermission : ComBase<CeErpPermission>
+    {
+
+        /// <summary>
+        /// ÄÚ²¿±àºÅ
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private int _orgID = 0;
+        /// <summary>
+        ///×éÖ¯±àºÅ
+        /// </summary>
+        [Property]
+        public int OrgID
+        {
+            get { return _orgID; }
+            set { _orgID = value; }
+        }
+
+        private int _postID = 0;
+        /// <summary>
+        ///ְλ±àºÅ
+        /// </summary>
+        [Property]
+        public int PostID
+        {
+            get { return _postID; }
+            set { _postID = value; }
+        }
+
+        private int _modularID = 0;
+        /// <summary>
+        ///Ä£¿é±àºÅ
+        /// </summary>
+        [Property]
+        public int ModularID
+        {
+            get { return _modularID; }
+            set { _modularID = value; }
+        }
+
+        public static DataTable GetErpPermission(object uid)
+        {
+            string sql = string.Format("select ModularID as ID,Name,code,Tag,Url,Icon,ParentID,IsOperate from view_erppermission where PostID={0} and isDel=0 order by sort asc ", uid);
+            return ExecuteDataset(sql).Tables[0];
+        }
+
+        public static DataTable GetErpAllPermission()
+        {
+            string sql = string.Format("select ID,Name,Tag,Url,Icon,ParentID,IsOperate from ce_erpmodular where isDel=0 order by sort asc ");
+            return ExecuteDataset(sql).Tables[0];
+        }
+
+
+        public static DataTable GetPermission(string pId, string oId)
+        {
+            string sql = "select ModularID as ID from view_erppermission where orgid={0} and postID={1} and isDel=0 ";
+            return DbConn.ExecuteDataset(string.Format(sql, oId, pId)).Tables[0];
+        }
+
+        public static void SaveOrgPermission(string oId, string v)
+        {
+            StringBuilder sqlList = new StringBuilder();
+            sqlList.AppendFormat("delete from Ce_ErpPermission where OrgID={0} and PostID=0 ;", oId);
+
+            if (v.Length > 0)
+            {
+                //Ä£¿éÖµ
+                string[] sArr = v.Split(',');
+                foreach (string arr in sArr)
+                {
+                    sqlList.AppendFormat("insert into Ce_ErpPermission(OrgID,ModularID) Values({0},{1}); ", oId, arr);
+                }
+            }
+            try
+            {
+                DbConn.ExecuteNonQuery(sqlList.ToString());
+            }
+            catch (Exception)
+            {
+                throw;
+            }
+        }
+
+
+        public static void SavePostPermission(string pId, string oId, string v)
+        {
+            StringBuilder sqlList = new StringBuilder();
+            sqlList.AppendFormat("delete from Ce_ErpPermission where OrgID={0} and PostID={1} ;", oId, pId);
+
+            if (v.Length > 0)
+            {
+                //Ä£¿éÖµ
+                string[] sArr = v.Split(',');
+                foreach (string arr in sArr)
+                {
+                    sqlList.AppendFormat("insert into Ce_ErpPermission(OrgID,PostID,ModularID) Values({0},{1},{2}); ", oId, pId, arr);
+                }
+            }
+            try
+            {
+                DbConn.ExecuteNonQuery(sqlList.ToString());
+            }
+            catch (Exception)
+            {
+                throw;
+            }
+        }
+
+
+    }
+}

+ 132 - 0
BizCom/Dao/CeErpPersuade.cs

@@ -0,0 +1,132 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpPersuade")]
+    public class CeErpPersuade : ComBase<CeErpPersuade>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+
+
+        private string _ctid = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ctid
+        {
+            get { return _ctid; }
+            set { _ctid = value; }
+        }
+
+
+        private string _rtype = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string rtype
+        {
+            get { return _rtype; }
+            set { _rtype = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? created { get; set; }
+
+        private string _con = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string con
+        {
+            get { return _con; }
+            set { _con = value; }
+        }
+
+        private int _verifyuserid = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int verifyuserid
+        {
+            get { return _verifyuserid; }
+            set { _verifyuserid = value; }
+        }
+
+        private int _applyuserid = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int applyuserid
+        {
+            get { return _applyuserid; }
+            set { _applyuserid = value; }
+        }
+
+        private int _pstate = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int pstate
+        {
+            get { return _pstate; }
+            set { _pstate = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? verifytime { get; set; }
+
+        private string _backreason = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string backreason
+        {
+            get { return _backreason; }
+            set { _backreason = value; }
+        }
+
+        private string _img = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string img
+        {
+            get { return _img; }
+            set { _img = value; }
+        }
+
+        public static CeErpPersuade GetByCtid(string ctid)
+        {
+            return FindFirst(Expression.Eq("ctid", ctid));
+        }
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpPersuade where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 204 - 0
BizCom/Dao/CeErpPlaceRegister.cs

@@ -0,0 +1,204 @@
+using Castle.ActiveRecord;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpPlaceRegister")]
+    public class CeErpPlaceRegister : ComBase<CeErpPlaceRegister>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        /// <summary>
+        ///下单时间
+        /// </summary>
+        [Property]
+        public DateTime? PlactTime { get; set; }
+
+        /// <summary>
+        ///发货时间
+        /// </summary>
+        [Property]
+        public DateTime? DeliveryTime { get; set; }
+
+        private int _deliveryCount = 0;
+        /// <summary>
+        ///发货数量
+        /// </summary>
+        [Property]
+        public int DeliveryCount
+        {
+            get { return _deliveryCount; }
+            set { _deliveryCount = value; }
+        }
+
+        private int _receiveCount = 0;
+        /// <summary>
+        ///收货数量
+        /// </summary>
+        [Property]
+        public int ReceiveCount
+        {
+            get { return _receiveCount; }
+            set { _receiveCount = value; }
+        }
+
+        private string _outSid = "";
+        /// <summary>
+        ///快递
+        /// </summary>
+        [Property]
+        public string OutSid
+        {
+            get { return _outSid; }
+            set { _outSid = value; }
+        }
+
+        private string _fileName = "";
+        /// <summary>
+        ///文件名
+        /// </summary>
+        [Property]
+        public string FileName
+        {
+            get { return _fileName; }
+            set { _fileName = value; }
+        }
+
+        private string _memo = "";
+        /// <summary>
+        ///备注
+        /// </summary>
+        [Property]
+        public string Memo
+        {
+            get { return _memo; }
+            set { _memo = value; }
+        }
+
+        private string _img = "";
+        /// <summary>
+        ///图片
+        /// </summary>
+        [Property]
+        public string Img
+        {
+            get { return _img; }
+            set { _img = value; }
+        }
+
+        private int _addUserId = 0;
+        /// <summary>
+        ///添加人
+        /// </summary>
+        [Property]
+        public int AddUserId
+        {
+            get { return _addUserId; }
+            set { _addUserId = value; }
+        }
+
+        /// <summary>
+        ///创建时间
+        /// </summary>
+        [Property]
+        public DateTime? CreateTime { get; set; }
+
+        /// <summary>
+        ///预计出货时间
+        /// </summary>
+        [Property]
+        public DateTime? PreOutTime { get; set; }
+
+        private int _supplier = 0;
+        /// <summary>
+        ///供应商ID
+        /// </summary>
+        [Property]
+        public int Supplier
+        {
+            get { return _supplier; }
+            set { _supplier = value; }
+        }
+
+        private string _did = "";
+        /// <summary>
+        ///编号
+        /// </summary>
+        [Property]
+        public string Did
+        {
+            get { return _did; }
+            set { _did = value; }
+        }
+
+
+        private int _outLate = 0;
+        /// <summary>
+        ///出货逾期
+        /// </summary>
+        [Property]
+        public int OutLate
+        {
+            get { return _outLate; }
+            set { _outLate = value; }
+        }
+
+        private int _surplus = 0;
+        /// <summary>
+        ///剩余件数
+        /// </summary>
+        [Property]
+        public int Surplus
+        {
+            get { return _surplus; }
+            set { _surplus = value; }
+        }
+
+        private string _tid = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string tid
+        {
+            get { return _tid; }
+            set { _tid = value; }
+        }
+
+        private string _splitTag = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string splitTag
+        {
+            get { return _splitTag; }
+            set { _splitTag = value; }
+        }
+        private string _curState = "";
+        /// <summary>
+        ///已完成未完成
+        /// </summary>
+        [Property]
+        public string CurState
+        {
+            get { return _curState; }
+            set { _curState = value; }
+        }
+
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpPlaceRegister where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 121 - 0
BizCom/Dao/CeErpPost.cs

@@ -0,0 +1,121 @@
+using Castle.ActiveRecord;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpPost")]
+    public class CeErpPost : ComBase<CeErpPost>
+    {
+
+        /// <summary>
+        /// 内部编号
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _name = "";
+        /// <summary>
+        ///职位名称
+        /// </summary>
+        [Property]
+        public string Name
+        {
+            get { return _name; }
+            set { _name = value; }
+        }
+
+        private int _orgID = 0;
+        /// <summary>
+        ///组织编号
+        /// </summary>
+        [Property]
+        public int OrgID
+        {
+            get { return _orgID; }
+            set { _orgID = value; }
+        }
+
+        private int _sort = 0;
+        /// <summary>
+        ///排序号
+        /// </summary>
+        [Property]
+        public int Sort
+        {
+            get { return _sort; }
+            set { _sort = value; }
+        }
+
+        private int _defaultPageModuleID = 0;
+        /// <summary>
+        ///默认页面模块编号
+        /// </summary>
+        [Property]
+        public int DefaultPageModuleID
+        {
+            get { return _defaultPageModuleID; }
+            set { _defaultPageModuleID = value; }
+        }
+
+        private int _indexPageReport = 0;
+        /// <summary>
+        ///首页报表显示
+        /// </summary>
+        [Property]
+        public int IndexPageReport
+        {
+            get { return _indexPageReport; }
+            set { _indexPageReport = value; }
+        }
+
+        private string _code = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Code
+        {
+            get { return _code; }
+            set { _code = value; }
+        }
+
+        private int _orderAmountLimit = 0;
+        /// <summary>
+        ///订单额度上限
+        /// </summary>
+        [Property]
+        public int OrderAmountLimit
+        {
+            get { return _orderAmountLimit; }
+            set { _orderAmountLimit = value; }
+        }
+
+        private int _orderDesignLimit = 0;
+        /// <summary>
+        ///设计订单数量上限
+        /// </summary>
+        [Property]
+        public int OrderDesignLimit
+        {
+            get { return _orderDesignLimit; }
+            set { _orderDesignLimit = value; }
+        }
+
+        private int _dayOrderLimit = 0;
+        /// <summary>
+        ///日自动派单上限
+        /// </summary>
+        [Property]
+        public int DayOrderLimit
+        {
+            get { return _dayOrderLimit; }
+            set { _dayOrderLimit = value; }
+        }
+
+
+        public static int Del(object id, int oId)
+        {
+            if (oId > 0) return ExecuteNonQuery("delete from ce_erppost where id=" + id + " and OrgID=" + oId);
+            else return ExecuteNonQuery("delete from ce_erppost where id=" + id);
+        }
+    }
+}

+ 75 - 0
BizCom/Dao/CeErpProcessList.cs

@@ -0,0 +1,75 @@
+using Castle.ActiveRecord;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpProcessList")]
+    public class CeErpProcessList : ComBase<CeErpProcessList>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _title = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Title
+        {
+            get { return _title; }
+            set { _title = value; }
+        }
+
+        private string _con = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Con
+        {
+            get { return _con; }
+            set { _con = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? CreatedTime { get; set; }
+
+        private int _createUserId = 0;
+        /// <summary>
+        ///Ìí¼ÓÕßID
+        /// </summary>
+        [Property]
+        public int CreateUserId
+        {
+            get { return _createUserId; }
+            set { _createUserId = value; }
+        }
+
+        private int _orgId = 0;
+        /// <summary>
+        ///²¿ÃÅID
+        /// </summary>
+        [Property]
+        public int OrgId
+        {
+            get { return _orgId; }
+            set { _orgId = value; }
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpProcessList where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 523 - 0
BizCom/Dao/CeErpProduct.cs

@@ -0,0 +1,523 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Data;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpProduct")]
+    public class CeErpProduct : ComBase<CeErpProduct>
+    {
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private int _pCategory = 0;
+        /// <summary>
+        ///类别
+        /// </summary>
+        [Property]
+        public int PCategory
+        {
+            get { return _pCategory; }
+            set { _pCategory = value; }
+        }
+
+        private string _pCategoryText = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string PCategoryText
+        {
+            get { return _pCategoryText; }
+            set { _pCategoryText = value; }
+        }
+
+        private string _pSupTypeId = "";
+        /// <summary>
+        ///一级分类ID
+        /// </summary>
+        [Property]
+        public string PSupTypeId
+        {
+            get { return _pSupTypeId; }
+            set { _pSupTypeId = value; }
+        }
+
+        private string _pSupType = "";
+        /// <summary>
+        ///一级分类
+        /// </summary>
+        [Property]
+        public string PSupType
+        {
+            get { return _pSupType; }
+            set { _pSupType = value; }
+        }
+
+        private string _pTypeId = "";
+        /// <summary>
+        ///类型ID
+        /// </summary>
+        [Property]
+        public string PTypeId
+        {
+            get { return _pTypeId; }
+            set { _pTypeId = value; }
+        }
+
+        private string _pType = "";
+        /// <summary>
+        ///类型名称
+        /// </summary>
+        [Property]
+        public string PType
+        {
+            get { return _pType; }
+            set { _pType = value; }
+        }
+
+        private string _spu = "";
+        /// <summary>
+        ///款式编码
+        /// </summary>
+        [Property]
+        public string Spu
+        {
+            get { return _spu; }
+            set { _spu = value; }
+        }
+
+        private string _pNo = "";
+        /// <summary>
+        ///编号
+        /// </summary>
+        [Property]
+        public string PNo
+        {
+            get { return _pNo; }
+            set { _pNo = value; }
+        }
+
+        private string _pName = "";
+        /// <summary>
+        ///商品名称
+        /// </summary>
+        [Property]
+        public string PName
+        {
+            get { return _pName; }
+            set { _pName = value; }
+        }
+
+        private string _shortName = "";
+        /// <summary>
+        ///短名称
+        /// </summary>
+        [Property]
+        public string ShortName
+        {
+            get { return _shortName; }
+            set { _shortName = value; }
+        }
+
+        private string _pNum = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string PNum
+        {
+            get { return _pNum; }
+            set { _pNum = value; }
+        }
+
+        private string _pMaterial = "";
+        /// <summary>
+        ///材质
+        /// </summary>
+        [Property]
+        public string PMaterial
+        {
+            get { return _pMaterial; }
+            set { _pMaterial = value; }
+        }
+
+        private string _pCraft = "";
+        /// <summary>
+        ///工艺
+        /// </summary>
+        [Property]
+        public string PCraft
+        {
+            get { return _pCraft; }
+            set { _pCraft = value; }
+        }
+
+        private int _isAutoDistribute = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int IsAutoDistribute
+        {
+            get { return _isAutoDistribute; }
+            set { _isAutoDistribute = value; }
+        }
+
+        private int _isNeedDesignPrice = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int IsNeedDesignPrice
+        {
+            get { return _isNeedDesignPrice; }
+            set { _isNeedDesignPrice = value; }
+        }
+
+        private double _chang = 0;
+        /// <summary>
+        ///长
+        /// </summary>
+        [Property]
+        public double Chang
+        {
+            get { return _chang; }
+            set { _chang = value; }
+        }
+
+        private double _kuang = 0;
+        /// <summary>
+        ///宽
+        /// </summary>
+        [Property]
+        public double Kuang
+        {
+            get { return _kuang; }
+            set { _kuang = value; }
+        }
+
+        private double _gao = 0;
+        /// <summary>
+        ///高
+        /// </summary>
+        [Property]
+        public double Gao
+        {
+            get { return _gao; }
+            set { _gao = value; }
+        }
+
+        private string _chiCunUnit = "";
+        /// <summary>
+        ///尺寸单位
+        /// </summary>
+        [Property]
+        public string ChiCunUnit
+        {
+            get { return _chiCunUnit; }
+            set { _chiCunUnit = value; }
+        }
+
+        private double _mianJi = 0;
+        /// <summary>
+        ///面积
+        /// </summary>
+        [Property]
+        public double MianJi
+        {
+            get { return _mianJi; }
+            set { _mianJi = value; }
+        }
+
+        private string _mianJiUnit = "";
+        /// <summary>
+        ///面积单位
+        /// </summary>
+        [Property]
+        public string MianJiUnit
+        {
+            get { return _mianJiUnit; }
+            set { _mianJiUnit = value; }
+        }
+
+        private double _tiJi = 0;
+        /// <summary>
+        ///体积
+        /// </summary>
+        [Property]
+        public double TiJi
+        {
+            get { return _tiJi; }
+            set { _tiJi = value; }
+        }
+
+        private string _tiJiUnit = "";
+        /// <summary>
+        ///体积单位
+        /// </summary>
+        [Property]
+        public string TiJiUnit
+        {
+            get { return _tiJiUnit; }
+            set { _tiJiUnit = value; }
+        }
+
+        private double _weight = 0;
+        /// <summary>
+        ///重量
+        /// </summary>
+        [Property]
+        public double Weight
+        {
+            get { return _weight; }
+            set { _weight = value; }
+        }
+
+        private string _weightUnit = "";
+        /// <summary>
+        ///重量单位
+        /// </summary>
+        [Property]
+        public string WeightUnit
+        {
+            get { return _weightUnit; }
+            set { _weightUnit = value; }
+        }
+
+        private string _color = "";
+        /// <summary>
+        ///颜色
+        /// </summary>
+        [Property]
+        public string Color
+        {
+            get { return _color; }
+            set { _color = value; }
+        }
+
+        private string _spec = "";
+        /// <summary>
+        ///规格
+        /// </summary>
+        [Property]
+        public string Spec
+        {
+            get { return _spec; }
+            set { _spec = value; }
+        }
+
+        private string _stockUnit = "";
+        /// <summary>
+        ///库存数量基准单位
+        /// </summary>
+        [Property]
+        public string StockUnit
+        {
+            get { return _stockUnit; }
+            set { _stockUnit = value; }
+        }
+
+        private string _logoPicPath = "";
+        /// <summary>
+        ///Logo路径
+        /// </summary>
+        [Property]
+        public string LogoPicPath
+        {
+            get { return _logoPicPath; }
+            set { _logoPicPath = value; }
+        }
+
+        private string _picPath = "";
+        /// <summary>
+        ///大图路径
+        /// </summary>
+        [Property]
+        public string PicPath
+        {
+            get { return _picPath; }
+            set { _picPath = value; }
+        }
+
+        private double _jiZunPrice = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public double JiZunPrice
+        {
+            get { return _jiZunPrice; }
+            set { _jiZunPrice = value; }
+        }
+
+        private double _chengBenPrice = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public double ChengBenPrice
+        {
+            get { return _chengBenPrice; }
+            set { _chengBenPrice = value; }
+        }
+
+        private double _diaoPaiPrice = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public double DiaoPaiPrice
+        {
+            get { return _diaoPaiPrice; }
+            set { _diaoPaiPrice = value; }
+        }
+
+        private int _isLock = 0;
+        /// <summary>
+        ///是否删除
+        /// </summary>
+        [Property]
+        public int IsLock
+        {
+            get { return _isLock; }
+            set { _isLock = value; }
+        }
+
+        private int _isDel = 0;
+        /// <summary>
+        ///是否停用
+        /// </summary>
+        [Property]
+        public int IsDel
+        {
+            get { return _isDel; }
+            set { _isDel = value; }
+        }
+
+        private string _remark = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Remark
+        {
+            get { return _remark; }
+            set { _remark = value; }
+        }
+
+        private int _createUid = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int CreateUid
+        {
+            get { return _createUid; }
+            set { _createUid = value; }
+        }
+
+        private string _createUserName = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string CreateUserName
+        {
+            get { return _createUserName; }
+            set { _createUserName = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime CreateTime { get; set; }
+
+        private int _updateUid = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int UpdateUid
+        {
+            get { return _updateUid; }
+            set { _updateUid = value; }
+        }
+
+        private string _updateUserName = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string UpdateUserName
+        {
+            get { return _updateUserName; }
+            set { _updateUserName = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime UpdateTime { get; set; }
+
+
+        private int _isAllDesignerSelect = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int IsAllDesignerSelect
+        {
+            get { return _isAllDesignerSelect; }
+            set { _isAllDesignerSelect = value; }
+        }
+        //表单json
+        private string _formJson = "";
+        [Property]
+        public string FormJson
+        {
+            get { return _formJson; }
+            set { _formJson = value; }
+        }
+
+        private string _uuid = "";
+        /// <summary>
+        /// uuid
+        /// </summary>
+        [Property]
+        public string uuid
+        {
+            get { return _uuid; }
+            set { _uuid = value; }
+        }
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpProduct where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        public static CeErpProduct GetById(int id)
+        {
+            return FindFirst(Expression.Eq("ID", id));
+        }
+
+        public static DataTable Get()
+        {
+            string sql = "select * from CE_ErpProduct order by PTypeId,ID asc";
+            return DbConn.ExecuteDataset(sql).Tables[0];
+        }
+
+        public static CeErpProduct GetByName(string name)
+        {
+            return FindFirst(Expression.Eq("uuid", name));
+        }
+    }
+}

+ 111 - 0
BizCom/Dao/CeErpProductHour.cs

@@ -0,0 +1,111 @@
+using Castle.ActiveRecord;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpProductHour")]
+    public class CeErpProductHour : ComBase<CeErpProductHour>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private int _productID = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int ProductID
+        {
+            get { return _productID; }
+            set { _productID = value; }
+        }
+
+        private int _kfTime = 0;
+        /// <summary>
+        ///客服阶段
+        /// </summary>
+        [Property]
+        public int kfTime
+        {
+            get { return _kfTime; }
+            set { _kfTime = value; }
+        }
+
+        private int _dsjTime = 0;
+        /// <summary>
+        ///待设计阶段 
+        /// </summary>
+        [Property]
+        public int dsjTime
+        {
+            get { return _dsjTime; }
+            set { _dsjTime = value; }
+        }
+
+        private int _sjzTime = 0;
+        /// <summary>
+        ///设计中阶段 
+        /// </summary>
+        [Property]
+        public int sjzTime
+        {
+            get { return _sjzTime; }
+            set { _sjzTime = value; }
+        }
+
+        private int _xdTime = 0;
+        /// <summary>
+        ///下单阶段
+        /// </summary>
+        [Property]
+        public int xdTime
+        {
+            get { return _xdTime; }
+            set { _xdTime = value; }
+        }
+
+        private int _fhTime = 0;
+        /// <summary>
+        ///发货阶段
+        /// </summary>
+        [Property]
+        public int fhTime
+        {
+            get { return _fhTime; }
+            set { _fhTime = value; }
+        }
+
+        private string _material = "";
+        /// <summary>
+        ///材质
+        /// </summary>
+        [Property]
+        public string Material
+        {
+            get { return _material; }
+            set { _material = value; }
+        }
+
+        private string _craft = "";
+        /// <summary>
+        ///工艺
+        /// </summary>
+        [Property]
+        public string Craft
+        {
+            get { return _craft; }
+            set { _craft = value; }
+        }
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpProductHour where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 123 - 0
BizCom/Dao/CeErpProductPrice.cs

@@ -0,0 +1,123 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpProductPrice")]
+    public class CeErpProductPrice : ComBase<CeErpProductPrice>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private int _pClass = 0;
+        /// <summary>
+        ///产品类别: 1设计 2现货 3电子稿
+        /// </summary>
+        [Property]
+        public int pClass
+        {
+            get { return _pClass; }
+            set { _pClass = value; }
+        }
+
+        private string _pClassText = "";
+        /// <summary>
+        ///产品类别
+        /// </summary>
+        [Property]
+        public string pClassText
+        {
+            get { return _pClassText; }
+            set { _pClassText = value; }
+        }
+
+        private int _pType = 0;
+        /// <summary>
+        ///产品类型
+        /// </summary>
+        [Property]
+        public int pType
+        {
+            get { return _pType; }
+            set { _pType = value; }
+        }
+
+        private string _pTypeText = "";
+        /// <summary>
+        ///产品类型
+        /// </summary>
+        [Property]
+        public string pTypeText
+        {
+            get { return _pTypeText; }
+            set { _pTypeText = value; }
+        }
+
+        private double _ws = 0;
+        /// <summary>
+        ///卡片位数
+        /// </summary>
+        [Property]
+        public double ws
+        {
+            get { return _ws; }
+            set { _ws = value; }
+        }
+
+        private string _pMaterial = "";
+        /// <summary>
+        ///材质
+        /// </summary>
+        [Property]
+        public string pMaterial
+        {
+            get { return _pMaterial; }
+            set { _pMaterial = value; }
+        }
+
+        private double _modifyPrice = 0;
+        /// <summary>
+        ///改稿费
+        /// </summary>
+        [Property]
+        public double modifyPrice
+        {
+            get { return _modifyPrice; }
+            set { _modifyPrice = value; }
+        }
+
+        private double _designPrice = 0;
+        /// <summary>
+        ///设计费
+        /// </summary>
+        [Property]
+        public double designPrice
+        {
+            get { return _designPrice; }
+            set { _designPrice = value; }
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpProductPrice where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        internal static CeErpProductPrice GetByPType(int pid, double ws)
+        {
+            return FindFirst(Expression.Sql(string.Format("pType={0} and ws = {1}", pid, ws)));
+        }
+
+        internal static CeErpProductPrice GetByPType(int pid, string bz)
+        {
+            return FindFirst(Expression.Sql(string.Format("pType={0} and pMaterial like '%{1}%'", pid, bz)));
+        }
+    }
+}

+ 53 - 0
BizCom/Dao/CeErpProfession.cs

@@ -0,0 +1,53 @@
+using Castle.ActiveRecord;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpProfession")]
+    public class CeErpProfession : ComBase<CeErpProfession>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private int _pID = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int PID
+        {
+            get { return _pID; }
+            set { _pID = value; }
+        }
+
+        private string _name = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Name
+        {
+            get { return _name; }
+            set { _name = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? AddTime { get; set; }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpProfession where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 186 - 0
BizCom/Dao/CeErpReturnCash.cs

@@ -0,0 +1,186 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpReturnCash")]
+    public class CeErpReturnCash : ComBase<CeErpReturnCash>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _tid = "";
+        /// <summary>
+        ///交易编号
+        /// </summary>
+        [Property]
+        public string tid
+        {
+            get { return _tid; }
+            set { _tid = value; }
+        }
+
+        private string _rtype = "";
+        /// <summary>
+        ///交易类型列表
+        /// </summary>
+        [Property]
+        public string rtype
+        {
+            get { return _rtype; }
+            set { _rtype = value; }
+        }
+
+        private double _price = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public double price
+        {
+            get { return _price; }
+            set { _price = value; }
+        }
+
+        /// <summary>
+        ///交易创建时间
+        /// </summary>
+        [Property]
+        public DateTime? created { get; set; }
+
+        /// <summary>
+        ///审核时间
+        /// </summary>
+        [Property]
+        public DateTime? verifytime { get; set; }
+
+
+        private string _buyer_nick = "";
+        /// <summary>
+        ///买家昵称
+        /// </summary>
+        [Property]
+        public string buyer_nick
+        {
+            get { return _buyer_nick; }
+            set { _buyer_nick = value; }
+        }
+
+        private double _payment = 0;
+        /// <summary>
+        ///实付金额
+        /// </summary>
+        [Property]
+        public double payment
+        {
+            get { return _payment; }
+            set { _payment = value; }
+        }
+
+        private double _returnprice = 0;
+        /// <summary>
+        ///返现金额
+        /// </summary>
+        [Property]
+        public double returnprice
+        {
+            get { return _returnprice; }
+            set { _returnprice = value; }
+        }
+
+        private string _con = "";
+        /// <summary>
+        ///返现说明
+        /// </summary>
+        [Property]
+        public string con
+        {
+            get { return _con; }
+            set { _con = value; }
+        }
+
+        private int _verifyuserid = 0;
+        /// <summary>
+        ///审核人
+        /// </summary>
+        [Property]
+        public int verifyuserid
+        {
+            get { return _verifyuserid; }
+            set { _verifyuserid = value; }
+        }
+
+        private int _applyuserid = 0;
+        /// <summary>
+        ///申请人
+        /// </summary>
+        [Property]
+        public int applyuserid
+        {
+            get { return _applyuserid; }
+            set { _applyuserid = value; }
+        }
+
+        private int _cashstate = 0;
+        /// <summary>
+        ///审核状态0未审核1通过
+        /// </summary>
+        [Property]
+        public int cashstate
+        {
+            get { return _cashstate; }
+            set { _cashstate = value; }
+        }
+
+        private string _seller_nick = "";
+        /// <summary>
+        ///卖家店铺
+        /// </summary>
+        [Property]
+        public string seller_nick
+        {
+            get { return _seller_nick; }
+            set { _seller_nick = value; }
+        }
+
+        private string _backreason = "";
+        /// <summary>
+        ///退回原因
+        /// </summary>
+        [Property]
+        public string backreason
+        {
+            get { return _backreason; }
+            set { _backreason = value; }
+        }
+
+        private string _img = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string img
+        {
+            get { return _img; }
+            set { _img = value; }
+        }
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpReturnCash where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        public static CeErpReturnCash GetByTid(string tid)
+        {
+            return FindFirst(Expression.Eq("tid", tid));
+        }
+    }
+}

+ 104 - 0
BizCom/Dao/CeErpSampleCustomer.cs

@@ -0,0 +1,104 @@
+using Castle.ActiveRecord;
+using System;
+using NHibernate.Criterion;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpSampleCustomer")]
+    public class CeErpSampleCustomer : ComBase<CeErpSampleCustomer>
+    {
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _buyer_nick = "";
+        /// <summary>
+        ///买家昵称
+        /// </summary>
+        [Property]
+        public string buyer_nick
+        {
+            get { return _buyer_nick; }
+            set { _buyer_nick = value; }
+        }
+
+        private string _userId = "";
+        /// <summary>
+        ///买家ID
+        /// </summary>
+        [Property]
+        public string userId
+        {
+            get { return _userId; }
+            set { _userId = value; }
+        }
+
+        private string _phone = "";
+        /// <summary>
+        ///电话
+        /// </summary>
+        [Property]
+        public string phone
+        {
+            get { return _phone; }
+            set { _phone = value; }
+        }
+
+        private string _address = "";
+        /// <summary>
+        ///地址
+        /// </summary>
+        [Property]
+        public string address
+        {
+            get { return _address; }
+            set { _address = value; }
+        }
+
+        /// <summary>
+        ///最后购买时间
+        /// </summary>
+        [Property]
+        public DateTime? lastbuy_time { get; set; }
+
+        private string _seller_nick = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string seller_nick
+        {
+            get { return _seller_nick; }
+            set { _seller_nick = value; }
+        }
+
+        private string _lastTid = "";
+        /// <summary>
+        ///上次购买订单号
+        /// </summary>
+        [Property]
+        public string lastTid
+        {
+            get { return _lastTid; }
+            set { _lastTid = value; }
+        }
+
+        private int _shopId = 0;
+        /// <summary>
+        /// 店铺id
+        /// </summary>
+        [Property]
+        public int shopId
+        {
+            get { return _shopId; }
+            set { _shopId = value; }
+        }
+        public static CeErpSampleCustomer GetByNick(string nick)
+        {
+            return FindFirst(Expression.Eq("buyer_nick", nick));
+        }
+
+    }
+}

+ 214 - 0
BizCom/Dao/CeErpShop.cs

@@ -0,0 +1,214 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpShop")]
+    public class CeErpShop : ComBase<CeErpShop>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private int _userID = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int UserID
+        {
+            get { return _userID; }
+            set { _userID = value; }
+        }
+
+        private string _comName = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ComName
+        {
+            get { return _comName; }
+            set { _comName = value; }
+        }
+
+        private string _leader = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Leader
+        {
+            get { return _leader; }
+            set { _leader = value; }
+        }
+
+        private string _appSecret = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string AppSecret
+        {
+            get { return _appSecret; }
+            set { _appSecret = value; }
+        }
+
+        private string _shopName = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ShopName
+        {
+            get { return _shopName; }
+            set { _shopName = value; }
+        }
+
+        private string _sName = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string SName
+        {
+            get { return _sName; }
+            set { _sName = value; }
+        }
+
+        private string _shopType = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ShopType
+        {
+            get { return _shopType; }
+            set { _shopType = value; }
+        }
+
+        private int _state = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int State
+        {
+            get { return _state; }
+            set { _state = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? AddTime { get; set; }
+
+        private string _summary = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Summary
+        {
+            get { return _summary; }
+            set { _summary = value; }
+        }
+
+        private string _refresh_token = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string refresh_token
+        {
+            get { return _refresh_token; }
+            set { _refresh_token = value; }
+        }
+
+        private string _taobao_user_nick = "";
+        /// <summary>
+        ///店铺旺旺昵称
+        /// </summary>
+        [Property]
+        public string taobao_user_nick
+        {
+            get { return _taobao_user_nick; }
+            set { _taobao_user_nick = value; }
+        }
+
+        private string _taobao_user_id = "";
+        /// <summary>
+        ///用户淘宝ID
+        /// </summary>
+        [Property]
+        public string taobao_user_id
+        {
+            get { return _taobao_user_id; }
+            set { _taobao_user_id = value; }
+        }
+
+        private bool _isTmc = false;
+        /// <summary>
+        ///是否授权同步
+        /// </summary>
+        [Property]
+        public bool isTmc
+        {
+            get { return _isTmc; }
+            set { _isTmc = value; }
+        }
+
+        //appid
+        private String _design_app_id = "";
+        [Property]
+        public String design_app_id
+        {
+            get { return _design_app_id; }
+            set { _design_app_id = value; }
+        }
+
+        private String _design_secret = "";
+        [Property]
+        public String design_secret
+        {
+            get { return _design_secret; }
+            set { _design_secret = value; }
+        }
+
+        private Boolean _orderAudit = false;
+        [Property]
+        public Boolean orderAudit
+        {
+            get { return _orderAudit; }
+            set { _orderAudit = value; }
+        }
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpShop where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        public static CeErpShop GetShopIdByName(string ComName)
+        {
+            return FindFirst(Expression.Eq("ShopName", ComName));
+        }
+
+        public static CeErpShop GetShopIdByCode(string ComCode)
+        {
+            return FindFirst(Expression.Eq("AppSecret", ComCode));
+        }
+
+        public static CeErpShop GetShopById(int ShopId)
+        {
+            return FindFirst(Expression.Eq("id", ShopId));
+        }
+    }
+}

+ 50 - 0
BizCom/Dao/CeErpSpecialRefund.cs

@@ -0,0 +1,50 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+
+namespace BizCom
+{
+    [ActiveRecord("Ce_ErpSpecialRefund")]
+    public class CeErpSpecialRefund : ComBase<CeErpSpecialRefund>
+    {
+
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _refoid = "";
+        /// <summary>
+        ///交易编号
+        /// </summary>
+        [Property]
+        public string refoid
+        {
+            get { return _refoid; }
+            set { _refoid = value; }
+        }
+
+        private string _refxml = "";
+        /// <summary>
+        /// </summary>
+        [Property]
+        public string refxml
+        {
+            get { return _refxml; }
+            set { _refxml = value; }
+        }
+
+        private int _whethernotify = 0;
+
+        [Property]
+        public int whethernotify
+        {
+            get { return _whethernotify; }
+            set { _whethernotify = value; }
+        }
+
+
+        public static CeErpSpecialRefund GetByTid(string tid)
+        {
+            return FindFirst(Expression.Eq("refoid", tid));
+        }
+
+    }
+}

+ 179 - 0
BizCom/Dao/CeErpStayGoods.cs

@@ -0,0 +1,179 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpStayGoods")]
+    public class CeErpStayGoods : ComBase<CeErpStayGoods>
+    {
+
+        /// <summary>
+        /// 推多单号
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int stay_id { get; set; }
+
+        private string _t_id = "";
+        /// <summary>
+        ///订单号
+        /// </summary>
+        [Property]
+        public string t_id
+        {
+            get { return _t_id; }
+            set { _t_id = value; }
+        }
+
+        private string _status = "";
+        /// <summary>
+        ///状态
+        /// </summary>
+        [Property]
+        public string status
+        {
+            get { return _status; }
+            set { _status = value; }
+        }
+
+        private string _stay_type = "";
+        /// <summary>
+        ///推多/推购
+        /// </summary>
+        [Property]
+        public string stay_type
+        {
+            get { return _stay_type; }
+            set { _stay_type = value; }
+        }
+
+        private string _shop_name = "";
+        /// <summary>
+        ///店铺名称
+        /// </summary>
+        [Property]
+        public string shop_name
+        {
+            get { return _shop_name; }
+            set { _shop_name = value; }
+        }
+
+        private string _wangwang = "";
+        /// <summary>
+        ///旺旺号
+        /// </summary>
+        [Property]
+        public string wangwang
+        {
+            get { return _wangwang; }
+            set { _wangwang = value; }
+        }
+
+        /// <summary>
+        ///申请时间
+        /// </summary>
+        [Property]
+        public DateTime? creata_time { get; set; }
+
+        private string _create_u_name = "";
+        /// <summary>
+        ///申请人名称
+        /// </summary>
+        [Property]
+        public string create_u_name
+        {
+            get { return _create_u_name; }
+            set { _create_u_name = value; }
+        }
+
+        private int _audit_type = 0;
+        /// <summary>
+        ///审核状态 1审核中 2通过 3已退回 
+        /// </summary>
+        [Property]
+        public int audit_type
+        {
+            get { return _audit_type; }
+            set { _audit_type = value; }
+        }
+
+        private int _create_u_id = 0;
+        /// <summary>
+        ///申请人用户id
+        /// </summary>
+        [Property]
+        public int create_u_id
+        {
+            get { return _create_u_id; }
+            set { _create_u_id = value; }
+        }
+
+        private int _audit_u_id = 0;
+        /// <summary>
+        ///审核人
+        /// </summary>
+        [Property]
+        public int audit_u_id
+        {
+            get { return _audit_u_id; }
+            set { _audit_u_id = value; }
+        }
+
+        private string _audit_u_name = "";
+        /// <summary>
+        ///审核人名称
+        /// </summary>
+        [Property]
+        public string audit_u_name
+        {
+            get { return _audit_u_name; }
+            set { _audit_u_name = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? audit_time { get; set; }
+
+        private string _audit_text = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string audit_text
+        {
+            get { return _audit_text; }
+            set { _audit_text = value; }
+        }
+
+        private int _product_id = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int product_id
+        {
+            get { return _product_id; }
+            set { _product_id = value; }
+        }
+
+        public static CeErpStayGoods GetByTid(string t_id)
+        {
+            return FindFirst(Expression.Eq("t_id", t_id));
+        }
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpStayGoods where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        public static CeErpStayGoods GetStayId(int eid)
+        {
+            return FindFirst(Expression.Eq("stay_id", eid));
+        }
+    }
+}

+ 64 - 0
BizCom/Dao/CeErpSukuraData.cs

@@ -0,0 +1,64 @@
+using Castle.ActiveRecord;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpSukuraData")]
+    public class CeErpSukuraData : ComBase<CeErpSukuraData>
+    {
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _tid = "";
+        /// <summary>
+        ///订单编号
+        /// </summary>
+        [Property]
+        public string tid
+        {
+            get { return _tid; }
+            set { _tid = value; }
+        }
+
+        private string _json = "";
+        /// <summary>
+        /// 内容
+        /// </summary>
+        [Property]
+        public string json
+        {
+            get { return _json; }
+            set { _json = value; }
+        }
+
+        private int _type = 0;
+        /// <summary>
+        /// 类型0主订单信息1拆单信息2更新设计信息3下单更新4发货更新5打回6查货7加急8售后9返现10推购
+        /// </summary>
+        [Property]
+        public int type
+        {
+            get { return _type; }
+            set { _type = value; }
+        }
+
+        public static void createInfo(string tid, int type)
+        {
+            CeErpSukuraData ceErpSukuraData = new CeErpSukuraData();
+            ceErpSukuraData.tid = tid;
+            ceErpSukuraData.type = type;
+            //ceErpSukuraData.Create();
+
+        }
+        public static void Del(string id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpSukuraData where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 141 - 0
BizCom/Dao/CeErpSupplier.cs

@@ -0,0 +1,141 @@
+using Castle.ActiveRecord;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpSupplier")]
+    public class CeErpSupplier : ComBase<CeErpSupplier>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _comName = "";
+        /// <summary>
+        ///公司名称
+        /// </summary>
+        [Property]
+        public string ComName
+        {
+            get { return _comName; }
+            set { _comName = value; }
+        }
+
+        private string _leader = "";
+        /// <summary>
+        ///负责人
+        /// </summary>
+        [Property]
+        public string Leader
+        {
+            get { return _leader; }
+            set { _leader = value; }
+        }
+
+        private string _sType = "";
+        /// <summary>
+        ///类型
+        /// </summary>
+        [Property]
+        public string SType
+        {
+            get { return _sType; }
+            set { _sType = value; }
+        }
+
+        private string _phone = "";
+        /// <summary>
+        ///电话
+        /// </summary>
+        [Property]
+        public string Phone
+        {
+            get { return _phone; }
+            set { _phone = value; }
+        }
+
+        private string _address = "";
+        /// <summary>
+        ///地址
+        /// </summary>
+        [Property]
+        public string Address
+        {
+            get { return _address; }
+            set { _address = value; }
+        }
+
+        private string _summary = "";
+        /// <summary>
+        ///备注
+        /// </summary>
+        [Property]
+        public string Summary
+        {
+            get { return _summary; }
+            set { _summary = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? AddTime { get; set; }
+
+        private int _bSort = 0;
+        /// <summary>
+        ///排序
+        /// </summary>
+        [Property]
+        public int BSort
+        {
+            get { return _bSort; }
+            set { _bSort = value; }
+        }
+
+        private int _isAfterSale = 0;
+        /// <summary>
+        ///售后的时候是否自己供应商审核
+        /// </summary>
+        [Property]
+        public int IsAfterSale
+        {
+            get { return _isAfterSale; }
+            set { _isAfterSale = value; }
+        }
+
+        private int _isClose = 0;
+        /// <summary>
+        ///是否关闭
+        /// </summary>
+        [Property]
+        public int IsClose
+        {
+            get { return _isClose; }
+            set { _isClose = value; }
+        }
+
+        /// <summary>
+        /// 现货
+        /// </summary>
+        private string _xianhuoMemo;
+
+        [Property]
+        public string XianhuoMemo
+        {
+            get { return _xianhuoMemo; }
+            set { _xianhuoMemo = value; }
+        }
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpSupplier where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 158 - 0
BizCom/Dao/CeErpSupplierProduct.cs

@@ -0,0 +1,158 @@
+using Castle.ActiveRecord;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpSupplierProduct")]
+    public class CeErpSupplierProduct : ComBase<CeErpSupplierProduct>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private int _supplierID = 0;
+        /// <summary>
+        ///供应商
+        /// </summary>
+        [Property]
+        public int SupplierID
+        {
+            get { return _supplierID; }
+            set { _supplierID = value; }
+        }
+
+        private int _productID = 0;
+        /// <summary>
+        ///产品类型
+        /// </summary>
+        [Property]
+        public int ProductID
+        {
+            get { return _productID; }
+            set { _productID = value; }
+        }
+
+        private string _productCrafts = "";
+        /// <summary>
+        ///产品工艺
+        /// </summary>
+        [Property]
+        public string ProductCrafts
+        {
+            get { return _productCrafts; }
+            set { _productCrafts = value; }
+        }
+
+        private int _minNum = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int MinNum
+        {
+            get { return _minNum; }
+            set { _minNum = value; }
+        }
+
+        private int _maxNum = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int MaxNum
+        {
+            get { return _maxNum; }
+            set { _maxNum = value; }
+        }
+
+        private string _area = "";
+        /// <summary>
+        ///地区
+        /// </summary>
+        [Property]
+        public string Area
+        {
+            get { return _area; }
+            set { _area = value; }
+        }
+
+
+        private double _sizeL = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public double SizeL
+        {
+            get { return _sizeL; }
+            set { _sizeL = value; }
+        }
+
+        private double _sizeW = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public double SizeW
+        {
+            get { return _sizeW; }
+            set { _sizeW = value; }
+        }
+
+        private int _bsort = 0;
+        /// <summary>
+        ///排序
+        /// </summary>
+        [Property]
+        public int Bsort
+        {
+            get { return _bsort; }
+            set { _bsort = value; }
+        }
+
+        private string _crafts = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Crafts
+        {
+            get { return _crafts; }
+            set { _crafts = value; }
+        }
+
+
+        private string _productText = "";
+        /// <summary>
+        ///产品名字
+        /// </summary>
+        [Property]
+        public string ProductText
+        {
+            get { return _productText; }
+            set { _productText = value; }
+        }
+
+        private string _productIds = "";
+        /// <summary>
+        ///产品ID
+        /// </summary>
+        [Property]
+        public string ProductIds
+        {
+            get { return _productIds; }
+            set { _productIds = value; }
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpSupplierProduct where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 53 - 0
BizCom/Dao/CeErpTmcLog.cs

@@ -0,0 +1,53 @@
+using Castle.ActiveRecord;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpTmcLog")]
+    public class CeErpTmcLog : ComBase<CeErpTmcLog>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        /// <summary>
+        ///记录时间
+        /// </summary>
+        [Property]
+        public DateTime? tmctime { get; set; }
+
+        private string _tmctype = "";
+        /// <summary>
+        ///推送类型
+        /// </summary>
+        [Property]
+        public string tmctype
+        {
+            get { return _tmctype; }
+            set { _tmctype = value; }
+        }
+
+        private string _tmccon = "";
+        /// <summary>
+        ///推送内容
+        /// </summary>
+        [Property]
+        public string tmccon
+        {
+            get { return _tmccon; }
+            set { _tmccon = value; }
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpTmcLog where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 36 - 0
BizCom/Dao/CeErpToManagement.cs

@@ -0,0 +1,36 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpToManagement")]
+    public class CeErpToManagement : ComBase<CeErpToManagement>
+    {
+
+        [PrimaryKey(PrimaryKeyType.Assigned)]
+        public string tid { get; set; }
+
+        private string _ctid = "";
+        /// <summary>
+        ///交易编号
+        /// </summary>
+        [Property]
+        public string ctid
+        {
+            get { return _ctid; }
+            set { _ctid = value; }
+        }
+
+        private int _type = 0;
+
+        [Property]
+        public int type
+        {
+            get { return _type; }
+            set { _type = value; }
+        }
+
+
+
+    }
+}

+ 497 - 0
BizCom/Dao/CeErpTrade.cs

@@ -0,0 +1,497 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpTrade")]
+    public class CeErpTrade : ComBase<CeErpTrade>, ICloneable
+    {
+
+
+        /// <summary>
+        ///交易编号
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Assigned)]
+        public string tid { get; set; }
+
+        private double _num = 0;
+        /// <summary>
+        ///商品购买数量
+        /// </summary>
+        [Property]
+        public double num
+        {
+            get { return _num; }
+            set { _num = value; }
+        }
+
+        private string _status = "";
+        /// <summary>
+        ///交易状态
+        /// </summary>
+        [Property]
+        public string status
+        {
+            get { return _status; }
+            set { _status = value; }
+        }
+
+        private string _type = "";
+        /// <summary>
+        ///交易类型列表
+        /// </summary>
+        [Property]
+        public string type
+        {
+            get { return _type; }
+            set { _type = value; }
+        }
+
+        private double _price = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public double price
+        {
+            get { return _price; }
+            set { _price = value; }
+        }
+
+        private double _discount_fee = 0;
+        /// <summary>
+        ///优惠金额
+        /// </summary>
+        [Property]
+        public double discount_fee
+        {
+            get { return _discount_fee; }
+            set { _discount_fee = value; }
+        }
+
+        private double _total_fee = 0;
+        /// <summary>
+        ///商品金额
+        /// </summary>
+        [Property]
+        public double total_fee
+        {
+            get { return _total_fee; }
+            set { _total_fee = value; }
+        }
+        [Property]
+        public DateTime? create_time { get; set; }
+        /// <summary>
+        ///交易创建时间
+        /// </summary>
+        [Property]
+        public DateTime? created { get; set; }
+
+        /// <summary>
+        ///付款时间
+        /// </summary>
+        [Property]
+        public DateTime? pay_time { get; set; }
+
+        /// <summary>
+        ///交易修改时间
+        /// </summary>
+        [Property]
+        public DateTime? modified { get; set; }
+
+        /// <summary>
+        ///交易结束时间
+        /// </summary>
+        [Property]
+        public DateTime? end_time { get; set; }
+
+        private string _buyer_nick = "";
+        /// <summary>
+        ///买家昵称
+        /// </summary>
+        [Property]
+        public string buyer_nick
+        {
+            get { return _buyer_nick; }
+            set { _buyer_nick = value; }
+        }
+
+        private string _step_trade_status = "";
+        /// <summary>
+        ///分阶段付款的订单状态
+        /// </summary>
+        [Property]
+        public string step_trade_status
+        {
+            get { return _step_trade_status; }
+            set { _step_trade_status = value; }
+        }
+
+        private double _step_paid_fee = 0;
+        /// <summary>
+        ///分阶段付款的已付金额
+        /// </summary>
+        [Property]
+        public double step_paid_fee
+        {
+            get { return _step_paid_fee; }
+            set { _step_paid_fee = value; }
+        }
+
+        private string _shipping_type = "";
+        /// <summary>
+        ///创建交易时的物流方式
+        /// </summary>
+        [Property]
+        public string shipping_type
+        {
+            get { return _shipping_type; }
+            set { _shipping_type = value; }
+        }
+
+        private double _adjust_fee = 0;
+        /// <summary>
+        ///卖家手工调整金额
+        /// </summary>
+        [Property]
+        public double adjust_fee
+        {
+            get { return _adjust_fee; }
+            set { _adjust_fee = value; }
+        }
+
+        private string _trade_from = "";
+        /// <summary>
+        ///交易内部来源
+        /// </summary>
+        [Property]
+        public string trade_from
+        {
+            get { return _trade_from; }
+            set { _trade_from = value; }
+        }
+
+        private string _seller_flag = "";
+        /// <summary>
+        ///卖家备注旗帜
+        /// </summary>
+        [Property]
+        public string seller_flag
+        {
+            get { return _seller_flag; }
+            set { _seller_flag = value; }
+        }
+
+        private string _seller_nick = "";
+        /// <summary>
+        ///卖家昵称
+        /// </summary>
+        [Property]
+        public string seller_nick
+        {
+            get { return _seller_nick; }
+            set { _seller_nick = value; }
+        }
+
+        private double _payment = 0;
+        /// <summary>
+        ///实付金额
+        /// </summary>
+        [Property]
+        public double payment
+        {
+            get { return _payment; }
+            set { _payment = value; }
+        }
+
+        private bool _seller_rate = false;
+        /// <summary>
+        ///卖家是否已评价
+        /// </summary>
+        [Property]
+        public bool seller_rate
+        {
+            get { return _seller_rate; }
+            set { _seller_rate = value; }
+        }
+
+        private double _post_fee = 0;
+        /// <summary>
+        ///邮费
+        /// </summary>
+        [Property]
+        public double post_fee
+        {
+            get { return _post_fee; }
+            set { _post_fee = value; }
+        }
+
+        private string _receiver_name = "";
+        /// <summary>
+        ///收货人的姓名
+        /// </summary>
+        [Property]
+        public string receiver_name
+        {
+            get { return _receiver_name; }
+            set { _receiver_name = value; }
+        }
+
+        private string _receiver_country = "";
+        /// <summary>
+        ///收货人国籍
+        /// </summary>
+        [Property]
+        public string receiver_country
+        {
+            get { return _receiver_country; }
+            set { _receiver_country = value; }
+        }
+
+        private string _receiver_state = "";
+        /// <summary>
+        ///收货人的所在省份
+        /// </summary>
+        [Property]
+        public string receiver_state
+        {
+            get { return _receiver_state; }
+            set { _receiver_state = value; }
+        }
+
+        private string _receiver_city = "";
+        /// <summary>
+        ///收货人的所在城市
+        /// </summary>
+        [Property]
+        public string receiver_city
+        {
+            get { return _receiver_city; }
+            set { _receiver_city = value; }
+        }
+
+        private string _receiver_town = "";
+        /// <summary>
+        ///收货人街道地址
+        /// </summary>
+        [Property]
+        public string receiver_town
+        {
+            get { return _receiver_town; }
+            set { _receiver_town = value; }
+        }
+
+        private string _receiver_district = "";
+        /// <summary>
+        ///收货人的所在地区
+        /// </summary>
+        [Property]
+        public string receiver_district
+        {
+            get { return _receiver_district; }
+            set { _receiver_district = value; }
+        }
+
+        private string _receiver_address = "";
+        /// <summary>
+        ///收货人的详细地址
+        /// </summary>
+        [Property]
+        public string receiver_address
+        {
+            get { return _receiver_address; }
+            set { _receiver_address = value; }
+        }
+
+        private string _receiver_zip = "";
+        /// <summary>
+        ///收货人的邮编
+        /// </summary>
+        [Property]
+        public string receiver_zip
+        {
+            get { return _receiver_zip; }
+            set { _receiver_zip = value; }
+        }
+
+        private string _receiver_mobile = "";
+        /// <summary>
+        ///收货人的手机号码
+        /// </summary>
+        [Property]
+        public string receiver_mobile
+        {
+            get { return _receiver_mobile; }
+            set { _receiver_mobile = value; }
+        }
+
+        private string _receiver_phone = "";
+        /// <summary>
+        ///收货人的电话号码
+        /// </summary>
+        [Property]
+        public string receiver_phone
+        {
+            get { return _receiver_phone; }
+            set { _receiver_phone = value; }
+        }
+
+        /// <summary>
+        ///卖家发货时间
+        /// </summary>
+        [Property]
+        public DateTime? consign_time { get; set; }
+
+        private double _received_payment = 0;
+        /// <summary>
+        ///卖家实际收到的支付宝打款金额
+        /// </summary>
+        [Property]
+        public double received_payment
+        {
+            get { return _received_payment; }
+            set { _received_payment = value; }
+        }
+
+        /// <summary>
+        ///发货时间
+        /// </summary>
+        [Property]
+        public DateTime? delivery_time { get; set; }
+
+        /// <summary>
+        ///揽收时间
+        /// </summary>
+        [Property]
+        public DateTime? collect_time { get; set; }
+
+        /// <summary>
+        ///签收时间
+        /// </summary>
+        [Property]
+        public DateTime? sign_time { get; set; }
+
+        private string _buyer_message = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string buyer_message
+        {
+            get { return _buyer_message; }
+            set { _buyer_message = value; }
+        }
+
+        private string _buyer_memo = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string buyer_memo
+        {
+            get { return _buyer_memo; }
+            set { _buyer_memo = value; }
+        }
+
+        private string _seller_memo = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string seller_memo
+        {
+            get { return _seller_memo; }
+            set { _seller_memo = value; }
+        }
+
+        private string _posCode = "";
+        /// <summary>
+        ///店铺编码
+        /// </summary>
+        [Property]
+        public string posCode
+        {
+            get { return _posCode; }
+            set { _posCode = value; }
+        }
+
+        private string _buyer_id = "";
+        /// <summary>
+        ///客户id
+        /// </summary>
+        [Property]
+        public string buyer_id
+        {
+            get { return _buyer_id; }
+            set { _buyer_id = value; }
+        }
+        private bool _isNew = false;
+        [Property]
+        public bool IsNew
+        {
+            get { return _isNew; }
+            set { _isNew = value; }
+        }
+
+        private double _unrefundedAmount = 0;
+        /// <summary>
+        /// 未退款金额
+        /// </summary>
+        [Property]
+        public double unrefundedAmount
+        {
+            get { return _unrefundedAmount; }
+            set { _unrefundedAmount = value; }
+        }
+
+        private int _orderFrom = 10;
+        /// <summary>
+        /// 【订单来源】"10":第三方平台"15":私域电商"20":ERP "30":售前系统
+        /// </summary>
+
+        [Property]
+        public int orderFrom
+        {
+            get { return _orderFrom; }
+            set { _orderFrom = value; }
+        }
+
+        private int _orderType = 10;
+        /// <summary>
+        /// 【订单类型】"10":线上单"15":线下单"20":补差单"30":售后单
+        /// </summary>
+        [Property]
+        public int orderType
+        {
+            get { return _orderType; }
+            set { _orderType = value; }
+        }
+        /// <summary>
+        ///确认时间
+        /// </summary>
+        [Property]
+        public DateTime? confirmTime { get; set; }
+        public object Clone()
+        {
+            return this.MemberwiseClone();
+        }
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpTrade where tid='" + id + "'");
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        public static CeErpTrade Get(string tid)
+        {
+            return FindFirst(Expression.Eq("tid", tid));
+        }
+        public static CeErpTrade GetByName(string name)
+        {
+            return FindFirst(Expression.Eq("buyer_nick", name));
+        }
+    }
+}

+ 187 - 0
BizCom/Dao/CeErpTradeAfterSaleExtend.cs

@@ -0,0 +1,187 @@
+using Castle.ActiveRecord;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using NHibernate.Criterion;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BizCom
+{
+    [ActiveRecord("Ce_ErpTradeAfterSaleExtend")]
+    public class CeErpTradeAfterSaleExtend : ComBase<CeErpTradeAfterSaleExtend>
+    {
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _tid = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string tid
+        {
+            get { return _tid; }
+            set { _tid = value; }
+        }
+        //责任人扣款逗号分开
+        private string _RefundFees = "";
+        [Property]
+        public string RefundFees
+        {
+            get { return _RefundFees; }
+            set { _RefundFees = value; }
+        }
+        private string _afterSaleBackImg = "";
+        /// <summary>
+        ///售后处理退回图片
+        /// </summary>
+        [Property]
+        public string AfterSaleBackImg
+        {
+            get { return _afterSaleBackImg; }
+            set { _afterSaleBackImg = value; }
+        }
+
+        private int _isComplain = 0;
+        /// <summary>
+        ///是否投诉单
+        /// </summary>
+        [Property]
+        public int IsComplain
+        {
+            get { return _isComplain; }
+            set { _isComplain = value; }
+        }
+        private int _isBad = 0;
+        /// <summary>
+        ///是否差评
+        /// </summary>
+        [Property]
+        public int IsBad
+        {
+            get { return _isBad; }
+            set { _isBad = value; }
+        }
+        private int _afterSalSend = 0;
+        /// <summary>
+        ///售后单发货
+        /// </summary>
+        [Property]
+        public int AfterSalSend
+        {
+            get { return _afterSalSend; }
+            set { _afterSalSend = value; }
+        }
+        private string _expressNo = "";
+        /// <summary>
+        ///售后单发货
+        /// </summary>
+        [Property]
+        public string ExpressNo
+        {
+            get { return _expressNo; }
+            set { _expressNo = value; }
+        }
+
+        private string _verifyStates = "";
+        /// <summary>
+        ///售后单状态 0主管审核1认可完成2拒绝3个人审核4自动完成5强制完成
+        /// </summary>
+        [Property]
+        public string VerifyStates
+        {
+            get { return _verifyStates; }
+            set { _verifyStates = value; }
+        }
+        private bool _isOriginal = false;
+        [Property]
+        public bool IsOriginal
+        {
+            get { return _isOriginal; }
+            set { _isOriginal = value; }
+        }
+        /// <summary>
+        /// 客戶售后结果
+        /// </summary>
+        private string _textResult;
+        [Property]
+        public string TextResult
+        {
+            get { return _textResult; }
+            set { _textResult = value; }
+        }
+
+        /// <summary>
+        /// 客戶售后差价
+        /// </summary>
+        private double _diffResultPrice;
+        [Property]
+        public double diffResultPrice
+        {
+            get { return _diffResultPrice; }
+            set { _diffResultPrice = value; }
+        }
+        /// <summary>
+        /// 是否修改责任金额
+        /// </summary>
+        private string _diffPhysical;
+        [Property]
+        public string diffPhysical
+        {
+            get { return _diffPhysical; }
+            set { _diffPhysical = value; }
+        }
+        /// <summary>
+        /// 供应商售后理由
+        /// </summary>
+        private string _supplierResponsible = "";
+        [Property]
+
+        public string supplierResponsible
+        {
+            get { return _supplierResponsible; }
+            set { _supplierResponsible = value; }
+
+        }
+
+        private int _changeNum = 0;
+        /// <summary>
+        /// 修改次数
+        /// </summary>
+        [Property]
+
+        public int ChangeNum
+        {
+            get { return _changeNum; }
+            set { _changeNum = value; }
+
+        }
+        /// <summary>
+        /// 不认可时间
+        /// </summary>
+        [Property]
+        public DateTime? DisagreeTime { get; set; }
+
+        public int _disagreeTimeOut = 0;
+        /// <summary>
+        /// 不认可超时次数
+        /// </summary>
+        [Property]
+
+        public int DisagreeTimeOut
+        {
+            get { return _disagreeTimeOut; }
+            set { _disagreeTimeOut = value; }
+
+        }
+
+        public static CeErpTradeAfterSaleExtend getByTid(string tid)
+        {
+            return FindFirst(Expression.Sql(string.Format("tid='{0}'", tid)));
+        }
+    }
+}

+ 90 - 0
BizCom/Dao/CeErpTradeAfterSaleLog.cs

@@ -0,0 +1,90 @@
+using Castle.ActiveRecord;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BizCom
+{
+    [ActiveRecord("Ce_ErpTradeAfterSaleLog")]
+    public class CeErpTradeAfterSaleLog : ComBase<CeErpTradeAfterSaleLog>
+    {
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private int _responsibleId;
+        [Property]
+        public int ResponsibleId
+        {
+            get { return _responsibleId; }
+            set { _responsibleId = value; }
+        }
+
+        private string _tid = "";
+        [Property]
+        public string tid
+        {
+            get { return _tid; }
+            set { _tid = value; }
+        }
+        //内容
+        private string _con = "";
+        [Property]
+        public string Con
+        {
+            get { return _con; }
+            set { _con = value; }
+        }
+        //用户
+        private int _userId = 0;
+        [Property]
+        public int UserId
+        {
+            get { return _userId; }
+            set { _userId = value; }
+        }
+
+        /// <summary>
+        ///创建时间
+        /// </summary>
+        [Property]
+        public DateTime? createdTime { get; set; }
+
+        private int _type = 0;
+        /// <summary>
+        ///类型0正常1不认可
+        /// </summary>
+        [Property]
+        public int Type
+        {
+            get { return _type; }
+            set { _type = value; }
+        }
+
+        private string _afterSaleBackReason = "";
+        /// <summary>
+        ///售后打回的原因
+        /// </summary>
+        [Property]
+        public string AfterSaleBackReason
+        {
+            get { return _afterSaleBackReason; }
+            set { _afterSaleBackReason = value; }
+        }
+
+        private string _afterSaleBackImg = "";
+        /// <summary>
+        ///售后处理退回图片
+        /// </summary>
+        [Property]
+        public string AfterSaleBackImg
+        {
+            get { return _afterSaleBackImg; }
+            set { _afterSaleBackImg = value; }
+        }
+    }
+}

+ 1210 - 0
BizCom/Dao/CeErpTradeCell.cs

@@ -0,0 +1,1210 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpTradeCell")]
+    public class CeErpTradeCell : ComBase<CeErpTradeCell>, ICloneable
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [Property(Insert = false, Update = false, Unique = true)]
+        public int ID { get; set; }
+
+
+        [PrimaryKey(PrimaryKeyType.Assigned)]
+        public string ctid
+        {
+            get; set;
+        }
+        //private string _ctid="";
+        ///// <summary>
+        /////子表tid
+        ///// </summary>
+        //[Property]
+        //public string ctid
+        //{
+        //     get{ return _ctid; }
+        //     set{ _ctid=value; }
+        //}
+
+        public CeErpTrade _trade = null;
+        [BelongsTo("tid", Insert = false, NotFoundBehaviour = NotFoundBehaviour.Ignore, Cascade = CascadeEnum.None, Update = false)]
+        public CeErpTrade Trade
+        {
+            get { return _trade; }
+            set { _trade = value; }
+        }
+
+        private string _tid = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string tid
+        {
+            get { return _tid; }
+            set { _tid = value; }
+        }
+
+
+        private string _seller_memo = "";
+        /// <summary>
+        ///子表拆分后自己的备注
+        /// </summary>
+        [Property]
+        public string seller_memo
+        {
+            get { return _seller_memo; }
+            set { _seller_memo = value; }
+        }
+
+        private int _designUserId = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int DesignUserId
+        {
+            get { return _designUserId; }
+            set { _designUserId = value; }
+        }
+
+        private int _orderState = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int OrderState
+        {
+            get { return _orderState; }
+            set { _orderState = value; }
+        }
+
+        private int _customerUserId = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int CustomerUserId
+        {
+            get { return _customerUserId; }
+            set { _customerUserId = value; }
+        }
+
+        private bool _isUrgency = false;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public bool IsUrgency
+        {
+            get { return _isUrgency; }
+            set { _isUrgency = value; }
+        }
+
+        private int _isRefund = 0;
+        /// <summary>
+        ///是否退款1申请中2已退款 if (st == "REFUNDING")
+        //{
+        //    state = 1;
+        //}
+        //else if (st == "REFUNDED")
+        //{
+        //    state = 2;
+        //}
+        //else if (st == "PART_REFUNDED")
+        //{
+        //    state = 3;
+        //}
+        //else if (st == "WAIT_BUYER_RETURN_GOODS")
+        //{
+        //    state = 4;
+        //}
+        //else if (st == "REJECT_REFUNDED")
+        //{
+        //    state = 5;
+        //}
+        /// </summary>
+        [Property]
+        public int IsRefund
+        {
+            get { return _isRefund; }
+            set { _isRefund = value; }
+        }
+
+        private int _isReturn = 0;
+        /// <summary>
+        ///打回类型1供应商打回2下单打回
+        /// </summary>
+        [Property]
+        public int IsReturn
+        {
+            get { return _isReturn; }
+            set { _isReturn = value; }
+        }
+
+        private int _isNeedBill = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int IsNeedBill
+        {
+            get { return _isNeedBill; }
+            set { _isNeedBill = value; }
+        }
+
+        private int _supplierId = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int SupplierId
+        {
+            get { return _supplierId; }
+            set { _supplierId = value; }
+        }
+
+        private string _deliveryAddress = "";
+        /// <summary>
+        /// 
+        /// </summary>
+        [Property]
+        public string DeliveryAddress
+        {
+            get { return _deliveryAddress; }
+            set { _deliveryAddress = value; }
+        }
+
+        private int _callTimes = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int CallTimes
+        {
+            get { return _callTimes; }
+            set { _callTimes = value; }
+        }
+
+        private int _noteTimes = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int NoteTimes
+        {
+            get { return _noteTimes; }
+            set { _noteTimes = value; }
+        }
+
+        private double _overtimeUserId = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public double OvertimeUserId
+        {
+            get { return _overtimeUserId; }
+            set { _overtimeUserId = value; }
+        }
+
+        private int _unusualTag = 0;
+        /// <summary>
+        ///超时异常阶段标记0正常 1客服阶段 2待设计 3设计中超市 4下单超时 5发货超时
+        /// </summary>
+        [Property]
+        public int UnusualTag
+        {
+            get { return _unusualTag; }
+            set { _unusualTag = value; }
+        }
+
+        private string _unusualCon = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string UnusualCon
+        {
+            get { return _unusualCon; }
+            set { _unusualCon = value; }
+        }
+
+        private string _returnReason = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ReturnReason
+        {
+            get { return _returnReason; }
+            set { _returnReason = value; }
+        }
+
+        private int _memoOpt = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int MemoOpt
+        {
+            get { return _memoOpt; }
+            set { _memoOpt = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? AfterSaleTime { get; set; }
+
+        private int _afterSaleUserId = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int AfterSaleUserId
+        {
+            get { return _afterSaleUserId; }
+            set { _afterSaleUserId = value; }
+        }
+
+        private string _afterSaleReason = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string AfterSaleReason
+        {
+            get { return _afterSaleReason; }
+            set { _afterSaleReason = value; }
+        }
+
+        private int _placeUserId = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int PlaceUserId
+        {
+            get { return _placeUserId; }
+            set { _placeUserId = value; }
+        }
+        //1待售后2售后主管审核3主管审核4完成售后5责任主管打回售后
+        private int _afterSaleState = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int AfterSaleState
+        {
+            get { return _afterSaleState; }
+            set { _afterSaleState = value; }
+        }
+
+        private string _afterSaleMethod = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string AfterSaleMethod
+        {
+            get { return _afterSaleMethod; }
+            set { _afterSaleMethod = value; }
+        }
+
+        private string _afterSaleMemo = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string AfterSaleMemo
+        {
+            get { return _afterSaleMemo; }
+            set { _afterSaleMemo = value; }
+        }
+
+        private string _afterSaleResponsible = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string AfterSaleResponsible
+        {
+            get { return _afterSaleResponsible; }
+            set { _afterSaleResponsible = value; }
+        }
+
+        private double _deductFee = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public double DeductFee
+        {
+            get { return _deductFee; }
+            set { _deductFee = value; }
+        }
+
+        private double _refundFee = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public double RefundFee
+        {
+            get { return _refundFee; }
+            set { _refundFee = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? HandleTime { get; set; }
+
+        private int _isHaveNewOrder = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int IsHaveNewOrder
+        {
+            get { return _isHaveNewOrder; }
+            set { _isHaveNewOrder = value; }
+        }
+
+        private string _responsibleUserId = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ResponsibleUserId
+        {
+            get { return _responsibleUserId; }
+            set { _responsibleUserId = value; }
+        }
+
+        private string _ptid = "";
+        /// <summary>
+        ///补差价单关联的父订单号
+        /// </summary>
+        [Property]
+        public string ptid
+        {
+            get { return _ptid; }
+            set { _ptid = value; }
+        }
+
+        private int _isPreDelivery = 0;
+        /// <summary>
+        ///是否预发货
+        /// </summary>
+        [Property]
+        public int IsPreDelivery
+        {
+            get { return _isPreDelivery; }
+            set { _isPreDelivery = value; }
+        }
+
+        private int _isSample = 0;
+        /// <summary>
+        ///是否为拿样订单
+        /// </summary>
+        [Property]
+        public int IsSample
+        {
+            get { return _isSample; }
+            set { _isSample = value; }
+        }
+
+        private int _productId = 0;
+        /// <summary>
+        ///产品对应id
+        /// </summary>
+        [Property]
+        public int ProductId
+        {
+            get { return _productId; }
+            set { _productId = value; }
+        }
+
+        /// <summary>
+        ///到待设计的时间
+        /// </summary>
+        [Property]
+        public DateTime? WaitDesignTime { get; set; }
+
+        /// <summary>
+        ///开始设计的时间
+        /// </summary>
+        [Property]
+        public DateTime? StartDesignTime { get; set; }
+
+        /// <summary>
+        ///完成设计的时间
+        /// </summary>
+        [Property]
+        public DateTime? FinishDesignTime { get; set; }
+
+        /// <summary>
+        ///下单完成时间
+        /// </summary>
+        [Property]
+        public DateTime? FinishPlaceTime { get; set; }
+
+        /// <summary>
+        ///发货完成时间
+        /// </summary>
+        [Property]
+        public DateTime? FinishDeliveryTime { get; set; }
+
+        private string _designSelfMemo = "";
+        /// <summary>
+        ///设计师自己的备注
+        /// </summary>
+        [Property]
+        public string DesignSelfMemo
+        {
+            get { return _designSelfMemo; }
+            set { _designSelfMemo = value; }
+        }
+
+        private double _designPrice = 0;
+        /// <summary>
+        ///设计师预估设计费用
+        /// </summary>
+        [Property]
+        public double DesignPrice
+        {
+            get { return _designPrice; }
+            set { _designPrice = value; }
+        }
+
+
+        private string _material = "";
+        /// <summary>
+        ///产品材质
+        /// </summary>
+        [Property]
+        public string Material
+        {
+            get { return _material; }
+            set { _material = value; }
+        }
+
+        private string _craft = "";
+        /// <summary>
+        ///产品工艺
+        /// </summary>
+        [Property]
+        public string Craft
+        {
+            get { return _craft; }
+            set { _craft = value; }
+        }
+
+        private string _productSize = "";
+        /// <summary>
+        ///产品尺寸
+        /// </summary>
+        [Property]
+        public string ProductSize
+        {
+            get { return _productSize; }
+            set { _productSize = value; }
+        }
+
+        private string _productCount = "";
+        /// <summary>
+        ///产品数量
+        /// </summary>
+        [Property]
+        public string ProductCount
+        {
+            get { return _productCount; }
+            set { _productCount = value; }
+        }
+
+
+        /// <summary>
+        ///超时时间
+        /// </summary>
+        [Property]
+        public DateTime? UnusualTime { get; set; }
+
+        private bool _IsAutoDispatch = false;
+        /// <summary>
+        ///是否自动派单
+        /// </summary>
+        [Property]
+        public bool IsAutoDispatch
+        {
+            get { return _IsAutoDispatch; }
+            set { _IsAutoDispatch = value; }
+        }
+
+        private bool _isVerifyToSupplier = false;
+        /// <summary>
+        ///设计完是否审核给供应商
+        /// </summary>
+        [Property]
+        public bool IsVerifyToSupplier
+        {
+            get { return _isVerifyToSupplier; }
+            set { _isVerifyToSupplier = value; }
+        }
+
+        private string _customerMemo = "";
+        /// <summary>
+        ///客服自己备注
+        /// </summary>
+        [Property]
+        public string CustomerMemo
+        {
+            get { return _customerMemo; }
+            set { _customerMemo = value; }
+        }
+
+        private double _payment = 0;
+        /// <summary>
+        ///实付款
+        /// </summary>
+        [Property]
+        public double payment
+        {
+            get { return _payment; }
+            set { _payment = value; }
+        }
+
+        private string _outSid = "";
+        /// <summary>
+        ///快递单号
+        /// </summary>
+        [Property]
+        public string OutSid
+        {
+            get { return _outSid; }
+            set { _outSid = value; }
+        }
+
+        /// <summary>
+        ///完成售后时间
+        /// </summary>
+        [Property]
+        public DateTime? FinishAfterSaleTime { get; set; }
+
+        /// <summary>
+        ///售后预完成时间点
+        /// </summary>
+        [Property]
+        public DateTime? AfterSalePreTime { get; set; }
+
+        private double _afterSalePayment = 0;
+        /// <summary>
+        ///售后处理的实付金额
+        /// </summary>
+        [Property]
+        public double AfterSalePayment
+        {
+            get { return _afterSalePayment; }
+            set { _afterSalePayment = value; }
+        }
+        private int _shopId = 0;
+        /// <summary>
+        ///店铺的id
+        /// </summary>
+        [Property]
+        public int ShopId
+        {
+            get { return _shopId; }
+            set { _shopId = value; }
+        }
+
+        private string _splitTag = "";
+        /// <summary>
+        ///拆分标识C1
+        /// </summary>
+        [Property]
+        public string SplitTag
+        {
+            get { return _splitTag; }
+            set { _splitTag = value; }
+        }
+
+        private int _isAfterSaleOrder = 0;
+        /// <summary>
+        ///是否是加S的售后单
+        /// </summary>
+        [Property]
+        public int isAfterSaleOrder
+        {
+            get { return _isAfterSaleOrder; }
+            set { _isAfterSaleOrder = value; }
+        }
+
+        private int _isDianziOrder = 0;
+        /// <summary>
+        ///是否是电子稿
+        /// </summary>
+        [Property]
+        public int isDianziOrder
+        {
+            get { return _isDianziOrder; }
+            set { _isDianziOrder = value; }
+        }
+
+        private string _lastBillCpCode = "";
+        /// <summary>
+        ///上次打单的cpcode
+        /// </summary>
+        [Property]
+        public string LastBillCpCode
+        {
+            get { return _lastBillCpCode; }
+            set { _lastBillCpCode = value; }
+        }
+
+        private string _lastBillWaybillCode = "";
+        /// <summary>
+        ///上次打单发货失败后存的面单号
+        /// </summary>
+        [Property]
+        public string LastBillWaybillCode
+        {
+            get { return _lastBillWaybillCode; }
+            set { _lastBillWaybillCode = value; }
+        }
+
+        /// <summary>
+        ///付款时间
+        /// </summary>
+        [Property]
+        public DateTime? pay_time { get; set; }
+
+        private int _isSF = 0;
+        /// <summary>
+        ///是否标记顺丰单
+        /// </summary>
+        [Property]
+        public int IsSF
+        {
+            get { return _isSF; }
+            set { _isSF = value; }
+        }
+
+        private int _isXianHuo = 0;
+        /// <summary>
+        ///是否现货
+        /// </summary>
+        [Property]
+        public int IsXianHuo
+        {
+            get { return _isXianHuo; }
+            set { _isXianHuo = value; }
+        }
+
+        /// <summary>
+        ///订单打回时间
+        /// </summary>
+        [Property]
+        public DateTime? ReturnTime { get; set; }
+
+
+        private string _otherMemo = "";
+        /// <summary>
+        ///除了7要素的额外备注
+        /// </summary>
+        [Property]
+        public string OtherMemo
+        {
+            get { return _otherMemo; }
+            set { _otherMemo = value; }
+        }
+
+        private string _afterSaleBackReason = "";
+        /// <summary>
+        ///售后打回的原因
+        /// </summary>
+        [Property]
+        public string AfterSaleBackReason
+        {
+            get { return _afterSaleBackReason; }
+            set { _afterSaleBackReason = value; }
+        }
+
+        private string _checkMemo = "";
+        /// <summary>
+        ///售后查货备注
+        /// </summary>
+        [Property]
+        public string CheckMemo
+        {
+            get { return _checkMemo; }
+            set { _checkMemo = value; }
+        }
+        private int _isOldCustomer = 0;
+        /// <summary>
+        ///是否老客户购买
+        /// </summary>
+        [Property]
+        public int IsOldCustomer
+        {
+            get { return _isOldCustomer; }
+            set { _isOldCustomer = value; }
+        }
+
+
+        private int _isSupplierRefund = 0;
+        /// <summary>
+        ///售后责任供应商 财务标记是否退款
+        /// </summary>
+        [Property]
+        public int IsSupplierRefund
+        {
+            get { return _isSupplierRefund; }
+            set { _isSupplierRefund = value; }
+        }
+
+        private int _isReadTag = 0;
+        /// <summary>
+        ///打回退款等客服是否读取处理
+        /// </summary>
+        [Property]
+        public int IsReadTag
+        {
+            get { return _isReadTag; }
+            set { _isReadTag = value; }
+        }
+
+        private string _afterSaleMemoType = "";
+        /// <summary>
+        ///售后备注类型
+        /// </summary>
+        [Property]
+        public string AfterSaleMemoType
+        {
+            get { return _afterSaleMemoType; }
+            set { _afterSaleMemoType = value; }
+        }
+
+        /// <summary>
+        ///加急时间
+        /// </summary>
+        [Property]
+        public DateTime? UrgencyTime { get; set; }
+
+        private int _isOffLineOrder = 0;
+        /// <summary>
+        ///是否新增的线下单
+        /// </summary>
+        [Property]
+        public int IsOffLineOrder
+        {
+            get { return _isOffLineOrder; }
+            set { _isOffLineOrder = value; }
+        }
+
+
+        private string _payProofImg = "";
+        /// <summary>
+        ///线下单付款凭证图片
+        /// </summary>
+        [Property]
+        public string PayProofImg
+        {
+            get { return _payProofImg; }
+            set { _payProofImg = value; }
+        }
+
+        private int _wechatTag = 0;
+        /// <summary>
+        ///1微信单2推购单
+        /// </summary>
+        [Property]
+        public int wechatTag
+        {
+            get { return _wechatTag; }
+            set { _wechatTag = value; }
+        }
+
+        private string _makeSupplier = "";
+        /// <summary>
+        ///制作产品的车间
+        /// </summary>
+        [Property]
+        public string MakeSupplier
+        {
+            get { return _makeSupplier; }
+            set { _makeSupplier = value; }
+        }
+
+        private string _afterSaleSupplierImg = "";
+        /// <summary>
+        ///售后处理供应商责任的图片
+        /// </summary>
+        [Property]
+        public string AfterSaleSupplierImg
+        {
+            get { return _afterSaleSupplierImg; }
+            set { _afterSaleSupplierImg = value; }
+        }
+
+        private int _afterSaleResSupId = 0;
+        /// <summary>
+        ///售后责任人是供应商的ID
+        /// </summary>
+        [Property]
+        public int AfterSaleResSupId
+        {
+            get { return _afterSaleResSupId; }
+            set { _afterSaleResSupId = value; }
+        }
+
+        private int _afterSaleSupplierState = 0;
+        /// <summary>
+        ///供应商认不认可的状态
+        /// </summary>
+        [Property]
+        public int AfterSaleSupplierState
+        {
+            get { return _afterSaleSupplierState; }
+            set { _afterSaleSupplierState = value; }
+        }
+
+        private string _afterSaleSupplierMemo = "";
+        /// <summary>
+        ///供应商说明情况的
+        /// </summary>
+        [Property]
+        public string AfterSaleSupplierMemo
+        {
+            get { return _afterSaleSupplierMemo; }
+            set { _afterSaleSupplierMemo = value; }
+        }
+
+        private int _isOldCustomerMore = 0;
+        /// <summary>
+        ///老客户比上次买更多的
+        /// </summary>
+        [Property]
+        public int IsOldCustomerMore
+        {
+            get { return _isOldCustomerMore; }
+            set { _isOldCustomerMore = value; }
+        }
+
+        private int _isGift = 0;
+        /// <summary>
+        ///是否为礼物现货
+        /// </summary>
+        [Property]
+        public int IsGift
+        {
+            get { return _isGift; }
+            set { _isGift = value; }
+        }
+
+        /// <summary>
+        ///客服标注老客户上次时间
+        /// </summary>
+        [Property]
+        public DateTime? OldCustomerTime { get; set; }
+
+        private int _isSendGift = 0;
+        /// <summary>
+        ///送小礼物标记
+        /// </summary>
+        [Property]
+        public int IsSendGift
+        {
+            get { return _isSendGift; }
+            set { _isSendGift = value; }
+        }
+
+        private int _parentProfessionId = 0;
+        /// <summary>
+        ///父行业ID
+        /// </summary>
+        [Property]
+        public int ParentProfessionId
+        {
+            get { return _parentProfessionId; }
+            set { _parentProfessionId = value; }
+        }
+
+        private int _professionId = 0;
+        /// <summary>
+        ///子行业ID
+        /// </summary>
+        [Property]
+        public int ProfessionId
+        {
+            get { return _professionId; }
+            set { _professionId = value; }
+        }
+
+        private int _isAddWechat = 0;
+        /// <summary>
+        ///是否有添加客户微信
+        /// </summary>
+        [Property]
+        public int IsAddWechat
+        {
+            get { return _isAddWechat; }
+            set { _isAddWechat = value; }
+        }
+
+        private string _supRefundType = "";
+        /// <summary>
+        ///供应商退款类型
+        /// </summary>
+        [Property]
+        public string supRefundType
+        {
+            get { return _supRefundType; }
+            set { _supRefundType = value; }
+        }
+
+        private int _isArbitrate = 0;
+        /// <summary>
+        ///是否申请过仲裁
+        /// </summary>
+        [Property]
+        public int IsArbitrate
+        {
+            get { return _isArbitrate; }
+            set { _isArbitrate = value; }
+        }
+
+
+        private string _fileMd5 = "";
+        /// <summary>
+        ///上传文件的Md5
+        /// </summary>
+        [Property]
+        public string FileMd5
+        {
+            get { return _fileMd5; }
+            set { _fileMd5 = value; }
+        }
+
+        /// <summary>
+        ///查货时间
+        /// </summary>
+        [Property]
+        public DateTime? CheckOrderTime { get; set; }
+
+        private int _returnUserType = 0;
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int ReturnUserType
+        {
+            get { return _returnUserType; }
+            set { _returnUserType = value; }
+        }
+        private int _dispatchSort = 0;
+
+        /// <summary>
+        /// 0无 1排序 2是否指派共创成功
+        /// </summary>
+        [Property]
+        public int DispatchSort
+        {
+            get { return _dispatchSort; }
+            set { _dispatchSort = value; }
+        }
+
+        private string _orderSn = "";
+        /// <summary>
+        ///唯一识别号
+        /// </summary>
+        [Property]
+        public string OrderSn
+        {
+            get { return _orderSn; }
+            set { _orderSn = value; }
+        }
+
+        private string _ParentSplitNo = "";
+        /// <summary>
+        /// 父拆单号
+        /// </summary>
+        [Property]
+        public string ParentSplitNo
+        {
+            get { return _ParentSplitNo; }
+            set { _ParentSplitNo = value; }
+        }
+
+
+        public static CeErpTradeCell GetByTid(string tid)
+        {
+            return FindFirst(Expression.Sql(string.Format("this_.tid='{0}'", tid)));
+        }
+
+        public static CeErpTradeCell GetByCtid(string ctid)
+        {
+            return FindFirst(Expression.Sql(string.Format("ctid='{0}'", ctid)));
+        }
+
+        public static CeErpTradeCell GetByCtid_M(string ctid)
+        {
+            return FindFirst(Expression.Sql(string.Format("(ctid='{0}' or ctid='C1_{0}')", ctid)));
+        }
+
+        public static CeErpTradeCell GetByCode(string code)
+        {
+            return FindFirst(Expression.Sql(string.Format("OrderSn='{0}'", code)));
+        }
+        public static CeErpTradeCell Get(int id)
+        {
+            return FindFirst(Expression.Eq("id", id));
+        }
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpTradeCell where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        public static void DelByCtid(object ctid)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpTradeCell where ctid='" + ctid + "'");
+            ExecuteNonQuery(sql.ToString());
+
+        }
+        public object Clone()
+        {
+            return this.MemberwiseClone();
+        }
+
+        //public static void UpdateRelationOrder(CeErpTradeCell father)
+        //{
+        //    try
+        //    {
+        //        //父订单变化,更新补差价订单
+        //        List<string> lw = new List<string>();
+        //        lw.Add(string.Format("OrderState={0}", father.OrderState));
+        //        lw.Add(string.Format("CustomerUserId={0}", father.CustomerUserId));
+        //        lw.Add(string.Format("DesignUserId={0}", father.DesignUserId));
+        //        lw.Add(string.Format("AfterSaleState={0}", father.AfterSaleState));
+        //        lw.Add(string.Format("IsNeedBill={0}", father.IsNeedBill));
+        //        //lw.Add(string.Format("IsUrgency={0}", father.IsUrgency == true ? 1 : 0));
+        //        lw.Add(string.Format("IsRefund={0}", father.IsRefund));
+        //        //lw.Add(string.Format("IsReturn={0}", father.IsReturn));
+
+        //        lw.Add(string.Format("WaitDesignTime='{0}'", father.WaitDesignTime.ToString()));
+        //        lw.Add(string.Format("StartDesignTime='{0}'", father.StartDesignTime.ToString()));
+        //        lw.Add(string.Format("FinishDesignTime='{0}'", father.FinishDesignTime.ToString()));
+        //        lw.Add(string.Format("FinishPlaceTime='{0}'", father.FinishPlaceTime.ToString()));
+        //        lw.Add(string.Format("FinishDeliveryTime='{0}'", father.FinishDeliveryTime.ToString()));
+
+        //        string sqlstr = string.Join(",", lw.ToArray());
+
+        //        StringBuilder sql = new StringBuilder();
+        //        sql.AppendFormat("update ce_erptradecell set " + sqlstr + " where ptid='{0}'", father.tid);
+        //        //sql.AppendFormat("update view_erptrade set status={1} where ptid={0}", father.ctid, father.status);
+        //        DbHelper.DbConn.ExecuteNonQuery(sql.ToString());
+        //    }
+        //    catch (Exception ex )
+        //    {
+        //        XLog.SaveLog(0, "UpdateRelationOrder"+ex.Message);
+        //    }
+
+        //}
+        private static object uprOrder = new object();
+        public static void UpdateRelationOrder(string ctid)
+        {
+            if (ctid.Length <= 0) return;
+
+            try
+            {
+                if (ctid.IndexOf("S_") != -1) return;
+                StringBuilder isHavesql = new StringBuilder();
+                string needCtid = ctid;
+                if (ctid.IndexOf("C1") != -1)
+                {
+                    needCtid = ctid.Replace("C1_", "");
+                }
+                //isHavesql.AppendFormat("select * from ce_erptradecell where ptid='{0}'; ", needCtid);
+                //DataTable dt_isHave = ExecuteDataset(isHavesql.ToString()).Tables[0];
+                //if (dt_isHave.Rows.Count > 0)
+                //{
+                StringBuilder sql = new StringBuilder();
+                //sql.AppendFormat("insert into S_BuChaJia(ctid,addtime) values('{0}',getdate()); ", ctid);values('{0}',getdate())
+                CeErpTradeCell ceErpTradeCell = FindFirst(Expression.Sql(string.Format("ptid='{0}'", needCtid)));
+                if (ceErpTradeCell != null)
+                {
+                    sql.AppendFormat("insert into S_BuChaJia(ctid,addtime) values('{0}',getdate()); ", ctid);
+                    ExecuteNonQuery(sql.ToString());
+                }
+                //}
+            }
+            catch (Exception ex)
+            {
+                XLog.SaveLog(0, "CeErpTradeCell,UpdateRelationOrder,insert" + ex.Message);
+                //}
+            }
+            /*
+            return;
+            //new Thread(new ThreadStart(delegate(){
+            try
+            {
+
+                SqlParameter[] sqlParameter ={
+                    new SqlParameter("@mainctids", SqlDbType.VarChar,100),
+                    new SqlParameter("@res", SqlDbType.VarChar, 4000)
+                };
+                string str_ctids = ctid;
+                sqlParameter[0].Value = str_ctids;
+                sqlParameter[1].Direction = ParameterDirection.Output;
+                ExecuteDataSetStore("sp_set_bucha", sqlParameter);
+            }
+            catch (Exception ex)
+            {
+                XLog.SaveLog(0, "CeErpTradeCell,UpdateRelationOrder" + ex.Message);
+                //}
+            }*/
+            // })).Start();
+
+            //StringBuilder sql = new StringBuilder();
+            //sql.Append("update ce_erptradecell set OrderState=b.OrderState,CustomerUserId=b.CustomerUserId,DesignUserId=b.DesignUserId,WaitDesignTime=b.WaitDesignTime,StartDesignTime=b.StartDesignTime,FinishDesignTime=b.FinishDesignTime,FinishPlaceTime=b.FinishPlaceTime,");
+            //sql.Append("AfterSaleState=b.AfterSaleState,IsNeedBill=b.IsNeedBill,IsRefund=b.IsRefund from ce_erptradecell,ce_erptradecell as b ");
+            //sql.AppendFormat("where ce_erptradecell.ptid =b.tid and ce_erptradecell.ptid='{0}'",tid);//='1827905618077154637'
+            //ExecuteNonQuery(sql.ToString());
+            /*
+
+            //父订单变化,更新补差价订单
+            List<string> lw = new List<string>();
+            lw.Add(string.Format("OrderState={0}", father.OrderState));
+            lw.Add(string.Format("CustomerUserId={0}", father.CustomerUserId));
+            lw.Add(string.Format("DesignUserId={0}", father.DesignUserId));
+            lw.Add(string.Format("AfterSaleState={0}", father.AfterSaleState));
+            lw.Add(string.Format("IsNeedBill={0}", father.IsNeedBill));
+            //lw.Add(string.Format("IsUrgency={0}", father.IsUrgency == true ? 1 : 0));
+            lw.Add(string.Format("IsRefund={0}", father.IsRefund));
+            //lw.Add(string.Format("IsReturn={0}", father.IsReturn));
+            string sqlstr = string.Join(" , ", lw.ToArray());
+
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("update view_erptradecell set " + sqlstr + " where ptid='{0}'", father.tid);
+            //sql.AppendFormat("update view_erptrade set status={1} where ptid={0}", father.ctid, father.status);
+            DbHelper.DbConn.ExecuteNonQuery(sql.ToString());*/
+
+
+        }
+
+
+    }
+}

+ 450 - 0
BizCom/Dao/CeErpTradeCellExtend.cs

@@ -0,0 +1,450 @@
+using Castle.ActiveRecord;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using NHibernate.Criterion;
+
+namespace BizCom
+{
+    [ActiveRecord("Ce_ErpTradeCellExtend")]
+    public class CeErpTradeCellExtend : ComBase<CeErpTradeCellExtend>
+    {
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _ctid = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ctid
+        {
+            get { return _ctid; }
+            set { _ctid = value; }
+        }
+        private int _supState = 0;
+        /// <summary>
+        /// 车间生产状态0正常1已生产
+        /// </summary>
+        [Property]
+        public int SupState
+        {
+            get { return _supState; }
+            set { _supState = value; }
+        }
+
+        private double _payment_cyt = 0;
+        [Property]
+        public double payment_cyt
+        {
+            get { return _payment_cyt; }
+            set { _payment_cyt = value; }
+        }
+        private double _urgentCharge = 0;
+        [Property]
+        public double urgentCharge
+        {
+            get { return _urgentCharge; }
+            set { _urgentCharge = value; }
+        }
+        private string _spu_id = "";
+        /// <summary>
+        /// spuId
+        /// </summary>
+        [Property]
+        public string spu_id
+        {
+            get { return _spu_id; }
+            set { _spu_id = value; }
+        }
+        private string _modExpressCom = "";
+        /// <summary>
+        /// 修改物流公司
+        /// </summary>
+        [Property]
+        public string modExpressCom
+        {
+            get { return _modExpressCom; }
+            set { _modExpressCom = value; }
+        }
+        private string _modExpressNo = "";
+        /// <summary>
+        /// 修改物流号
+        /// </summary>
+        [Property]
+        public string modExpressNo
+        {
+            get { return _modExpressNo; }
+            set { _modExpressNo = value; }
+        }
+        /// <summary>
+        /// 处理完成
+        /// </summary>
+        private int _readMod = 0;
+        [Property]
+        public int readMod
+        {
+            get { return _readMod; }
+            set { _readMod = value; }
+        }
+        /// <summary>
+        /// 回访
+        /// </summary>
+        private int _returnVisit = 0;
+        [Property]
+        public int returnVisit
+        {
+            get { return _returnVisit; }
+            set { _returnVisit = value; }
+        }
+
+        /// <summary>
+        ///预计设计的时间
+        /// </summary>
+        [Property]
+        public DateTime? predictFinishDesignTime { get; set; }
+
+        /// <summary>
+        ///预计下单的时间
+        /// </summary>
+        [Property]
+        public DateTime? predictFinishPlaceTime { get; set; }
+
+        /// <summary>
+        ///预计发货的时间
+        /// </summary>
+        [Property]
+        public DateTime? predictFinishSendTime { get; set; }
+
+        private string _cate1 = "";
+
+        /// <summary>
+        /// 分类1
+        /// </summary>
+        [Property]
+        public string cate1
+        {
+            get { return _cate1; }
+            set { _cate1 = value; }
+        }
+        private string _cate2 = "";
+        /// <summary>
+        /// 分类2
+        /// </summary>
+        [Property]
+        public string cate2
+        {
+            get { return _cate2; }
+            set { _cate2 = value; }
+        }
+        private string _scene = "";
+        /// <summary>
+        /// 场景
+        /// </summary>
+        [Property]
+        public string scene
+        {
+            get { return _scene; }
+            set { _scene = value; }
+        }
+        private string _material = "";
+
+        /// <summary>
+        /// 材质
+        /// </summary>
+        [Property]
+        public string material
+        {
+            get { return _material; }
+            set { _material = value; }
+        }
+        private double _offerAmount = 0.00;
+        /// <summary>
+        /// 报价金额
+        /// </summary>
+        [Property]
+        public double offerAmount
+        {
+            get { return _offerAmount; }
+            set { _offerAmount = value; }
+        }
+        private int _numbers = 0;
+        /// <summary>
+        /// 款数
+        /// </summary>
+        [Property]
+        public int numbers
+        {
+            get { return _numbers; }
+            set { _numbers = value; }
+        }
+        private string _typeScene = "";
+        /// <summary>
+        /// 品类场景
+        /// </summary>
+        [Property]
+        public string typeScene
+        {
+            get { return _typeScene; }
+            set { _typeScene = value; }
+        }
+        private string _opScene = "";
+        /// <summary>
+        /// 运营场景
+        /// </summary>
+        [Property]
+        public string opScene
+        {
+            get { return _opScene; }
+            set { _opScene = value; }
+        }
+        private string _craft = "";
+        /// <summary>
+        /// 工艺
+        /// </summary>
+        [Property]
+        public string craft
+        {
+            get { return _craft; }
+            set { _craft = value; }
+        }
+        private string _numberType = "";
+        /// <summary>
+        /// 多款类型
+        /// </summary>
+        [Property]
+        public string numberType
+        {
+            get { return _numberType; }
+            set { _numberType = value; }
+        }
+        private string _cate1Id = "";
+        /// <summary>
+        /// 分类Id
+        /// </summary>
+        [Property]
+        public string cate1Id
+        {
+            get { return _cate1Id; }
+            set { _cate1Id = value; }
+        }
+        private string _cate2Id = "";
+        /// <summary>
+        /// 分类Id
+        /// </summary>
+        [Property]
+        public string cate2Id
+        {
+            get { return _cate2Id; }
+            set { _cate2Id = value; }
+        }
+        private string _cate3Id = "";
+        /// <summary>
+        /// 分类Id
+        /// </summary>
+        [Property]
+        public string cate3Id
+        {
+            get { return _cate3Id; }
+            set { _cate3Id = value; }
+        }
+        private string _sceneId = "";
+        /// <summary>
+        /// 场景id
+        /// </summary>
+        [Property]
+        public string sceneId
+        {
+            get { return _sceneId; }
+            set { _sceneId = value; }
+        }
+        private string _typeSceneId = "";
+        /// <summary>
+        /// 品类场景id
+        /// </summary>
+        [Property]
+        public string typeSceneId
+        {
+            get { return _typeSceneId; }
+            set { _typeSceneId = value; }
+        }
+        private string _opSceneId = "";
+        /// <summary>
+        /// 运营场景id
+        /// </summary>
+        [Property]
+        public string opSceneId
+        {
+            get { return _opSceneId; }
+            set { _opSceneId = value; }
+        }
+        private string _materialId = "";
+        /// <summary>
+        /// 材质id
+        /// </summary>
+        [Property]
+        public string materialId
+        {
+            get { return _materialId; }
+            set { _materialId = value; }
+        }
+        private double _width = 0;
+        /// <summary>
+        /// 宽
+        /// </summary>
+        [Property]
+        public double width
+        {
+            get { return _width; }
+            set { _width = value; }
+        }
+        private double _height = 0;
+        /// <summary>
+        /// 高
+        /// </summary>
+        [Property]
+        public double height
+        {
+            get { return _height; }
+            set { _height = value; }
+        }
+        private double _length = 0;
+        /// <summary>
+        /// 长
+        /// </summary>
+        [Property]
+        public double length
+        {
+            get { return _length; }
+            set { _length = value; }
+        }
+        private string _recSize = "";
+        /// <summary>
+        /// 推荐尺寸
+        /// </summary>
+        [Property]
+        public string recSize
+        {
+            get { return _recSize; }
+            set { _recSize = value; }
+        }
+        private string _sizeUnit = "";
+        /// <summary>
+        /// 尺寸单位
+        /// </summary>
+        [Property]
+        public string sizeUnit
+        {
+            get { return _sizeUnit; }
+            set { _sizeUnit = value; }
+        }
+        private string _numberUnit = "";
+        /// <summary>
+        /// 数量单位
+        /// </summary>
+        [Property]
+        public string numberUnit
+        {
+            get { return _numberUnit; }
+            set { _numberUnit = value; }
+        }
+        private int _orderFrom = 10;
+        /// <summary>
+        /// 【订单来源】"10":第三方平台"15":私域电商"20":ERP"30":售前系统
+        /// </summary>
+        [Property]
+        public int orderFrom
+        {
+            get { return _orderFrom; }
+            set { _orderFrom = value; }
+        }
+        private int _quantity = 0;
+        /// <summary>
+        /// 数量
+        /// </summary>
+        [Property]
+        public int quantity
+        {
+            get { return _quantity; }
+            set { _quantity = value; }
+        }
+        private double _discountAmount = 0;
+        /// <summary>
+        /// 折扣金额
+        /// </summary>
+        [Property]
+        public double discountAmount
+        {
+            get { return _discountAmount; }
+            set { _discountAmount = value; }
+        }
+        private double _differentAmount = 0;
+        /// <summary>
+        /// 补差金额
+        /// </summary>
+        [Property]
+        public double differentAmount
+        {
+            get { return _differentAmount; }
+            set { _differentAmount = value; }
+        }
+        private string _differentSplitNo = "";
+        /// <summary>
+        /// 补差拆单识别号
+        /// </summary>
+        [Property]
+        public string differentSplitNo
+        {
+            get { return _differentSplitNo; }
+            set { _differentSplitNo = value; }
+        }
+
+        private int _orderType = 10;
+        /// <summary>
+        /// 【订单类型】"10":线上单"15":线下单"20":补差单"30":售后单
+        /// </summary>
+        [Property]
+        public int orderType
+        {
+            get { return _orderType; }
+            set { _orderType = value; }
+        }
+
+        private string _parentOrderSn = "";
+        [Property]
+        public string parentOrderSn
+        {
+            get { return _parentOrderSn; }
+            set { _parentOrderSn = value; }
+        }
+        public static CeErpTradeCellExtend getByTid(string ctid)
+        {
+            return FindFirst(Expression.Sql(string.Format("ctid='{0}'", ctid)));
+        }
+        public static void createInfo(string tid, int type = 10, int from = 10)
+        {
+            CeErpTradeCellExtend ceErpTradeCellExtend = getByTid(tid);
+            if (ceErpTradeCellExtend == null)
+            {
+                ceErpTradeCellExtend = new CeErpTradeCellExtend();
+            }
+            ceErpTradeCellExtend.ctid = tid;
+            ceErpTradeCellExtend.orderFrom = from;
+            ceErpTradeCellExtend.orderType = type;
+            if (ceErpTradeCellExtend.ID != 0)
+            {
+                ceErpTradeCellExtend.Update();
+            }
+            else
+            {
+                ceErpTradeCellExtend.Create();
+            }
+
+        }
+    }
+}

+ 120 - 0
BizCom/Dao/CeErpTradeLog.cs

@@ -0,0 +1,120 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpTradeLog")]
+    public class CeErpTradeLog : ComBase<CeErpTradeLog>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _tid = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string tid
+        {
+            get { return _tid; }
+            set { _tid = value; }
+        }
+
+        private int _orderState = 0;
+        /// <summary>
+        ///日志生成是订单当前状态
+        /// </summary>
+        [Property]
+        public int OrderState
+        {
+            get { return _orderState; }
+            set { _orderState = value; }
+        }
+
+        private int _userId = 0;
+        /// <summary>
+        ///操作人Id
+        /// </summary>
+        [Property]
+        public int UserId
+        {
+            get { return _userId; }
+            set { _userId = value; }
+        }
+
+        /// <summary>
+        ///操作时间
+        /// </summary>
+        [Property]
+        public DateTime? OperateTime { get; set; }
+
+        private string _con = "";
+        /// <summary>
+        ///操作说明
+        /// </summary>
+        [Property]
+        public string Con
+        {
+            get { return _con; }
+            set { _con = value; }
+        }
+
+        private int _afterSaleState = 0;
+        /// <summary>
+        ///是否售后>0进入售后
+        /// </summary>
+        [Property]
+        public int AfterSaleState
+        {
+            get { return _afterSaleState; }
+            set { _afterSaleState = value; }
+        }
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpTradeLog where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        public static void AddLog(string tid, int ostate, int uid)
+        {
+            AddLog(tid, ostate, uid, "");
+        }
+
+        public static void AddLog(string tid, int ostate, int uid, string con)
+        {
+            try
+            {
+                CeErpTradeLog tradeLog = new CeErpTradeLog();
+                tradeLog.tid = tid;
+                tradeLog.OrderState = ostate;
+                tradeLog.UserId = uid;
+                tradeLog.Con = con;
+                tradeLog.OperateTime = DateTime.Now;
+                tradeLog.Create();
+            }
+            catch
+            {
+
+            }
+        }
+
+
+        //直接用状态以及tid查询订单
+        public static int GetByTidAndStatus(string tid, int status)
+        {
+                DataTable dt = DbConn.ExecuteDataset("select top 1 * from CE_ErpTradeLog where tid = '"+ tid + "' and OrderState ="+ status + " ;").Tables[0];
+                  return dt.Rows.Count;
+            
+        }
+    }
+}

+ 324 - 0
BizCom/Dao/CeErpTradeOrder.cs

@@ -0,0 +1,324 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpTradeOrder")]
+    public class CeErpTradeOrder : ComBase<CeErpTradeOrder>
+    {
+
+        private string _tid = "";
+        /// <summary>
+        ///交易编号
+        /// </summary>
+        [Property]
+        public string tid
+        {
+            get { return _tid; }
+            set { _tid = value; }
+        }
+
+        private string _buyer_nick = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string buyer_nick
+        {
+            get { return _buyer_nick; }
+            set { _buyer_nick = value; }
+        }
+
+        private string _refund_status = "";
+        /// <summary>
+        ///退款状态
+        /// </summary>
+        [Property]
+        public string refund_status
+        {
+            get { return _refund_status; }
+            set { _refund_status = value; }
+        }
+
+        private bool _buyer_rate = false;
+        /// <summary>
+        ///买家是否已评价
+        /// </summary>
+        [Property]
+        public bool buyer_rate
+        {
+            get { return _buyer_rate; }
+            set { _buyer_rate = value; }
+        }
+
+        private bool _seller_rate = false;
+        /// <summary>
+        ///seller_rate
+        /// </summary>
+        [Property]
+        public bool seller_rate
+        {
+            get { return _seller_rate; }
+            set { _seller_rate = value; }
+        }
+
+        private string _seller_type = "";
+        /// <summary>
+        ///卖家类型
+        /// </summary>
+        [Property]
+        public string seller_type
+        {
+            get { return _seller_type; }
+            set { _seller_type = value; }
+        }
+
+        [PrimaryKey(PrimaryKeyType.Assigned)]
+        public string oid { get; set; }
+
+        private string _status = "";
+        /// <summary>
+        ///订单状态
+        /// </summary>
+        [Property]
+        public string status
+        {
+            get { return _status; }
+            set { _status = value; }
+        }
+
+        private string _title = "";
+        /// <summary>
+        ///商品标题
+        /// </summary>
+        [Property]
+        public string title
+        {
+            get { return _title; }
+            set { _title = value; }
+        }
+
+        private double _price = 0;
+        /// <summary>
+        ///商品价格
+        /// </summary>
+        [Property]
+        public double price
+        {
+            get { return _price; }
+            set { _price = value; }
+        }
+
+        private double _num = 0;
+        /// <summary>
+        ///购买数量
+        /// </summary>
+        [Property]
+        public double num
+        {
+            get { return _num; }
+            set { _num = value; }
+        }
+
+        private double _total_fee = 0;
+        /// <summary>
+        ///应付金额
+        /// </summary>
+        [Property]
+        public double total_fee
+        {
+            get { return _total_fee; }
+            set { _total_fee = value; }
+        }
+
+        private double _payment = 0;
+        /// <summary>
+        ///子订单实付金额
+        /// </summary>
+        [Property]
+        public double payment
+        {
+            get { return _payment; }
+            set { _payment = value; }
+        }
+
+        private double _discount_fee = 0;
+        /// <summary>
+        ///子订单级订单优惠金额
+        /// </summary>
+        [Property]
+        public double discount_fee
+        {
+            get { return _discount_fee; }
+            set { _discount_fee = value; }
+        }
+
+        private double _adjust_fee = 0;
+        /// <summary>
+        ///手工调整金额
+        /// </summary>
+        [Property]
+        public double adjust_fee
+        {
+            get { return _adjust_fee; }
+            set { _adjust_fee = value; }
+        }
+
+        private bool _is_oversold = false;
+        /// <summary>
+        ///是否超卖
+        /// </summary>
+        [Property]
+        public bool is_oversold
+        {
+            get { return _is_oversold; }
+            set { _is_oversold = value; }
+        }
+
+        private string _store_code = "";
+        /// <summary>
+        ///发货的仓库编码
+        /// </summary>
+        [Property]
+        public string store_code
+        {
+            get { return _store_code; }
+            set { _store_code = value; }
+        }
+
+
+        private string _sku_id = "";
+        /// <summary>
+        ///客户选项 sku
+        /// </summary>
+        [Property]
+        public string sku_id
+        {
+            get { return _sku_id; }
+            set { _sku_id = value; }
+        }
+        private string _sku_properties_name = "";
+        /// <summary>
+        ///客户选项 sku
+        /// </summary>
+        [Property]
+        public string sku_properties_name
+        {
+            get { return _sku_properties_name; }
+            set { _sku_properties_name = value; }
+        }
+
+        private bool _is_sh_ship = false;
+        /// <summary>
+        ///是否发货
+        /// </summary>
+        [Property]
+        public bool is_sh_ship
+        {
+            get { return _is_sh_ship; }
+            set { _is_sh_ship = value; }
+        }
+
+        private double _divide_order_fee = 0;
+        /// <summary>
+        ///分摊之后的实付金额
+        /// </summary>
+        [Property]
+        public double divide_order_fee
+        {
+            get { return _divide_order_fee; }
+            set { _divide_order_fee = value; }
+        }
+
+        private string _pic_path = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string pic_path
+        {
+            get { return _pic_path; }
+            set { _pic_path = value; }
+        }
+
+        private string _bagSize = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string bagSize
+        {
+            get { return _bagSize; }
+            set { _bagSize = value; }
+        }
+
+        private string _bagCount = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string bagCount
+        {
+            get { return _bagCount; }
+            set { _bagCount = value; }
+        }
+
+        private string _bagName = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string bagName
+        {
+            get { return _bagName; }
+            set { _bagName = value; }
+        }
+
+        private int _bagRealCount = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int bagRealCount
+        {
+            get { return _bagRealCount; }
+            set { _bagRealCount = value; }
+        }
+        private int _isBagOrder = 0;
+        /// <summary>
+        ///是否sku手提袋
+        /// </summary>
+        [Property]
+        public int isBagOrder
+        {
+            get { return _isBagOrder; }
+            set { _isBagOrder = value; }
+        }
+
+        private string _spu_id = "";
+        /// <summary>
+        ///商品ID
+        /// </summary>
+        [Property]
+        public string spu_id
+        {
+            get { return _spu_id; }
+            set { _spu_id = value; }
+        }
+
+
+        public static CeErpTradeOrder GetByOid(string oid)
+        {
+            return FindFirst(Expression.Eq("oid", oid));
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpTradeOrder where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 287 - 0
BizCom/Dao/CeErpTradeRefund.cs

@@ -0,0 +1,287 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpTradeRefund")]
+    public class CeErpTradeRefund : ComBase<CeErpTradeRefund>
+    {
+
+        /// <summary>
+        /// 退款单号
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Assigned)]
+        public string refund_id { get; set; }
+
+        private string _oid = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string oid
+        {
+            get { return _oid; }
+            set { _oid = value; }
+        }
+
+        private string _tid = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string tid
+        {
+            get { return _tid; }
+            set { _tid = value; }
+        }
+
+        private string _total_fee = "";
+        /// <summary>
+        ///交易金额
+        /// </summary>
+        [Property]
+        public string total_fee
+        {
+            get { return _total_fee; }
+            set { _total_fee = value; }
+        }
+
+        private string _buyer_nick = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string buyer_nick
+        {
+            get { return _buyer_nick; }
+            set { _buyer_nick = value; }
+        }
+
+        private string _seller_nick = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string seller_nick
+        {
+            get { return _seller_nick; }
+            set { _seller_nick = value; }
+        }
+
+        /// <summary>
+        ///创建时间
+        /// </summary>
+        [Property]
+        public DateTime? created { get; set; }
+
+        /// <summary>
+        ///修改时间
+        /// </summary>
+        [Property]
+        public DateTime? modified { get; set; }
+
+        private string _order_status = "";
+        /// <summary>
+        ///交易状态
+        /// </summary>
+        [Property]
+        public string order_status
+        {
+            get { return _order_status; }
+            set { _order_status = value; }
+        }
+
+        private string _status = "";
+        /// <summary>
+        ///退款状态
+        /// </summary>
+        [Property]
+        public string status
+        {
+            get { return _status; }
+            set { _status = value; }
+        }
+
+        private string _good_status = "";
+        /// <summary>
+        ///货物状态
+        /// </summary>
+        [Property]
+        public string good_status
+        {
+            get { return _good_status; }
+            set { _good_status = value; }
+        }
+
+        private bool _has_good_return = false;
+        /// <summary>
+        ///买家是否需要退货
+        /// </summary>
+        [Property]
+        public bool has_good_return
+        {
+            get { return _has_good_return; }
+            set { _has_good_return = value; }
+        }
+
+        private string _refund_fee = "";
+        /// <summary>
+        ///退款金额
+        /// </summary>
+        [Property]
+        public string refund_fee
+        {
+            get { return _refund_fee; }
+            set { _refund_fee = value; }
+        }
+
+        private string _payment = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string payment
+        {
+            get { return _payment; }
+            set { _payment = value; }
+        }
+
+        private string _reason = "";
+        /// <summary>
+        ///退款原因
+        /// </summary>
+        [Property]
+        public string reason
+        {
+            get { return _reason; }
+            set { _reason = value; }
+        }
+
+        private string _describe = "";
+        /// <summary>
+        ///退款说明
+        /// </summary>
+        [Property]
+        public string describe
+        {
+            get { return _describe; }
+            set { _describe = value; }
+        }
+
+        private string _refund_phase = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string refund_phase
+        {
+            get { return _refund_phase; }
+            set { _refund_phase = value; }
+        }
+
+
+        private string _responsibleUserId = "";
+        /// <summary>
+        ///责任人 123_k,23_s
+        /// </summary>
+        [Property]
+        public string ResponsibleUserId
+        {
+            get { return _responsibleUserId; }
+            set { _responsibleUserId = value; }
+        }
+
+        private int _refundState = 0;
+        /// <summary>
+        ///审核状态 1待审核2待确认
+        /// </summary>
+        [Property]
+        public int RefundState
+        {
+            get { return _refundState; }
+            set { _refundState = value; }
+        }
+
+        private string _responsibleUserName = "";
+        /// <summary>
+        ///责任人名字
+        /// </summary>
+        [Property]
+        public string ResponsibleUserName
+        {
+            get { return _responsibleUserName; }
+            set { _responsibleUserName = value; }
+        }
+
+        private string _memo = "";
+        /// <summary>
+        ///标记的备注
+        /// </summary>
+        [Property]
+        public string Memo
+        {
+            get { return _memo; }
+            set { _memo = value; }
+        }
+
+        private int _isPartRefund = 0;
+        /// <summary>
+        ///是否部分退款
+        /// </summary>
+        [Property]
+        public int IsPartRefund
+        {
+            get { return _isPartRefund; }
+            set { _isPartRefund = value; }
+        }
+
+
+
+        private string _refundDesc = "";
+        /// <summary>
+        ///客户额外描述原因
+        /// </summary>
+        [Property]
+        public string refundDesc
+        {
+            get { return _refundDesc; }
+            set { _refundDesc = value; }
+        }
+        private string _buyer_id = "";
+        /// <summary>
+        ///客户id
+        /// </summary>
+        [Property]
+        public string buyer_id
+        {
+            get { return _buyer_id; }
+            set { _buyer_id = value; }
+        }
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpTradeRefund where tid='" + id + "'");
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        public static CeErpTradeRefund Get(string rid)
+        {
+            return FindFirst(Expression.Sql("refund_id='" + rid + "'"));
+        }
+        public static CeErpTradeRefund GetByTid(string rid)
+        {
+            return FindFirst(Expression.Sql("tid='" + rid + "'"));
+        }
+        public static CeErpTradeRefund GetByTidAndReId(string rid, string refundid)
+        {
+            return FindFirst(Expression.Sql(string.Format("tid='{0}' and refund_id = '{1}'", rid, refundid)));
+        }
+        public static CeErpTradeRefund GetByOidAndReId(string rid, string refundid)
+        {
+            return FindFirst(Expression.Sql(string.Format("oid='{0}' and refund_id = '{1}'", rid, refundid)));
+        }
+    }
+}

+ 184 - 0
BizCom/Dao/CeErpTradeResponsible.cs

@@ -0,0 +1,184 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpTradeResponsible")]
+    public class CeErpTradeResponsible : ComBase<CeErpTradeResponsible>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _tid = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string tid
+        {
+            get { return _tid; }
+            set { _tid = value; }
+        }
+
+        private int _userId = 0;
+        /// <summary>
+        ///责任人id
+        /// </summary>
+        [Property]
+        public int UserId
+        {
+            get { return _userId; }
+            set { _userId = value; }
+        }
+
+        private int _verifyState = 0;
+        /// <summary>
+        ///审核状态-1作废0主管审核1认可完成2拒绝3个人审核4自动完成5强制完成
+        /// </summary>
+        [Property]
+        public int VerifyState
+        {
+            get { return _verifyState; }
+            set { _verifyState = value; }
+        }
+
+        /// <summary>
+        ///审核时间
+        /// </summary>
+        [Property]
+        public DateTime? VerifyTime { get; set; }
+
+        /// <summary>
+        ///创建时间
+        /// </summary>
+        [Property]
+        public DateTime? createdTime { get; set; }
+
+
+        private int _isArbitrate = 0;
+        /// <summary>
+        ///是否申请仲裁
+        /// </summary>
+        [Property]
+        public int IsArbitrate
+        {
+            get { return _isArbitrate; }
+            set { _isArbitrate = value; }
+        }
+        private int _isSup = 0;
+        /// <summary>
+        ///是否供应商
+        /// </summary>
+        [Property]
+        public int IsSup
+        {
+            get { return _isSup; }
+            set { _isSup = value; }
+        }
+        private int _isFlow = 0;
+        /// <summary>
+        ///是否供应商
+        /// </summary>
+        [Property]
+        public int IsFlow
+        {
+            get { return _isFlow; }
+            set { _isFlow = value; }
+        }
+
+        private string _arbitradeMemo = "";
+        /// <summary>
+        ///申请仲裁原因
+        /// </summary>
+        [Property]
+        public string ArbitradeMemo
+        {
+            get { return _arbitradeMemo; }
+            set { _arbitradeMemo = value; }
+        }
+
+        private int _backNum = 0;
+        /// <summary>
+        ///打回次数
+        /// </summary>
+        [Property]
+        public int BackNum
+        {
+            get { return _backNum; }
+            set { _backNum = value; }
+
+        }
+        private int _isTem = 0;
+        /// <summary>
+        ///是否终止
+        /// </summary>
+        [Property]
+        public int IsTem
+        {
+            get { return _isTem; }
+            set { _isTem = value; }
+        }
+
+        private double _refundFee = 0;
+        /// <summary>
+        ///扣款金额
+        /// </summary>
+        [Property]
+        public double RefundFee
+        {
+            get { return _refundFee; }
+            set { _refundFee = value; }
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("update CE_ErpTradeResponsible set VerifyState = -1 where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+        public static void DelByTid(object id, int state)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("update CE_ErpTradeResponsible set VerifyState = " + state + ", VerifyTime=GETDATE() where tid='" + id + "' and VerifyState > -1");
+            ExecuteNonQuery(sql.ToString());
+        }
+        public static void DelById(object id, int state)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("update CE_ErpTradeResponsible set VerifyState = " + state + ", VerifyTime=GETDATE() where ID='" + id + "' and VerifyState > -1");
+            ExecuteNonQuery(sql.ToString());
+        }
+        public static void NumByTid(int backNum, object tid)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat(string.Format("update CE_ErpTradeResponsible set BackNum={0} where tid='{1}'", backNum, tid));
+            ExecuteNonQuery(sql.ToString());
+        }
+        public static void dateByTid(string tid)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat(string.Format("update CE_ErpTradeResponsible set VerifyTime=GETDATE() where tid='{0}'", tid));
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        public static CeErpTradeResponsible GetByUserId(string ctid, int userId, int isSup, int isFlow)
+        {
+            return FindFirst(Expression.Sql(string.Format("tid='{0}' and UserId='{1}' and IsSup='{2}' and IsFlow = {3}", ctid, userId, isSup, isFlow)));
+        }
+        public static CeErpTradeResponsible GetByCtid(string ctid)
+        {
+            return FindFirst(Expression.Sql(string.Format("tid='{0}'", ctid)));
+        }
+        public static CeErpTradeResponsible GetById(string id)
+        {
+            return FindFirst(Expression.Sql(string.Format("ID='{0}'", id)));
+        }
+    }
+}

+ 119 - 0
BizCom/Dao/CeErpTradeSample.cs

@@ -0,0 +1,119 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpTradeSample")]
+    public class CeErpTradeSample : ComBase<CeErpTradeSample>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _ctid = "";
+        /// <summary>
+        ///땐데뵀
+        /// </summary>
+        [Property]
+        public string ctid
+        {
+            get { return _ctid; }
+            set { _ctid = value; }
+        }
+
+        /// <summary>
+        ///쌈데珂쇌
+        /// </summary>
+        [Property]
+        public DateTime? ReceiveDate { get; set; }
+
+        private double _advanceFee = 0;
+        /// <summary>
+        ///득마쏜띨
+        /// </summary>
+        [Property]
+        public double AdvanceFee
+        {
+            get { return _advanceFee; }
+            set { _advanceFee = value; }
+        }
+
+        private double _refund = 0;
+        /// <summary>
+        ///럿운쏜띨
+        /// </summary>
+        [Property]
+        public double Refund
+        {
+            get { return _refund; }
+            set { _refund = value; }
+        }
+
+        private double _commission = 0;
+        /// <summary>
+        ///澾쏜
+        /// </summary>
+        [Property]
+        public double Commission
+        {
+            get { return _commission; }
+            set { _commission = value; }
+        }
+
+        private double _serviceFee = 0;
+        /// <summary>
+        ///틱憩륩蛟롤
+        /// </summary>
+        [Property]
+        public double ServiceFee
+        {
+            get { return _serviceFee; }
+            set { _serviceFee = value; }
+        }
+
+        private double _logisticsFee = 0;
+        /// <summary>
+        ///우뒵롤
+        /// </summary>
+        [Property]
+        public double LogisticsFee
+        {
+            get { return _logisticsFee; }
+            set { _logisticsFee = value; }
+        }
+
+        /// <summary>
+        ///깃션휑퍅
+        /// </summary>
+        [Property]
+        public DateTime? SampleDate { get; set; }
+
+        private int _sampleUserId = 0;
+        /// <summary>
+        ///깃션훙逃ID
+        /// </summary>
+        [Property]
+        public int SampleUserId
+        {
+            get { return _sampleUserId; }
+            set { _sampleUserId = value; }
+        }
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpTradeSample where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        public static CeErpTradeSample GetBytid(string tid)
+        {
+            return FindFirst(Expression.Eq("ctid", tid));
+        }
+    }
+}

+ 154 - 0
BizCom/Dao/CeErpTradeSpu.cs

@@ -0,0 +1,154 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpTradeSpu")]
+    public class CeErpTradeSpu : ComBase<CeErpTradeSpu>
+    {
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+
+        /// <summary>
+        ///发货时间
+        /// </summary>
+        [Property]
+        public DateTime? createTime { get; set; }
+
+        private string _spuId = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string spuId
+        {
+            get { return _spuId; }
+            set { _spuId = value; }
+        }
+        private string _tid = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string tid
+        {
+            get { return _tid; }
+            set { _tid = value; }
+        }
+        /// <summary>
+        /// 分类
+        /// </summary>
+        private string _category = "";
+
+        [Property]
+        public string category
+        {
+            get { return _category; }
+            set { _category = value; }
+        }
+        /// <summary>
+        /// 流水号
+        /// </summary>
+        private string _serialNumber = "";
+
+        [Property]
+        public string serialNumber
+        {
+            get { return _serialNumber; }
+            set { _serialNumber = value; }
+        }
+        /// <summary>
+        /// 运营
+        /// </summary>
+        private string _operate = "";
+
+        [Property]
+        public string operate
+        {
+            get { return _operate; }
+            set { _operate = value; }
+        }
+        /// <summary>
+        /// 美工
+        /// </summary>
+        private string _designer = "";
+
+        [Property]
+        public string designer
+        {
+            get { return _designer; }
+            set { _designer = value; }
+        }
+        /// <summary>
+        /// 附件
+        /// </summary>
+        private string _atta = "";
+
+        [Property]
+        public string atta
+        {
+            get { return _atta; }
+            set { _atta = value; }
+        }
+        /// <summary>
+        /// 店铺
+        /// </summary>
+        private int _shopId = 0;
+
+        [Property]
+        public int shopId
+        {
+            get { return _shopId; }
+            set { _shopId = value; }
+        }
+
+        /// <summary>
+        ///上架时间
+        /// </summary>
+        [Property]
+        public DateTime? upTime { get; set; }
+
+        /// <summary>
+        /// 是否同步
+        /// </summary>
+        private bool _isSync = false;
+        public bool isSync
+        {
+            get { return _isSync; }
+            set { _isSync = value; }
+        }
+        /// <summary>
+        /// 返回信息
+        /// </summary>
+        private string _message = "";
+
+        public string message
+        {
+            get { return _message; }
+            set { _message = value; }
+        }
+        public static CeErpTradeSpu GetBySpuId(string spuId)
+        {
+            return FindFirst(Expression.Eq("spuId", spuId));
+        }
+
+        public static void updateAsync(string id)
+        {
+            ExecuteNonQuery(string.Format("update CE_ErpTradeSpu set isSync=1 where ID='{0}'", id));
+        }
+
+        public static void updateError(string id, string message)
+        {
+            ExecuteNonQuery(string.Format("update CE_ErpTradeSpu set message='{1}' where ID='{0}'", id, message));
+        }
+    }
+}

+ 352 - 0
BizCom/Dao/CeErpUser.cs

@@ -0,0 +1,352 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpUser")]
+    public class CeErpUser : ComBase<CeErpUser>
+    {
+        /// <summary>
+        /// 内部编号
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+
+        private CeErpUserInfo _person;
+        [BelongsTo("InfoID", Insert = false, NotFoundBehaviour = NotFoundBehaviour.Ignore, Cascade = CascadeEnum.None, Update = false)]
+        public CeErpUserInfo Person
+        {
+            get { return _person; }
+            set { _person = value; }
+        }
+
+        private int _infoID = 0;
+        /// <summary>
+        ///人员编号
+        /// </summary>
+        [Property]
+        public int InfoID
+        {
+            get { return _infoID; }
+            set { _infoID = value; }
+        }
+
+        private string _account = "";
+        /// <summary>
+        ///账号
+        /// </summary>
+        [Property]
+        public string Account
+        {
+            get { return _account; }
+            set { _account = value; }
+        }
+
+        private string _passWord = "";
+        /// <summary>
+        ///密码
+        /// </summary>
+        [Property]
+        public string PassWord
+        {
+            get { return _passWord; }
+            set { _passWord = value; }
+        }
+
+        /// <summary>
+        ///创建时间
+        /// </summary>
+        [Property]
+        public DateTime? CreateTime { get; set; }
+
+        /// <summary>
+        ///上一次登陆时间
+        /// </summary>
+        [Property]
+        public DateTime? PreLoginTime { get; set; }
+
+        /// <summary>
+        ///最后一次登录时间
+        /// </summary>
+        [Property]
+        public DateTime? CurLoginTime { get; set; }
+
+        private string _loginIP = "";
+        /// <summary>
+        ///登录IP
+        /// </summary>
+        [Property]
+        public string LoginIP
+        {
+            get { return _loginIP; }
+            set { _loginIP = value; }
+        }
+
+        private string _ticket = "";
+        /// <summary>
+        ///登录票根
+        /// </summary>
+        [Property]
+        public string Ticket
+        {
+            get { return _ticket; }
+            set { _ticket = value; }
+        }
+
+        private int _state = 0;
+        /// <summary>
+        ///当前状态
+        /// </summary>
+        [Property]
+        public int State
+        {
+            get { return _state; }
+            set { _state = value; }
+        }
+
+        private string _station = "";
+        /// <summary>
+        ///站点
+        /// </summary>
+        [Property]
+        public string Station
+        {
+            get { return _station; }
+            set { _station = value; }
+        }
+
+        private string _Name = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Name
+        {
+            get { return _Name; }
+            set { _Name = value; }
+        }
+
+        private int _isApp = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int isApp
+        {
+            get { return _isApp; }
+            set { _isApp = value; }
+        }
+        private string _Code = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Code
+        {
+            get { return _Code; }
+            set { _Code = value; }
+        }
+
+        private bool _isOpen = false;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public bool isOpen
+        {
+            get { return _isOpen; }
+            set { _isOpen = value; }
+        }
+
+        private string _pemShop = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string pemShop
+        {
+            get { return _pemShop; }
+            set { _pemShop = value; }
+        }
+
+        private string _pemDesign = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string pemDesign
+        {
+            get { return _pemDesign; }
+            set { _pemDesign = value; }
+        }
+
+        private string _pemVend = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string pemVend
+        {
+            get { return _pemVend; }
+            set { _pemVend = value; }
+        }
+
+        private string _pemLogistics = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string pemLogistics
+        {
+            get { return _pemLogistics; }
+            set { _pemLogistics = value; }
+        }
+
+        private int _isMultiLogin = 0;
+        /// <summary>
+        ///是否可以多台登录
+        /// </summary>
+        [Property]
+        public int IsMultiLogin
+        {
+            get { return _isMultiLogin; }
+            set { _isMultiLogin = value; }
+        }
+
+        /// <summary>
+        ///设计点上班时间
+        /// </summary>
+        [Property]
+        public DateTime? OnDutyTime { get; set; }
+
+        private string _teamIds = "";
+        /// <summary>
+        ///小组id
+        /// </summary>
+        [Property]
+        public string TeamIds
+        {
+            get { return _teamIds; }
+            set { _teamIds = value; }
+        }
+
+        private string _teamNames = "";
+        /// <summary>
+        ///小组人名
+        /// </summary>
+        [Property]
+        public string TeamNames
+        {
+            get { return _teamNames; }
+            set { _teamNames = value; }
+        }
+
+        /// <summary>
+        ///下班时间
+        /// </summary>
+        [Property]
+        public DateTime? OffDutyTime { get; set; }
+
+        private string _pemExpress = "";
+        /// <summary>
+        ///可以使用的快递
+        /// </summary>
+        [Property]
+        public string pemExpress
+        {
+            get { return _pemExpress; }
+            set { _pemExpress = value; }
+        }
+        private string _manageOrgIds = "";
+        /// <summary>
+        /// 管理组织
+        /// </summary>
+        [Property]
+        public string ManageOrgIds
+        {
+            get { return _manageOrgIds; }
+            set { _manageOrgIds = value; }
+        }
+
+        public static CeErpUser GetByUserName(string username)
+        {
+            CeErpUser lcUser = FindFirst(Expression.Sql(string.Format("Name='{0}' ", username)));
+            return lcUser;
+        }
+
+
+        public static CeErpUser Get(int uId, string pwd)
+        {
+            Castle.ActiveRecord.Queries.SimpleQuery query = new Castle.ActiveRecord.Queries.SimpleQuery(typeof(CeErpUser), @"from CeErpUser user where user.ID = ? and user.PassWord = ?", uId, pwd);
+            CeErpUser[] users = (CeErpUser[])ExecuteQuery(query);
+            if (users.Length > 0) return users[0];
+            return null;
+            //return FindFirst(Expression.Sql(string.Format("ID={0} and Password='{1}'", uId, pwd)));
+        }
+
+        /// <summary>
+        /// 查询cookie的票据是否符合
+        /// </summary>
+        /// <param name="userName"></param>
+        /// <param name="ticket"></param>
+        /// <returns></returns>
+        public static CeErpUser GetUserByCookie(string account, string ticket)
+        {
+            CeErpUser lcUser = FindFirst(Expression.Sql(string.Format("Account='{0}'  and Ticket='{1}'", account, ticket)));
+            //FindFirst(Expression.And(Expression.Eq("Account", account), Expression.Eq("Ticket", ticket)));
+            return lcUser;
+        }
+
+        public static CeErpUser GetByLogin(string account, string pwd)
+        {
+            return FindFirst(Expression.Sql(string.Format("Account='{0}' and PassWord='{1}' ", account, pwd)));
+        }
+
+        public static void ResetPwd(int id, string pwd)
+        {
+            string sql = "update ce_erpuser set password='" + pwd + "' where id=" + id;
+            ExecuteNonQuery(sql);
+        }
+
+        public static void ResetPersonPwd(int pId, string pwd)
+        {
+            string sql = "update ce_erpuser set password='" + pwd + "' where infoid=" + pId;
+            ExecuteNonQuery(sql);
+        }
+
+        public static void OpenAccount(int uid, string pwd)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("if (select count(0) from ce_erpuser where id={0} and password='')>0 begin ", uid);
+            sql.AppendFormat(" update ce_erpuser set isopen=1,state=0,password='{1}' where id={0} ", uid, pwd);
+            sql.Append(" end else begin ");
+            sql.AppendFormat(" update ce_erpuser set isopen=1,state=0 where id={0} ", uid, pwd);
+            sql.Append(" end ");
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        public static void FreezeAccount(int uid)
+        {
+            string sql = "update ce_erpuser set isopen=0,state=1 where id=" + uid;
+            ExecuteNonQuery(sql);
+        }
+
+        public static int RealDel(int id)
+        {
+            StringBuilder str = new StringBuilder();
+            str.AppendFormat("delete ce_erpuserinfo where id in(select infoid from ce_erpuser where id={0});", id);
+            str.AppendFormat("delete from ce_erpuser where id={0};", id);
+            return ExecuteNonQuery(str.ToString());
+        }
+
+        public static int IsOnDuty(int id)
+        {
+            StringBuilder str = new StringBuilder();
+            str.AppendFormat("select OnDuty from view_ErpUser where id = {0};", id);
+            return ExecuteNonQuery(str.ToString());
+        }
+    }
+}

+ 347 - 0
BizCom/Dao/CeErpUserInfo.cs

@@ -0,0 +1,347 @@
+using Castle.ActiveRecord;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpUserInfo")]
+    public class CeErpUserInfo : ComBase<CeErpUserInfo>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _nickName = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string NickName
+        {
+            get { return _nickName; }
+            set { _nickName = value; }
+        }
+
+        private string _picture = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Picture
+        {
+            get { return _picture; }
+            set { _picture = value; }
+        }
+
+        private string _sex = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Sex
+        {
+            get { return _sex; }
+            set { _sex = value; }
+        }
+
+        private string _mobile = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Mobile
+        {
+            get { return _mobile; }
+            set { _mobile = value; }
+        }
+
+        private string _mobile2 = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Mobile2
+        {
+            get { return _mobile2; }
+            set { _mobile2 = value; }
+        }
+
+        private string _phone = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Phone
+        {
+            get { return _phone; }
+            set { _phone = value; }
+        }
+
+        private string _email = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Email
+        {
+            get { return _email; }
+            set { _email = value; }
+        }
+
+        private string _carNumber = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string CarNumber
+        {
+            get { return _carNumber; }
+            set { _carNumber = value; }
+        }
+
+        private string _identityCard = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string IdentityCard
+        {
+            get { return _identityCard; }
+            set { _identityCard = value; }
+        }
+
+        private string _party = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Party
+        {
+            get { return _party; }
+            set { _party = value; }
+        }
+
+        private string _address = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Address
+        {
+            get { return _address; }
+            set { _address = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? BirthDay { get; set; }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? EnterTime { get; set; }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? LeaveTime { get; set; }
+
+        private bool _isDel = false;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public bool isDel
+        {
+            get { return _isDel; }
+            set { _isDel = value; }
+        }
+
+        private int _state = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int State
+        {
+            get { return _state; }
+            set { _state = value; }
+        }
+
+        private string _tb = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Tb
+        {
+            get { return _tb; }
+            set { _tb = value; }
+        }
+
+        private string _pdd = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Pdd
+        {
+            get { return _pdd; }
+            set { _pdd = value; }
+        }
+
+        private string _jd = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Jd
+        {
+            get { return _jd; }
+            set { _jd = value; }
+        }
+
+        private string _ali = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Ali
+        {
+            get { return _ali; }
+            set { _ali = value; }
+        }
+
+        private string _ding = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Ding
+        {
+            get { return _ding; }
+            set { _ding = value; }
+        }
+
+        private int _onDuty = 0;
+        /// <summary>
+        ///是否在岗
+        /// </summary>
+        [Property]
+        public int OnDuty
+        {
+            get { return _onDuty; }
+            set { _onDuty = value; }
+        }
+
+        private int _dayOrderReceive = 0;
+        /// <summary>
+        ///日接单数量
+        /// </summary>
+        [Property]
+        public int DayOrderReceive
+        {
+            get { return _dayOrderReceive; }
+            set { _dayOrderReceive = value; }
+        }
+
+        private double _dayOrderPer = 0;
+        /// <summary>
+        ///日可接单比例
+        /// </summary>
+        [Property]
+        public double DayOrderPer
+        {
+            get { return _dayOrderPer; }
+            set { _dayOrderPer = value; }
+        }
+
+        private int _beOnDuty = 0;
+        /// <summary>
+        ///是否值班
+        /// </summary>
+        [Property]
+        public int BeOnDuty
+        {
+            get { return _beOnDuty; }
+            set { _beOnDuty = value; }
+        }
+        private int _noFinish = 0;
+        /// <summary>
+        ///抢单未定稿数量
+        /// </summary>
+        [Property]
+        public int NoFinish
+        {
+            get { return _noFinish; }
+            set { _noFinish = value; }
+        }
+        private int _total = 0;
+        /// <summary>
+        ///一次性抢单数量
+        /// </summary>
+        [Property]
+        public int Total
+        {
+            get { return _total; }
+            set { _total = value; }
+        }
+        private int _finalization = 0;
+        /// <summary>
+        ///抢单定稿率限制
+        /// </summary>
+        [Property]
+        public int Finalization
+        {
+            get { return _finalization; }
+            set { _finalization = value; }
+        }
+
+        public static int Del(object id, string code)
+        {
+            StringBuilder str = new StringBuilder();
+            str.AppendFormat("update ce_erpuser set state=1 where personid={0} ;", id);
+            str.AppendFormat("update ce_erpuserinfo set isdel=1 where id={0} and code={1} ;", id, code);
+            return ExecuteNonQuery(str.ToString());
+        }
+
+        public static int RealDel(object id)
+        {
+            StringBuilder str = new StringBuilder();
+            str.AppendFormat("delete from ce_erppersonpost where PersonID={0} ;", id);
+            str.AppendFormat("delete from ce_erpuser where personid={0} ;", id);
+            str.AppendFormat("delete from ce_erpperson where id={0} ;", id);
+            return ExecuteNonQuery(str.ToString());
+        }
+
+        public static void OpenAccount(object pId, string pwd)
+        {
+            StringBuilder str = new StringBuilder();
+            str.AppendFormat("update ce_erpuserinfo set isopen=1 where id={0} ;", pId);
+            str.AppendFormat("if (select count(0) from ce_erpuser where PersonID={0})<1 ", pId);
+            str.AppendFormat(" begin ");
+            str.AppendFormat("insert into ce_erpuser(personid,account,password,createtime) select ID,Code,'{1}',getdate() from ce_erpperson where ID={0} ;", pId, pwd);
+            str.AppendFormat(" end ");
+            str.AppendFormat(" else ");
+            str.AppendFormat(" begin ");
+            str.AppendFormat("update ce_erpuser set state=0 where personID={0} ;", pId);
+            str.AppendFormat(" end ");
+            TransExecuteNonQuery(str.ToString());
+        }
+
+        public static void FreezeAccount(object pId)
+        {
+            StringBuilder str = new StringBuilder();
+            str.AppendFormat("update ce_erpuserinfo set isopen=0 where id={0} ;", pId);
+            str.AppendFormat("update ce_erpuser set state=1 where personid={0} ;", pId);
+            DbConn.ExecuteNonQuery(str.ToString());
+        }
+    }
+}

+ 90 - 0
BizCom/Dao/CeErpUserPost.cs

@@ -0,0 +1,90 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpUserPost")]
+    public class CeErpUserPost : ComBase<CeErpUserPost>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private int _userID = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int UserID
+        {
+            get { return _userID; }
+            set { _userID = value; }
+        }
+
+        private int _orgID = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int OrgID
+        {
+            get { return _orgID; }
+            set { _orgID = value; }
+        }
+
+
+        private CeErpPost _post;
+        [BelongsTo("PostID", Insert = false, NotFoundBehaviour = NotFoundBehaviour.Ignore, Cascade = CascadeEnum.None, Update = false)]
+        public CeErpPost Post
+        {
+            get { return _post; }
+            set { _post = value; }
+        }
+
+        private int _postID = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int PostID
+        {
+            get { return _postID; }
+            set { _postID = value; }
+        }
+
+
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpUserPost where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        public static void Del(object id, string personId)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpUserPost where id={0} and UserID={1}", id, personId);
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        public static CeErpUserPost Get(int personId, object id)
+        {
+            return FindFirst(Expression.And(Expression.Eq("UserID", personId), Expression.Eq("ID", Convert.ToInt32(id))));
+            //Expression.Sql(string.Format("PersonID={0} and ID={1}", personId, id)));
+        }
+
+        public static CeErpUserPost GetByUserID(int uid)
+        {
+            return FindFirst(Expression.Eq("UserID", uid));
+            //Expression.Sql(string.Format("PersonID={0} and ID={1}", personId, id)));
+        }
+
+    }
+}

+ 241 - 0
BizCom/Dao/CeErpZhangDan.cs

@@ -0,0 +1,241 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpZhangDan")]
+    public class CeErpZhangDan : ComBase<CeErpZhangDan>, ICloneable
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _tid = "";
+        /// <summary>
+        ///订单tid
+        /// </summary>
+        [Property]
+        public string tid
+        {
+            get { return _tid; }
+            set { _tid = value; }
+        }
+
+        private int _num = 0;
+        /// <summary>
+        ///数量
+        /// </summary>
+        [Property]
+        public int num
+        {
+            get { return _num; }
+            set { _num = value; }
+        }
+
+        private double _price = 0;
+        /// <summary>
+        ///单价
+        /// </summary>
+        [Property]
+        public double price
+        {
+            get { return _price; }
+            set { _price = value; }
+        }
+
+        private double _total = 0;
+        /// <summary>
+        ///总价
+        /// </summary>
+        [Property]
+        public double total
+        {
+            get { return _total; }
+            set { _total = value; }
+        }
+
+        private string _batchNo = "";
+        /// <summary>
+        ///批次号
+        /// </summary>
+        [Property]
+        public string batchNo
+        {
+            get { return _batchNo; }
+            set { _batchNo = value; }
+        }
+
+        private string _logistics = "";
+        /// <summary>
+        ///物流
+        /// </summary>
+        [Property]
+        public string logistics
+        {
+            get { return _logistics; }
+            set { _logistics = value; }
+        }
+
+        private string _logisticsNo = "";
+        /// <summary>
+        ///运单号
+        /// </summary>
+        [Property]
+        public string logisticsNo
+        {
+            get { return _logisticsNo; }
+            set { _logisticsNo = value; }
+        }
+
+        private double _logisticsAmount = 0;
+        /// <summary>
+        ///快递金额
+        /// </summary>
+        [Property]
+        public double logisticsAmount
+        {
+            get { return _logisticsAmount; }
+            set { _logisticsAmount = value; }
+        }
+
+        private double _weight = 0;
+        /// <summary>
+        ///重量
+        /// </summary>
+        [Property]
+        public double weight
+        {
+            get { return _weight; }
+            set { _weight = value; }
+        }
+
+        private string _fileName = "";
+        /// <summary>
+        ///文件名
+        /// </summary>
+        [Property]
+        public string fileName
+        {
+            get { return _fileName; }
+            set { _fileName = value; }
+        }
+
+        private string _province = "";
+        /// <summary>
+        ///计费省份
+        /// </summary>
+        [Property]
+        public string province
+        {
+            get { return _province; }
+            set { _province = value; }
+        }
+
+        private string _supplierName = "";
+        /// <summary>
+        ///供应商名称
+        /// </summary>
+        [Property]
+        public string supplierName
+        {
+            get { return _supplierName; }
+            set { _supplierName = value; }
+        }
+
+        private string _unusual = "";
+        /// <summary>
+        ///异常
+        /// </summary>
+        [Property]
+        public string unusual
+        {
+            get { return _unusual; }
+            set { _unusual = value; }
+        }
+
+        private string _explain = "";
+        /// <summary>
+        ///说明
+        /// </summary>
+        [Property]
+        public string explain
+        {
+            get { return _explain; }
+            set { _explain = value; }
+        }
+
+        /// <summary>
+        ///导入日期
+        /// </summary>
+        [Property]
+        public DateTime? importDate { get; set; }
+
+        /// <summary>
+        ///入账日期
+        /// </summary>
+        [Property]
+        public DateTime? accountedDate { get; set; }
+
+        private int _importUserId = 0;
+        /// <summary>
+        ///导入人员ID
+        /// </summary>
+        [Property]
+        public int importUserId { get; set; }
+
+        private int _shopId = 0;
+        /// <summary>
+        ///店铺ID
+        /// </summary>
+        [Property]
+        public int shopId
+        {
+            get { return _shopId; }
+            set { _shopId = value; }
+        }
+
+        private int _state = 0;
+        /// <summary>
+        ///状态
+        /// </summary>
+        [Property]
+        public int state
+        {
+            get { return _state; }
+            set { _state = value; }
+        }
+
+        /// <summary>
+        ///完成日期
+        /// </summary>
+        [Property]
+        public DateTime? finishDate { get; set; }
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_ErpZhangDan where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        public static CeErpZhangDan GetById(int id)
+        {
+            return FindFirst(Expression.Eq("ID", id));
+        }
+
+        public static CeErpZhangDan GetBytid(string tid)
+        {
+            return FindFirst(Expression.Eq("tid", tid));
+        }
+
+        public object Clone()
+        {
+            return this.MemberwiseClone();
+        }
+    }
+}

+ 84 - 0
BizCom/Dao/CeWithdraw.cs

@@ -0,0 +1,84 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+
+namespace BizCom
+{
+    [ActiveRecord("CE_Withdraw")]
+    public class CeWithdraw : ComBase<CeWithdraw>
+    {
+        [PrimaryKey(PrimaryKeyType.Assigned)]
+        public string tid { get; set; }
+
+
+        private int _userid = 0;
+        /// <summary>
+        ///用户id
+        /// </summary>
+        [Property]
+        public int userid
+        {
+            get { return _userid; }
+            set { _userid = value; }
+        }
+
+        private string _providerid = "";
+        /// <summary>
+        ///供应商id
+        /// </summary>
+        [Property]
+        public string providerid
+        {
+            get { return _providerid; }
+            set { _providerid = value; }
+        }
+
+        /// <summary>
+        ///发起时间
+        /// </summary>
+        [Property]
+        public DateTime? creationtime { get; set; }
+
+        /// <summary>
+        ///供应商确认时间
+        /// </summary>
+        [Property]
+        public DateTime? acknowledgingtime { get; set; }
+
+        private int _status = 0;
+        /// <summary>
+        ///状态
+        /// </summary>
+        [Property]
+        public int status
+        {
+            get { return _status; }
+            set { _status = value; }
+        }
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from CE_Withdraw where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        public static CeWithdraw GetByTid(string tid)
+        {
+            return FindFirst(Expression.Eq("tid", tid));
+        }
+
+        //直接用状态以及tid查询订单
+        public static CeWithdraw GetByTidAndStatus(string tid, int status)
+        {
+            Dictionary<string, string> map = null;
+            map.Add("tid", tid);
+            map.Add("status", status.ToString());
+            return FindFirst(Expression.AllEq(map));
+        }
+
+    }
+}

+ 84 - 0
BizCom/Dao/LogOperate.cs

@@ -0,0 +1,84 @@
+using Castle.ActiveRecord;
+using System;
+
+namespace BizCom
+{
+    [ActiveRecord("LogOperate")]
+    public class LogOperate : ComBase<LogOperate>
+    {
+
+        private string _id = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Assigned)]
+        public string id
+        {
+            get { return _id; }
+            set { _id = value; }
+        }
+
+        private string _operate_ip = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string operate_ip
+        {
+            get { return _operate_ip; }
+            set { _operate_ip = value; }
+        }
+
+        private string _operate_page = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string operate_page
+        {
+            get { return _operate_page; }
+            set { _operate_page = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? create_time { get; set; }
+
+        private int _create_uid = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int create_uid
+        {
+            get { return _create_uid; }
+            set { _create_uid = value; }
+        }
+
+        string _user_name = "";
+        [Property]
+        public string user_name
+        {
+            get { return _user_name; }
+            set { _user_name = value; }
+        }
+
+        static log4net.ILog logger = log4net.LogManager.GetLogger("LogOperate");//»ñȡһ¸öÈÕÖ¾¼Ç¼Æ÷
+        public static void Save(int uId, string userName, string ip, string pagePath)
+        {
+            logger.Info("uId:" + uId + " userName:" + userName + " ip:" + ip + " pagePath:" + pagePath);
+
+            /*
+            LogOperate logOperate = new LogOperate();
+            logOperate.create_uid = uId;
+            logOperate.user_name = userName;
+            logOperate.operate_page = pagePath;
+            logOperate.operate_ip = ip;
+            logOperate.id = Guid.NewGuid().ToString();
+            logOperate.create_time = DateTime.Now;
+            Save(logOperate);*/
+        }
+    }
+}

+ 84 - 0
BizCom/Dao/Log_Login.cs

@@ -0,0 +1,84 @@
+using Castle.ActiveRecord;
+using System;
+
+namespace BizCom
+{
+    [ActiveRecord("Log_Login")]
+    public class Log_Login : ComBase<Log_Login>
+    {
+
+        private string _id = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Assigned)]
+        public string id
+        {
+            get { return _id; }
+            set { _id = value; }
+        }
+
+        private string _user_name = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string user_name
+        {
+            get { return _user_name; }
+            set { _user_name = value; }
+        }
+
+        private string _login_ip = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string login_ip
+        {
+            get { return _login_ip; }
+            set { _login_ip = value; }
+        }
+
+        private int _is_success = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int is_success
+        {
+            get { return _is_success; }
+            set { _is_success = value; }
+        }
+
+        private string _err_msg = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string err_msg
+        {
+            get { return _err_msg; }
+            set { _err_msg = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? login_time { get; set; }
+
+
+        public static void Save(string userName, string ip, bool isSucess, string msg)
+        {
+            Log_Login log_Login = new Log_Login();
+            log_Login.user_name = userName;
+            log_Login.login_ip = ip;
+            log_Login.is_success = isSucess ? 1 : 0;
+            log_Login.err_msg = msg;
+            log_Login.id = Guid.NewGuid().ToString();
+            log_Login.login_time = DateTime.Now;
+            Save(log_Login);
+        }
+    }
+}

+ 423 - 0
BizCom/Dao/SUser.cs

@@ -0,0 +1,423 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("S_User")]
+    public class SUser : ComBase<SUser>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _lgName = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string lgName
+        {
+            get { return _lgName; }
+            set { _lgName = value; }
+        }
+
+        private string _nickName = "";
+        /// <summary>
+        ///会员名
+        /// </summary>
+        [Property]
+        public string NickName
+        {
+            get { return _nickName; }
+            set { _nickName = value; }
+        }
+
+        private string _realName = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string RealName
+        {
+            get { return _realName; }
+            set { _realName = value; }
+        }
+
+        private string _mobile = "";
+        /// <summary>
+        ///手机
+        /// </summary>
+        [Property]
+        public string Mobile
+        {
+            get { return _mobile; }
+            set { _mobile = value; }
+        }
+
+        private string _lgPwd = "";
+        /// <summary>
+        ///密码
+        /// </summary>
+        [Property]
+        public string lgPwd
+        {
+            get { return _lgPwd; }
+            set { _lgPwd = value; }
+        }
+
+        private string _userPic = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string UserPic
+        {
+            get { return _userPic; }
+            set { _userPic = value; }
+        }
+
+        private string _miniopenid = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string miniopenid
+        {
+            get { return _miniopenid; }
+            set { _miniopenid = value; }
+        }
+
+        private string _openid = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string openid
+        {
+            get { return _openid; }
+            set { _openid = value; }
+        }
+
+        private string _unionid = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string unionid
+        {
+            get { return _unionid; }
+            set { _unionid = value; }
+        }
+
+        private int _sex = 0;
+        /// <summary>
+        ///性别
+        /// </summary>
+        [Property]
+        public int Sex
+        {
+            get { return _sex; }
+            set { _sex = value; }
+        }
+
+        private string _loginIP = "";
+        /// <summary>
+        ///登录IP
+        /// </summary>
+        [Property]
+        public string LoginIP
+        {
+            get { return _loginIP; }
+            set { _loginIP = value; }
+        }
+
+        private int _state = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int State
+        {
+            get { return _state; }
+            set { _state = value; }
+        }
+
+        private int _expertID = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int ExpertID
+        {
+            get { return _expertID; }
+            set { _expertID = value; }
+        }
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? AddTime { get; set; }
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from S_User where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        public static SUser GetByWeixin(string unionid)
+        {
+            SUser SUser = FindFirst(Expression.Sql(string.Format("unionid='{0}'", unionid)));
+            return SUser;
+        }
+
+        public static SUser Get(string uname, string pwd)
+        {
+            return FindFirst(Expression.Sql(string.Format("lgName='{0}' and lgPwd='{1}'", uname, pwd)));
+        }
+
+        public static SUser GetByWeixinMiniOpenId(string uid, string opid)
+        {
+            SUser SUser = FindFirst(Expression.Sql(string.Format("unionid='{0}' or miniopenid='{1}'", uid, opid)));
+            return SUser;
+        }
+        public static SUser GetByWeixinMiniOpenId(string opid)
+        {
+            SUser SUser = FindFirst(Expression.Sql(string.Format("miniopenid='{0}'", opid)));
+            return SUser;
+        }
+
+
+        public static void UserSave(SUser user, string ip, string ticket)
+        {
+            UserSave(user, true, ip, ticket);
+        }
+
+        public static void UserSave(SUser user, bool isFeed, string ip, string ticket)
+        {
+            user.LoginIP = ip;
+            user.Create();
+        }
+
+        public static double GetUserMoney(int userId)
+        {
+            object obj = DbConn.ExecuteScalar("select usermoney from s_user where ID=" + userId);
+            return Convert.ToDouble(obj);
+        }
+
+        public static string GetOpenId(int userId)
+        {
+            object obj = DbConn.ExecuteScalar("select miniopenid from s_user where ID=" + userId);
+            if (obj != null) return obj.ToString();
+            return "";
+        }
+
+        /// <summary>
+        /// 查询是否已经存在当前用户
+        /// </summary>
+        /// <param name="userName"></param>
+        /// <returns></returns>
+        public static bool CheckExitsUser(string userName)
+        {
+            return CheckExits("UserName", userName);
+        }
+
+        public static bool CheckExitsNickName(string name)
+        {
+            string sql = "select count(0) from lc_user where username='{0}' or nickname='{0}'";
+            object result = DbConn.ExecuteScalar(string.Format(sql, name, name));
+            if (result == null) return false;
+            if (Convert.ToInt32(result) > 0) return true;
+            return false;
+        }
+
+        public static bool CheckExitsByWhere(string sWhere, string parms)
+        {
+            return Exists(sWhere, parms.Split(','));
+        }
+
+
+        /// <summary>
+        /// 查询某个字段值是否存在
+        /// </summary>
+        /// <param name="fieldName"></param>
+        /// <param name="fieldValue"></param>
+        /// <returns></returns>
+        public static bool CheckExits(string fieldName, string fieldValue)
+        {
+            return Exists(fieldName + "=?", fieldValue);
+        }
+
+        public static bool CheckUser(string key)
+        {
+            string sql = "select count(0) from lc_user where userName='{0}' or mobile='{0}' or email='{0}'";
+            object result = DbConn.ExecuteScalar(string.Format(sql, key));
+            if (result != null && Convert.ToInt32(result) > 0)
+                return true;
+            return false;
+        }
+
+        public static SUser GetUserBySomeCondition(string user, string mail, string mobile)
+        {
+            user = user == "" ? "$$$" : user;
+            mobile = mobile == "" ? "$$$" : mobile;
+            mail = mail == "" ? "$$$" : mail;
+            return FindFirst(Expression.Sql(string.Format("UserName='{0}' or Mobile='{1}' or Email='{2}'", user, mobile, mail)));
+        }
+
+        /// <summary>
+        /// 找回密码
+        /// </summary>
+        /// <param name="user"></param>
+        /// <param name="email"></param>
+        /// <returns></returns>
+        public static SUser GetByUserMail(string user, string email)
+        {
+            //return Exists("Email=? and SecretSignal=?", email, secretSignal);
+            SUser SUser = FindFirst(Expression.And(Expression.Eq("Email", email), Expression.Eq("UserName", user)));
+            return SUser;
+        }
+
+        public static SUser GetByIdMail(int id, string email)
+        {
+            //return Exists("Email=? and SecretSignal=?", email, secretSignal);
+            SUser SUser = FindFirst(Expression.And(Expression.Eq("Email", email), Expression.Eq("ID", id)));
+            return SUser;
+        }
+
+        public static SUser GetByMail(string user)
+        {
+            //return Exists("Email=? and SecretSignal=?", email, secretSignal);
+            SUser SUser = FindFirst(Expression.Or(Expression.Eq("Email", user), Expression.Eq("Mobile", user)));
+            return SUser;
+        }
+
+        public static SUser GetUser(string user)
+        {
+            //return Exists("Email=? and SecretSignal=?", email, secretSignal);
+            SUser SUser = FindFirst(Expression.Or(Expression.Eq("Email", user), Expression.Eq("Mobile", user)));
+            return SUser;
+        }
+        /// <summary>
+        /// 查询cookie的票据是否符合
+        /// </summary>
+        /// <param name="userName"></param>
+        /// <param name="ticket"></param>
+        /// <returns></returns>
+        public static SUser GetUserByCookie(string userName, string ticket)
+        {
+            //FindFirst(Expression.And(Expression.Eq("UserName", userName), Expression.Eq("Ticket", ticket)));
+            SUser SUser = FindFirst(Expression.Sql(string.Format("(Mobile='{0}' or Email='{0}') and Ticket='{1}'", userName, ticket)));
+            return SUser;
+        }
+
+        /// <summary>
+        /// 查询用户名密码
+        /// </summary>
+        /// <param name="key"></param>
+        /// <param name="passWrod"></param>
+        /// <returns></returns>
+        public static SUser GetUserByPassWord(string key, string passWrod)
+        {
+            SUser SUser = FindFirst(Expression.Sql(string.Format("(Mobile='{0}' or Email='{0}') and PassWord='{1}'", key, passWrod)));
+            return SUser;
+        }
+
+        public static SUser GetUserByUserId(string UserId, string passWrod)
+        {
+            SUser SUser = FindFirst(Expression.Sql(string.Format("ID='{0}'and PassWord='{1}'", UserId, passWrod)));
+            return SUser;
+        }
+
+        public static SUser GetUserByUserId(string UserId)
+        {
+            SUser SUser = FindFirst(Expression.Sql(string.Format("ID='{0}'", UserId)));
+            return SUser;
+        }
+
+        public static SUser GetUserByMobile(string mobile)
+        {
+            SUser SUser = FindFirst(Expression.Sql(string.Format("Mobile='{0}'", mobile)));
+            return SUser;
+        }
+
+        public static void ResetPwd(string userIds)
+        {
+            string sql = "Update Lc_User set PassWord='4kTUiQQOdDM=' where ID in(" + userIds + ")";
+            DbConn.ExecuteNonQuery(sql);
+        }
+
+        /// <summary>
+        /// 验证手机
+        /// </summary>
+        /// <param name="userId"></param>
+        /// <param name="mobile"></param>
+        /// <param name="verifyCode"></param>
+        /// <returns></returns>
+        public static string VerifyMobile(int userId, string mobile, string verifyCode)
+        {
+            string errMsg = "";
+            SqlParameter[] sqlParameter ={
+                        new SqlParameter("@userId", SqlDbType.Int, 4),
+                        new SqlParameter("@mobile", SqlDbType.VarChar, 20),
+                        new SqlParameter("@verifyCode", SqlDbType.VarChar, 10),
+                        new SqlParameter("@errMsg",SqlDbType.VarChar,100)};
+            sqlParameter[0].Value = userId;
+            sqlParameter[1].Value = mobile;
+            sqlParameter[2].Value = verifyCode;
+            sqlParameter[3].Direction = ParameterDirection.Output;
+            DbConn.ExecuteScalar(CommandType.StoredProcedure, "sp_VerifyMobile", sqlParameter);
+            errMsg = sqlParameter[3].Value.ToString();
+            return errMsg;
+        }
+        /// <summary>
+        /// 发送短信验证
+        /// </summary>
+        /// <param name="userId"></param>
+        /// <param name="mobile"></param>
+        /// <param name="verifyCode"></param>
+        /// <returns></returns>
+        public static string SendSmsVerify(int userId, string mobile, string verifyCode)
+        {
+            string errMsg = "";
+            SqlParameter[] sqlParameter ={
+                        new SqlParameter("@userId", SqlDbType.Int, 4),
+                        new SqlParameter("@mobile", SqlDbType.VarChar, 20),
+                        new SqlParameter("@verifyCode", SqlDbType.VarChar, 10),
+                        new SqlParameter("@errMsg",SqlDbType.VarChar,100)};
+            sqlParameter[0].Value = userId;
+            sqlParameter[1].Value = mobile;
+            sqlParameter[2].Value = verifyCode;
+            sqlParameter[3].Direction = ParameterDirection.Output;
+            DbConn.ExecuteScalar(CommandType.StoredProcedure, "sp_SendSms", sqlParameter);
+            errMsg = sqlParameter[3].Value.ToString();
+            return errMsg;
+        }
+
+
+        /// <summary>
+        /// 用户登录
+        /// </summary>
+        /// <param name="key"></param>
+        /// <param name="passWrod"></param>
+        /// <returns></returns>
+        public static SUser UserLogin(string key, string passWrod, string ip, string ticket)
+        {
+            SUser SUser = GetUserByPassWord(key, passWrod);
+            //找不到
+            if (SUser == null) return null;
+            //更改用户登录状态
+            SUser.LoginIP = ip; //CommonHelper.ClientIP;
+            SUser.Update();
+            return SUser;
+        }
+
+    }
+}

+ 120 - 0
BizCom/Dao/SZcItem.cs

@@ -0,0 +1,120 @@
+using Castle.ActiveRecord;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("S_ZcItem")]
+    public class SZcItem : ComBase<SZcItem>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private int _userID = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int UserID
+        {
+            get { return _userID; }
+            set { _userID = value; }
+        }
+
+        private string _name = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Name
+        {
+            get { return _name; }
+            set { _name = value; }
+        }
+
+        private string _code = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Code
+        {
+            get { return _code; }
+            set { _code = value; }
+        }
+
+        private string _model = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Model
+        {
+            get { return _model; }
+            set { _model = value; }
+        }
+
+        private string _dept = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Dept
+        {
+            get { return _dept; }
+            set { _dept = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? GetTime { get; set; }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? LastTerm { get; set; }
+
+        private int _state = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int State
+        {
+            get { return _state; }
+            set { _state = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? AddTime { get; set; }
+
+
+        private double _amount = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public double Amount
+        {
+            get { return _amount; }
+            set { _amount = value; }
+        }
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from S_ZcItem where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 119 - 0
BizCom/Dao/S_BuChaJia.cs

@@ -0,0 +1,119 @@
+using System;
+using Castle.ActiveRecord;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("S_BuChaJia")]
+    public class S_BuChaJia : ComBase<S_BuChaJia>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _ctid="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ctid
+        {
+             get{ return _ctid; }
+             set{ _ctid=value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? addtime { get; set; }
+
+        private string _dotype="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string dotype
+        {
+             get{ return _dotype; }
+             set{ _dotype=value; }
+        }
+
+        private int _userId=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int userId
+        {
+             get{ return _userId; }
+             set{ _userId=value; }
+        }
+
+        private int _refundState=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int refundState
+        {
+             get{ return _refundState; }
+             set{ _refundState=value; }
+        }
+
+        private int _orderState=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int orderState
+        {
+             get{ return _orderState; }
+             set{ _orderState=value; }
+        }
+
+        private string _posCode="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string posCode
+        {
+             get{ return _posCode; }
+             set{ _posCode=value; }
+        }
+
+        private string _comCode="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string comCode
+        {
+             get{ return _comCode; }
+             set{ _comCode=value; }
+        }
+
+        private string _outSid="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string outSid
+        {
+             get{ return _outSid; }
+             set{ _outSid=value; }
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from S_BuChaJia where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 58 - 0
BizCom/Dao/S_CdrToPng.cs

@@ -0,0 +1,58 @@
+using System;
+using Castle.ActiveRecord;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("S_CdrToPng")]
+    public class S_CdrToPng : ComBase<S_CdrToPng>
+    {
+
+        private int _iD=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int ID
+        {
+             get{ return _iD; }
+             set{ _iD=value; }
+        }
+
+        private string _name="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Name
+        {
+             get{ return _name; }
+             set{ _name=value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? AddTime { get; set; }
+
+        private int _state=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int State
+        {
+             get{ return _state; }
+             set{ _state=value; }
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from S_CdrToPng where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 168 - 0
BizCom/Dao/S_ErpModular.cs

@@ -0,0 +1,168 @@
+using System;
+using Castle.ActiveRecord;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("S_ErpModular")]
+    public class S_ErpModular : ComBase<S_ErpModular>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private int _parentID=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int ParentID
+        {
+             get{ return _parentID; }
+             set{ _parentID=value; }
+        }
+
+        private string _name="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Name
+        {
+             get{ return _name; }
+             set{ _name=value; }
+        }
+
+        private string _code="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Code
+        {
+             get{ return _code; }
+             set{ _code=value; }
+        }
+
+        private int _sort=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int Sort
+        {
+             get{ return _sort; }
+             set{ _sort=value; }
+        }
+
+        private string _path="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Path
+        {
+             get{ return _path; }
+             set{ _path=value; }
+        }
+
+        private bool _isDel=false;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public bool IsDel
+        {
+             get{ return _isDel; }
+             set{ _isDel=value; }
+        }
+
+        private string _memo="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Memo
+        {
+             get{ return _memo; }
+             set{ _memo=value; }
+        }
+
+        private int _state=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int State
+        {
+             get{ return _state; }
+             set{ _state=value; }
+        }
+
+        private int _mType=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int mType
+        {
+             get{ return _mType; }
+             set{ _mType=value; }
+        }
+
+        private string _url="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Url
+        {
+             get{ return _url; }
+             set{ _url=value; }
+        }
+
+        private string _tag="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Tag
+        {
+             get{ return _tag; }
+             set{ _tag=value; }
+        }
+
+        private bool _isOperate=false;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public bool isOperate
+        {
+             get{ return _isOperate; }
+             set{ _isOperate=value; }
+        }
+
+        private string _icon="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Icon
+        {
+             get{ return _icon; }
+             set{ _icon=value; }
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from S_ErpModular where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 97 - 0
BizCom/Dao/S_RefundTmc.cs

@@ -0,0 +1,97 @@
+using System;
+using Castle.ActiveRecord;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("S_RefundTmc")]
+    public class S_RefundTmc : ComBase<S_RefundTmc>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _topic="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Topic
+        {
+             get{ return _topic; }
+             set{ _topic=value; }
+        }
+
+        private string _urlparm="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string urlparm
+        {
+             get{ return _urlparm; }
+             set{ _urlparm=value; }
+        }
+
+        private string _message="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string message
+        {
+             get{ return _message; }
+             set{ _message=value; }
+        }
+
+        private string _con="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string con
+        {
+             get{ return _con; }
+             set{ _con=value; }
+        }
+
+        private string _userId="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string userId
+        {
+             get{ return _userId; }
+             set{ _userId=value; }
+        }
+
+        private string _userNick="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string userNick
+        {
+             get{ return _userNick; }
+             set{ _userNick=value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? AddTime { get; set; }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from S_RefundTmc where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 97 - 0
BizCom/Dao/S_TaoBaoTmc2.cs

@@ -0,0 +1,97 @@
+using System;
+using Castle.ActiveRecord;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("S_TaoBaoTmc2")]
+    public class S_TaoBaoTmc2 : ComBase<S_TaoBaoTmc2>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _topic="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Topic
+        {
+             get{ return _topic; }
+             set{ _topic=value; }
+        }
+
+        private string _urlparm="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string urlparm
+        {
+             get{ return _urlparm; }
+             set{ _urlparm=value; }
+        }
+
+        private string _message="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string message
+        {
+             get{ return _message; }
+             set{ _message=value; }
+        }
+
+        private string _con="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string con
+        {
+             get{ return _con; }
+             set{ _con=value; }
+        }
+
+        private string _userId="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string userId
+        {
+             get{ return _userId; }
+             set{ _userId=value; }
+        }
+
+        private string _userNick="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string userNick
+        {
+             get{ return _userNick; }
+             set{ _userNick=value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? AddTime { get; set; }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from S_TaoBaoTmc2 where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 97 - 0
BizCom/Dao/S_TaoBaoTmc3.cs

@@ -0,0 +1,97 @@
+using System;
+using Castle.ActiveRecord;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("S_TaoBaoTmc3")]
+    public class S_TaoBaoTmc3 : ComBase<S_TaoBaoTmc3>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _topic="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Topic
+        {
+             get{ return _topic; }
+             set{ _topic=value; }
+        }
+
+        private string _urlparm="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string urlparm
+        {
+             get{ return _urlparm; }
+             set{ _urlparm=value; }
+        }
+
+        private string _message="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string message
+        {
+             get{ return _message; }
+             set{ _message=value; }
+        }
+
+        private string _con="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string con
+        {
+             get{ return _con; }
+             set{ _con=value; }
+        }
+
+        private string _userId="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string userId
+        {
+             get{ return _userId; }
+             set{ _userId=value; }
+        }
+
+        private string _userNick="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string userNick
+        {
+             get{ return _userNick; }
+             set{ _userNick=value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? AddTime { get; set; }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from S_TaoBaoTmc3 where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 96 - 0
BizCom/Dao/Sheet1$.cs

@@ -0,0 +1,96 @@
+using System;
+using Castle.ActiveRecord;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("Sheet1$")]
+    public class Sheet1$ : ComBase<Sheet1$>
+    {
+
+        private string _order_no="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string order_no
+        {
+             get{ return _order_no; }
+             set{ _order_no=value; }
+        }
+
+        private double _price=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public double price
+        {
+             get{ return _price; }
+             set{ _price=value; }
+        }
+
+        private string _pay_time="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string pay_time
+        {
+             get{ return _pay_time; }
+             set{ _pay_time=value; }
+        }
+
+        private string _company_name="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string company_name
+        {
+             get{ return _company_name; }
+             set{ _company_name=value; }
+        }
+
+        private string _customer_name="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string customer_name
+        {
+             get{ return _customer_name; }
+             set{ _customer_name=value; }
+        }
+
+        private string _f6="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string F6
+        {
+             get{ return _f6; }
+             set{ _f6=value; }
+        }
+
+        private string _f7="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string F7
+        {
+             get{ return _f7; }
+             set{ _f7=value; }
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from Sheet1$ where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 118 - 0
BizCom/Dao/Sheet2$.cs

@@ -0,0 +1,118 @@
+using System;
+using Castle.ActiveRecord;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("Sheet2$")]
+    public class Sheet2$ : ComBase<Sheet2$>
+    {
+
+        private string _order_no="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string order_no
+        {
+             get{ return _order_no; }
+             set{ _order_no=value; }
+        }
+
+        private double _price=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public double price
+        {
+             get{ return _price; }
+             set{ _price=value; }
+        }
+
+        private string _pay_time="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string pay_time
+        {
+             get{ return _pay_time; }
+             set{ _pay_time=value; }
+        }
+
+        private string _supplier_name="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string supplier_name
+        {
+             get{ return _supplier_name; }
+             set{ _supplier_name=value; }
+        }
+
+        private string _company_name="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string company_name
+        {
+             get{ return _company_name; }
+             set{ _company_name=value; }
+        }
+
+        private string _customer_name="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string customer_name
+        {
+             get{ return _customer_name; }
+             set{ _customer_name=value; }
+        }
+
+        private string _user_designer_name="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string user_designer_name
+        {
+             get{ return _user_designer_name; }
+             set{ _user_designer_name=value; }
+        }
+
+        private string _user_waiter_name="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string user_waiter_name
+        {
+             get{ return _user_waiter_name; }
+             set{ _user_waiter_name=value; }
+        }
+
+        private string _remark="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string remark
+        {
+             get{ return _remark; }
+             set{ _remark=value; }
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from Sheet2$ where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 30 - 0
BizCom/Dao/Sheet3$.cs

@@ -0,0 +1,30 @@
+using System;
+using Castle.ActiveRecord;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("Sheet3$")]
+    public class Sheet3$ : ComBase<Sheet3$>
+    {
+
+        private string _tid="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string tid
+        {
+             get{ return _tid; }
+             set{ _tid=value; }
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from Sheet3$ where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 168 - 0
BizCom/Dao/SiteInfo.cs

@@ -0,0 +1,168 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("SiteInfo")]
+    public class SiteInfo : ComBase<SiteInfo>
+    {
+
+        private string _id = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Assigned)]
+        public string id
+        {
+            get { return _id; }
+            set { _id = value; }
+        }
+
+        private string _site_title = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string site_title
+        {
+            get { return _site_title; }
+            set { _site_title = value; }
+        }
+
+        private string _web_domain = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string web_domain
+        {
+            get { return _web_domain; }
+            set { _web_domain = value; }
+        }
+
+        private int _open_ip_white_list = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int open_ip_white_list
+        {
+            get { return _open_ip_white_list; }
+            set { _open_ip_white_list = value; }
+        }
+
+        private string _ip_white_list = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ip_white_list
+        {
+            get { return _ip_white_list; }
+            set { _ip_white_list = value; }
+        }
+
+        private string _remark = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string remark
+        {
+            get { return _remark; }
+            set { _remark = value; }
+        }
+
+
+        public void Update(bool isOpenIpWiteList, string ipWiteList, string remark)
+        {
+            SiteInfo siteInfo = new SiteInfo();
+            siteInfo.id = "1";
+            siteInfo.open_ip_white_list = isOpenIpWiteList ? 1 : 0;
+            siteInfo.ip_white_list = ipWiteList;
+            siteInfo.remark = remark;
+            _ipWhiteList = null;
+            Update(siteInfo);
+        }
+
+        public SiteInfo[] GetSiteInfos()
+        {
+            return FindAll(Expression.Eq("open_ip_white_list", 1));
+        }
+
+        public SiteInfo GetSiteInfoById(string id)
+        {
+            return FindFirst(Expression.Eq("id", id));
+        }
+
+        public override void Update()
+        {
+            base.Update();
+            _ipWhiteList = null;
+        }
+
+        private static string[] _ipWhiteList = null;
+
+        private static string[] getIpWhiteList()
+        {
+            if (_ipWhiteList != null)
+            {
+                return _ipWhiteList;
+            }
+
+            SiteInfo[] siteInfo = new SiteInfo().GetSiteInfos();
+            for (int i = 0; i < siteInfo.Length; i++)
+            {
+                string ipWiteList = siteInfo[i].ip_white_list.Replace("\r\n", ",").Replace("\n", ",").Replace(" ", ",");
+                _ipWhiteList = ipWiteList.Split(',');
+            }
+            return _ipWhiteList;
+        }
+
+        public static bool isPassIp(string ip)
+        {
+            if (string.IsNullOrWhiteSpace(ip))
+                return false;
+
+            if (ip.IndexOf("192.168.") != -1 || "127.0.0.1" == ip || "0:0:0:0:0:0:0:1" == ip)
+                return true;
+
+            //�ж��Ƿ��ڰ�������
+            string[] ipNumList = ip.Split('.');
+            string newIp = "";
+            if (ipNumList.Length >= 2)
+            {
+                newIp = ipNumList[0] + "." + ipNumList[1] + ".*.*";
+            }
+            SiteInfo info = GetSiteInfoByIp(newIp);
+            if (info != null) return true;
+            //if (getIpWhiteList().Length == 0)
+            //    return true;
+
+            //foreach (string matche in getIpWhiteList())
+            //{
+            //    Match result = Regex.Match(ip, matche);
+            //    if (result.Length > 0)
+            //    {
+            //        return true;
+            //    }
+            //}
+
+            return false;
+        }
+
+        public static SiteInfo GetSiteInfoByIp(string ip)
+        {
+            return FindFirst(Expression.Sql(string.Format("ip_white_list like '%{0}%'", ip)));
+        }
+
+        public static void DelById(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from SiteInfo where id='" + id + "'");
+            ExecuteNonQuery(sql.ToString());
+        }
+
+    }
+}

+ 75 - 0
BizCom/Dao/SupplierLog.cs

@@ -0,0 +1,75 @@
+using Castle.ActiveRecord;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("SupplierLog")]
+    public class SupplierLog : ComBase<SupplierLog>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private int _userID = 0;
+        /// <summary>
+        ///用户id
+        /// </summary>
+        [Property]
+        public int UserID
+        {
+            get { return _userID; }
+            set { _userID = value; }
+        }
+
+        private string _userName = "";
+        /// <summary>
+        ///用户名称
+        /// </summary>
+        [Property]
+        public string UserName
+        {
+            get { return _userName; }
+            set { _userName = value; }
+        }
+
+        private string _oldContent = "";
+        /// <summary>
+        ///修改前内容
+        /// </summary>
+        [Property]
+        public string OldContent
+        {
+            get { return _oldContent; }
+            set { _oldContent = value; }
+        }
+
+        private string _newContent = "";
+        /// <summary>
+        ///修改后内容
+        /// </summary>
+        [Property]
+        public string NewContent
+        {
+            get { return _newContent; }
+            set { _newContent = value; }
+        }
+
+        /// <summary>
+        ///修改时间
+        /// </summary>
+        [Property]
+        public DateTime? ModifyTime { get; set; }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from SupplierLog where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 27 - 0
BizCom/Dao/UserObj.cs

@@ -0,0 +1,27 @@
+namespace BizCom
+{
+    public class UserObj
+    {
+        public string openid { get; set; }
+        public string session_key { get; set; }
+        public string session_id { get; set; }
+        public int userid { get; set; }
+        public string username { get; set; }
+        public string realname { get; set; }
+        public string cname { get; set; }
+        public int expertid { get; set; }
+        public int siteid { get; set; }
+        public int cid { get; set; }
+        public string enname { get; set; }
+        public string corpids { get; set; }
+        public int corpid { get; set; }
+        public int utype { get; set; }
+        /// <summary>
+        /// 权限编号
+        /// </summary>
+        public string pcode { get; set; }
+        public string user_key { get; set; }
+        public bool isleader { get; set; }
+        //public string realname { get; set; }
+    }
+}

+ 108 - 0
BizCom/Dao/XLog.cs

@@ -0,0 +1,108 @@
+using Castle.ActiveRecord;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("X_Log")]
+    public class XLog : ComBase<XLog>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private int _userID = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int UserID
+        {
+            get { return _userID; }
+            set { _userID = value; }
+        }
+
+        private string _url = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Url
+        {
+            get { return _url; }
+            set { _url = value; }
+        }
+
+        private string _ipAddress = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string IpAddress
+        {
+            get { return _ipAddress; }
+            set { _ipAddress = value; }
+        }
+
+        private string _msg = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Msg
+        {
+            get { return _msg; }
+            set { _msg = value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? AddTime { get; set; }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from X_Log where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+
+
+        public static void SaveLog(int userID, string message)
+        {
+            try
+            {
+                XLog log = new XLog();
+                log.UserID = userID;
+                log.Msg = message;
+                log.AddTime = DateTime.Now;
+                log.Create();
+            }
+            catch (Exception ex)
+            {
+                string k = ex.Message;
+            }
+        }
+
+        public static void SaveLog(int userID, string message, Exception ex1)
+        {
+            try
+            {
+                XLog log = new XLog();
+                log.UserID = userID;
+                log.Msg = message + "|||" + ex1.Message;
+                log.AddTime = DateTime.Now;
+                log.Create();
+            }
+            catch
+            {
+
+            }
+        }
+    }
+}

+ 111 - 0
BizCom/Dao/XModular.cs

@@ -0,0 +1,111 @@
+using Castle.ActiveRecord;
+using System.Data;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("X_Modular")]
+    public class XModular : DicSysBase
+    {
+
+        public XModular()
+        {
+            rootName = "系统模块";
+            titleName = "系统模块根结点";
+            tableName = "X_Modular";
+        }
+
+        [Property]
+        public new string Url
+        {
+            get { return _url; }
+            set { _url = value; }
+        }
+
+        [Property]
+        public new string Tag
+        {
+            get { return _tag; }
+            set { _tag = value; }
+        }
+
+        /// <summary>
+        ///是否操作
+        /// </summary>
+        [Property]
+        public new bool isOperate
+        {
+            get { return _isOperate; }
+            set { _isOperate = value; }
+        }
+
+        /// <summary>
+        ///图标
+        /// </summary>
+        [Property]
+        public new string Icon
+        {
+            get { return _icon; }
+            set { _icon = value; }
+        }
+
+        public static DataTable GetModular()
+        {
+            return DbConn.ExecuteDataset("select * from X_Modular where isdel=0 order by sort asc").Tables[0];
+        }
+
+        public static DataTable GetOrgModular(string oId)
+        {
+            string sql = "select * from X_Modular where ID in( select ModularID from ce_erppermission where orgid=" + oId + " and postID=0) and isDel=0 order by sort asc";
+            return DbConn.ExecuteDataset(sql).Tables[0];
+        }
+
+        public static DataTable GetModularNoOperate()
+        {
+            string sql = "select * from X_Modular where isdel=0 and isoperate=0 order by path asc, sort asc";
+            return DbConn.ExecuteDataset(sql).Tables[0];
+        }
+
+        //public static void TransModular(object id,object pId,int sort)
+        //{
+        //    StringBuilder sql=new StringBuilder();
+        //    sql.AppendFormat("declare @oldid int;");
+        //    sql.AppendFormat("select @oldid=parentid from X_Modular where id={0} ;",id);
+        //    sql.AppendFormat("update X_Modular set path=REPLACE(Path,@oldid,'{0}') where path like  '%|'+(select Convert(varchar,id) from X_Modular where ID={1})+'%|' or ID={1} ;", pId, id);
+        //    sql.AppendFormat("update X_Modular set parentid={0},sort={1} where id={2} ;", pId,sort,id);
+        //    TransExecuteNonQuery(sql.ToString());
+        //}
+
+
+
+        //获取角色模块
+        public static DataTable GetResourceByRoleID(int roleId)
+        {
+            string sql = "select * from X_Modular where Code in(select ResCode from LC_SysRoleToResource where RoleID={0}) and IsDel=0 order by parentid,ordernum ";
+            return DbConn.ExecuteDataset(string.Format(sql, roleId)).Tables[0];
+        }
+
+
+        public static void BuilderOperate(string mId)
+        {
+            StringBuilder sql = new StringBuilder();
+            DataTable dt = DbConn.ExecuteDataset("select * from X_Modular where id=" + mId).Tables[0];
+            if (dt == null || dt.Rows.Count < 1) return;
+            DataRow dr = dt.Rows[0];
+            string tag = dr["Tag"].ToString();
+            string path = dr["Path"] + mId + "|";
+            sql.AppendFormat("insert into X_Modular(parentid,name,tag,path,sort,isoperate) Values({0},'{1}','{2}','{3}',{4},1) ;",
+                mId, "查看", tag + "_view", path, 0);
+            sql.AppendFormat("insert into X_Modular(parentid,name,tag,path,sort,isoperate) Values({0},'{1}','{2}','{3}',{4},1) ;",
+                mId, "添加", tag + "_add", path, 1);
+            sql.AppendFormat("insert into X_Modular(parentid,name,tag,path,sort,isoperate) Values({0},'{1}','{2}','{3}',{4},1) ;",
+                mId, "修改", tag + "_edit", path, 2);
+            sql.AppendFormat("insert into X_Modular(parentid,name,tag,path,sort,isoperate) Values({0},'{1}','{2}','{3}',{4},1) ;",
+                mId, "删除", tag + "_del", path, 3);
+
+            TransExecuteNonQuery(sql.ToString());
+
+        }
+    }
+}
+

+ 98 - 0
BizCom/Dao/XPermission.cs

@@ -0,0 +1,98 @@
+using Castle.ActiveRecord;
+using System;
+using System.Data;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("X_Permission")]
+    public class XPermission : ComBase<XPermission>
+    {
+
+        /// <summary>
+        /// ÄÚ²¿±àºÅ
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private int _orgID = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int OrgID
+        {
+            get { return _orgID; }
+            set { _orgID = value; }
+        }
+
+        private int _userID = 0;
+        /// <summary>
+        ///×éÖ¯±àºÅ
+        /// </summary>
+        [Property]
+        public int UserID
+        {
+            get { return _userID; }
+            set { _userID = value; }
+        }
+
+        private int _modularID = 0;
+        /// <summary>
+        ///Ä£¿é±àºÅ
+        /// </summary>
+        [Property]
+        public int ModularID
+        {
+            get { return _modularID; }
+            set { _modularID = value; }
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from X_Permission where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        //public static DataTable GetPermission(int personId, string postId)
+        //{
+        //    string sql;
+        //    if (personId > 0) sql = string.Format("select ModularID as ID,Name,Tag,Url,Icon,ParentID,IsOperate from view_erppermission where PostID={0} and isDel=0 order by sort asc ", postId);
+        //    else sql = "select ID,Name,Tag,Url,Icon,ParentID,IsOperate from ce_erpmodular where isdel=0 order by sort asc ";
+        //    return ExecuteDataset(sql).Tables[0];
+        //}
+
+        public static DataTable GetPermission(string uid)
+        {
+            string sql = string.Format("select ModularID as ID,Name,Tag,Url,Icon,ParentID,IsOperate from view_permission where UserID={0} and isDel=0 order by sort asc ", uid);
+            return ExecuteDataset(sql).Tables[0];
+        }
+
+        public static void SavePermission(string uId, string oId, string v)
+        {
+            StringBuilder sqlList = new StringBuilder();
+            sqlList.AppendFormat("delete from X_Permission where OrgID={0} and UserID={1} ;", oId, uId);
+
+            if (v.Length > 0)
+            {
+                //Ä£¿éÖµ
+                string[] sArr = v.Split(',');
+                foreach (string arr in sArr)
+                {
+                    sqlList.AppendFormat("insert into X_Permission(OrgID,UserID,ModularID) Values({0},{1},{2}); ", oId, uId, arr);
+                }
+            }
+            try
+            {
+                DbConn.ExecuteNonQuery(sqlList.ToString());
+            }
+            catch (Exception)
+            {
+                throw;
+            }
+        }
+
+    }
+}

+ 181 - 0
BizCom/Dao/XUser.cs

@@ -0,0 +1,181 @@
+using Castle.ActiveRecord;
+using NHibernate.Criterion;
+using System;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("X_User")]
+    public class XUser : ComBase<XUser>
+    {
+
+        /// <summary>
+        /// 内部编号
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private int _roleID = 0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int RoleID
+        {
+            get { return _roleID; }
+            set { _roleID = value; }
+        }
+
+        private string _account = "";
+        /// <summary>
+        ///账号
+        /// </summary>
+        [Property]
+        public string Account
+        {
+            get { return _account; }
+            set { _account = value; }
+        }
+
+        private string _passWord = "";
+        /// <summary>
+        ///密码
+        /// </summary>
+        [Property]
+        public string PassWord
+        {
+            get { return _passWord; }
+            set { _passWord = value; }
+        }
+
+        /// <summary>
+        ///创建时间
+        /// </summary>
+        [Property]
+        public DateTime? CreateTime { get; set; }
+
+        /// <summary>
+        ///上一次登陆时间
+        /// </summary>
+        [Property]
+        public DateTime? PreLoginTime { get; set; }
+
+        /// <summary>
+        ///最后一次登录时间
+        /// </summary>
+        [Property]
+        public DateTime? CurLoginTime { get; set; }
+
+        private string _loginIP = "";
+        /// <summary>
+        ///登录IP
+        /// </summary>
+        [Property]
+        public string LoginIP
+        {
+            get { return _loginIP; }
+            set { _loginIP = value; }
+        }
+
+        private string _ticket = "";
+        /// <summary>
+        ///登录票根
+        /// </summary>
+        [Property]
+        public string Ticket
+        {
+            get { return _ticket; }
+            set { _ticket = value; }
+        }
+
+        private int _state = 0;
+        /// <summary>
+        ///当前状态
+        /// </summary>
+        [Property]
+        public int State
+        {
+            get { return _state; }
+            set { _state = value; }
+        }
+
+        private string _station = "";
+        /// <summary>
+        ///站点
+        /// </summary>
+        [Property]
+        public string Station
+        {
+            get { return _station; }
+            set { _station = value; }
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from X_User where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+
+        public static XUser Get(int uId, string pwd)
+        {
+            Castle.ActiveRecord.Queries.SimpleQuery query = new Castle.ActiveRecord.Queries.SimpleQuery(typeof(XUser), @"from XUser user where user.ID = ? and user.PassWord = ?", uId, pwd);
+            XUser[] users = (XUser[])ExecuteQuery(query);
+            if (users.Length > 0) return users[0];
+            return null;
+            //return FindFirst(Expression.Sql(string.Format("ID={0} and Password='{1}'", uId, pwd)));
+        }
+
+        /// <summary>
+        /// 查询cookie的票据是否符合
+        /// </summary>
+        /// <param name="userName"></param>
+        /// <param name="ticket"></param>
+        /// <returns></returns>
+        public static XUser GetUserByCookie(string account, string ticket)
+        {
+            XUser lcUser = FindFirst(Expression.Sql(string.Format("Account='{0}' and Ticket='{1}'", account, ticket)));
+            //FindFirst(Expression.And(Expression.Eq("Account", account), Expression.Eq("Ticket", ticket)));
+            return lcUser;
+        }
+
+        public static XUser GetByLogin(string account, string pwd)
+        {
+            return FindFirst(Expression.Sql(string.Format("Account='{0}' and Password='{1}' ", account, pwd)));
+        }
+
+        public static void ResetPwd(int id, string pwd)
+        {
+            string sql = "update x_user set password='" + pwd + "' where id=" + id;
+            ExecuteNonQuery(sql);
+        }
+
+        public static void ResetPersonPwd(int pId, string pwd)
+        {
+            string sql = "update x_user set password='" + pwd + "' where personid=" + pId;
+            ExecuteNonQuery(sql);
+        }
+
+        public static int RealDel(int id, int pId)
+        {
+            StringBuilder str = new StringBuilder();
+            str.AppendFormat("delete from x_user where id={0} and personId={1} ;", id, pId);
+            return ExecuteNonQuery(str.ToString());
+        }
+
+        public static int OpenAccount(int id, int pId)
+        {
+            StringBuilder str = new StringBuilder();
+            str.AppendFormat("update x_user set state=0 where ID={0} and PersonID={1};", id, pId);
+            return ExecuteNonQuery(str.ToString());
+        }
+
+        public static int FreezeAccount(int id, int pId)
+        {
+            StringBuilder str = new StringBuilder();
+            str.AppendFormat("update x_user set state=1 where id={0} and PersonID={1} ;", id, pId);
+            return ExecuteNonQuery(str.ToString());
+        }
+    }
+}

+ 75 - 0
BizCom/Dao/X_Log.cs

@@ -0,0 +1,75 @@
+using System;
+using Castle.ActiveRecord;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("X_Log")]
+    public class X_Log : ComBase<X_Log>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private int _userID=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int UserID
+        {
+             get{ return _userID; }
+             set{ _userID=value; }
+        }
+
+        private string _url="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Url
+        {
+             get{ return _url; }
+             set{ _url=value; }
+        }
+
+        private string _ipAddress="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string IpAddress
+        {
+             get{ return _ipAddress; }
+             set{ _ipAddress=value; }
+        }
+
+        private string _msg="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Msg
+        {
+             get{ return _msg; }
+             set{ _msg=value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? AddTime { get; set; }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from X_Log where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 53 - 0
BizCom/Dao/X_Log_Dispatch.cs

@@ -0,0 +1,53 @@
+using System;
+using Castle.ActiveRecord;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("X_Log_Dispatch")]
+    public class X_Log_Dispatch : ComBase<X_Log_Dispatch>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _ctid="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ctid
+        {
+             get{ return _ctid; }
+             set{ _ctid=value; }
+        }
+
+        private string _did="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string did
+        {
+             get{ return _did; }
+             set{ _did=value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? dtime { get; set; }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from X_Log_Dispatch where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 120 - 0
BizCom/Dao/X_User.cs

@@ -0,0 +1,120 @@
+using System;
+using Castle.ActiveRecord;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("X_User")]
+    public class X_User : ComBase<X_User>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private int _roleID=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int RoleID
+        {
+             get{ return _roleID; }
+             set{ _roleID=value; }
+        }
+
+        private string _account="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Account
+        {
+             get{ return _account; }
+             set{ _account=value; }
+        }
+
+        private string _passWord="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string PassWord
+        {
+             get{ return _passWord; }
+             set{ _passWord=value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? CreateTime { get; set; }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? PreLoginTime { get; set; }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? CurLoginTime { get; set; }
+
+        private string _loginIP="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string LoginIP
+        {
+             get{ return _loginIP; }
+             set{ _loginIP=value; }
+        }
+
+        private string _ticket="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Ticket
+        {
+             get{ return _ticket; }
+             set{ _ticket=value; }
+        }
+
+        private int _state=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int State
+        {
+             get{ return _state; }
+             set{ _state=value; }
+        }
+
+        private string _station="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Station
+        {
+             get{ return _station; }
+             set{ _station=value; }
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from X_User where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 829 - 0
BizCom/Dao/test.cs

@@ -0,0 +1,829 @@
+using System;
+using Castle.ActiveRecord;
+using System.Text;
+
+namespace BizCom
+{
+    [ActiveRecord("test")]
+    public class test : ComBase<test>
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _ctid="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ctid
+        {
+             get{ return _ctid; }
+             set{ _ctid=value; }
+        }
+
+        private string _tid="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string tid
+        {
+             get{ return _tid; }
+             set{ _tid=value; }
+        }
+
+        private int _designUserId=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int DesignUserId
+        {
+             get{ return _designUserId; }
+             set{ _designUserId=value; }
+        }
+
+        private int _orderState=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int OrderState
+        {
+             get{ return _orderState; }
+             set{ _orderState=value; }
+        }
+
+        private int _customerUserId=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int CustomerUserId
+        {
+             get{ return _customerUserId; }
+             set{ _customerUserId=value; }
+        }
+
+        private bool _isUrgency=false;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public bool IsUrgency
+        {
+             get{ return _isUrgency; }
+             set{ _isUrgency=value; }
+        }
+
+        private int _isRefund=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int IsRefund
+        {
+             get{ return _isRefund; }
+             set{ _isRefund=value; }
+        }
+
+        private int _isReturn=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int IsReturn
+        {
+             get{ return _isReturn; }
+             set{ _isReturn=value; }
+        }
+
+        private int _isNeedBill=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int IsNeedBill
+        {
+             get{ return _isNeedBill; }
+             set{ _isNeedBill=value; }
+        }
+
+        private int _supplierId=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int SupplierId
+        {
+             get{ return _supplierId; }
+             set{ _supplierId=value; }
+        }
+
+        private string _deliveryAddress="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string DeliveryAddress
+        {
+             get{ return _deliveryAddress; }
+             set{ _deliveryAddress=value; }
+        }
+
+        private int _callTimes=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int CallTimes
+        {
+             get{ return _callTimes; }
+             set{ _callTimes=value; }
+        }
+
+        private int _noteTimes=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int NoteTimes
+        {
+             get{ return _noteTimes; }
+             set{ _noteTimes=value; }
+        }
+
+        private int _overtimeUserId=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int OvertimeUserId
+        {
+             get{ return _overtimeUserId; }
+             set{ _overtimeUserId=value; }
+        }
+
+        private int _unusualTag=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int UnusualTag
+        {
+             get{ return _unusualTag; }
+             set{ _unusualTag=value; }
+        }
+
+        private string _unusualCon="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string UnusualCon
+        {
+             get{ return _unusualCon; }
+             set{ _unusualCon=value; }
+        }
+
+        private string _returnReason="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ReturnReason
+        {
+             get{ return _returnReason; }
+             set{ _returnReason=value; }
+        }
+
+        private int _memoOpt=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int MemoOpt
+        {
+             get{ return _memoOpt; }
+             set{ _memoOpt=value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? AfterSaleTime { get; set; }
+
+        private int _afterSaleUserId=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int AfterSaleUserId
+        {
+             get{ return _afterSaleUserId; }
+             set{ _afterSaleUserId=value; }
+        }
+
+        private string _afterSaleReason="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string AfterSaleReason
+        {
+             get{ return _afterSaleReason; }
+             set{ _afterSaleReason=value; }
+        }
+
+        private int _placeUserId=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int PlaceUserId
+        {
+             get{ return _placeUserId; }
+             set{ _placeUserId=value; }
+        }
+
+        private int _afterSaleState=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int AfterSaleState
+        {
+             get{ return _afterSaleState; }
+             set{ _afterSaleState=value; }
+        }
+
+        private string _afterSaleMethod="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string AfterSaleMethod
+        {
+             get{ return _afterSaleMethod; }
+             set{ _afterSaleMethod=value; }
+        }
+
+        private string _afterSaleMemo="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string AfterSaleMemo
+        {
+             get{ return _afterSaleMemo; }
+             set{ _afterSaleMemo=value; }
+        }
+
+        private string _afterSaleResponsible="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string AfterSaleResponsible
+        {
+             get{ return _afterSaleResponsible; }
+             set{ _afterSaleResponsible=value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? AfterSalePreTime { get; set; }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? FinishAfterSaleTime { get; set; }
+
+        private string _deductFee="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string DeductFee
+        {
+             get{ return _deductFee; }
+             set{ _deductFee=value; }
+        }
+
+        private string _refundFee="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string RefundFee
+        {
+             get{ return _refundFee; }
+             set{ _refundFee=value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? HandleTime { get; set; }
+
+        private int _isHaveNewOrder=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int IsHaveNewOrder
+        {
+             get{ return _isHaveNewOrder; }
+             set{ _isHaveNewOrder=value; }
+        }
+
+        private string _responsibleUserId="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ResponsibleUserId
+        {
+             get{ return _responsibleUserId; }
+             set{ _responsibleUserId=value; }
+        }
+
+        private string _ptid="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ptid
+        {
+             get{ return _ptid; }
+             set{ _ptid=value; }
+        }
+
+        private int _isPreDelivery=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int IsPreDelivery
+        {
+             get{ return _isPreDelivery; }
+             set{ _isPreDelivery=value; }
+        }
+
+        private int _isSample=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int IsSample
+        {
+             get{ return _isSample; }
+             set{ _isSample=value; }
+        }
+
+        private string _seller_memo="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string seller_memo
+        {
+             get{ return _seller_memo; }
+             set{ _seller_memo=value; }
+        }
+
+        private int _productId=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int ProductId
+        {
+             get{ return _productId; }
+             set{ _productId=value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? WaitDesignTime { get; set; }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? StartDesignTime { get; set; }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? FinishDesignTime { get; set; }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? FinishPlaceTime { get; set; }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? FinishDeliveryTime { get; set; }
+
+        private string _designSelfMemo="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string DesignSelfMemo
+        {
+             get{ return _designSelfMemo; }
+             set{ _designSelfMemo=value; }
+        }
+
+        private string _designPrice="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string DesignPrice
+        {
+             get{ return _designPrice; }
+             set{ _designPrice=value; }
+        }
+
+        private string _material="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Material
+        {
+             get{ return _material; }
+             set{ _material=value; }
+        }
+
+        private string _craft="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string Craft
+        {
+             get{ return _craft; }
+             set{ _craft=value; }
+        }
+
+        private string _productSize="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ProductSize
+        {
+             get{ return _productSize; }
+             set{ _productSize=value; }
+        }
+
+        private string _productCount="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ProductCount
+        {
+             get{ return _productCount; }
+             set{ _productCount=value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? UnusualTime { get; set; }
+
+        private bool _isAutoDispatch=false;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public bool IsAutoDispatch
+        {
+             get{ return _isAutoDispatch; }
+             set{ _isAutoDispatch=value; }
+        }
+
+        private bool _isVerifyToSupplier=false;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public bool IsVerifyToSupplier
+        {
+             get{ return _isVerifyToSupplier; }
+             set{ _isVerifyToSupplier=value; }
+        }
+
+        private string _customerMemo="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string CustomerMemo
+        {
+             get{ return _customerMemo; }
+             set{ _customerMemo=value; }
+        }
+
+        private string _payment="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string payment
+        {
+             get{ return _payment; }
+             set{ _payment=value; }
+        }
+
+        private string _outSid="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string OutSid
+        {
+             get{ return _outSid; }
+             set{ _outSid=value; }
+        }
+
+        private string _afterSalePayment="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string AfterSalePayment
+        {
+             get{ return _afterSalePayment; }
+             set{ _afterSalePayment=value; }
+        }
+
+        private int _shopId=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int ShopId
+        {
+             get{ return _shopId; }
+             set{ _shopId=value; }
+        }
+
+        private string _splitTag="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string SplitTag
+        {
+             get{ return _splitTag; }
+             set{ _splitTag=value; }
+        }
+
+        private int _isAfterSaleOrder=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int isAfterSaleOrder
+        {
+             get{ return _isAfterSaleOrder; }
+             set{ _isAfterSaleOrder=value; }
+        }
+
+        private int _isDianziOrder=0;
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public int isDianziOrder
+        {
+             get{ return _isDianziOrder; }
+             set{ _isDianziOrder=value; }
+        }
+
+        private string _lastBillCpCode="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string LastBillCpCode
+        {
+             get{ return _lastBillCpCode; }
+             set{ _lastBillCpCode=value; }
+        }
+
+        private string _lastBillWaybillCode="";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string LastBillWaybillCode
+        {
+             get{ return _lastBillWaybillCode; }
+             set{ _lastBillWaybillCode=value; }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public DateTime? pay_time { get; set; }
+
+        private int _isSF=0;
+        /// <summary>
+        ///是否标记顺丰单
+        /// </summary>
+        [Property]
+        public int IsSF
+        {
+             get{ return _isSF; }
+             set{ _isSF=value; }
+        }
+
+        private int _isXianHuo=0;
+        /// <summary>
+        ///是否现货
+        /// </summary>
+        [Property]
+        public int IsXianHuo
+        {
+             get{ return _isXianHuo; }
+             set{ _isXianHuo=value; }
+        }
+
+        /// <summary>
+        ///订单打回时间
+        /// </summary>
+        [Property]
+        public DateTime? ReturnTime { get; set; }
+
+        private string _otherMemo="";
+        /// <summary>
+        ///除了7要素的额外备注
+        /// </summary>
+        [Property]
+        public string OtherMemo
+        {
+             get{ return _otherMemo; }
+             set{ _otherMemo=value; }
+        }
+
+        private string _afterSaleBackReason="";
+        /// <summary>
+        ///售后打回的原因
+        /// </summary>
+        [Property]
+        public string AfterSaleBackReason
+        {
+             get{ return _afterSaleBackReason; }
+             set{ _afterSaleBackReason=value; }
+        }
+
+        private string _checkMemo="";
+        /// <summary>
+        ///售后查货备注
+        /// </summary>
+        [Property]
+        public string CheckMemo
+        {
+             get{ return _checkMemo; }
+             set{ _checkMemo=value; }
+        }
+
+        private int _isOldCustomer=0;
+        /// <summary>
+        ///是否老客户购买
+        /// </summary>
+        [Property]
+        public int IsOldCustomer
+        {
+             get{ return _isOldCustomer; }
+             set{ _isOldCustomer=value; }
+        }
+
+        private int _isSupplierRefund=0;
+        /// <summary>
+        ///售后责任供应商 财务标记是否退款
+        /// </summary>
+        [Property]
+        public int IsSupplierRefund
+        {
+             get{ return _isSupplierRefund; }
+             set{ _isSupplierRefund=value; }
+        }
+
+        private int _isReadTag=0;
+        /// <summary>
+        ///打回退款等客服是否读取处理
+        /// </summary>
+        [Property]
+        public int IsReadTag
+        {
+             get{ return _isReadTag; }
+             set{ _isReadTag=value; }
+        }
+
+        private string _afterSaleMemoType="";
+        /// <summary>
+        ///售后备注类型
+        /// </summary>
+        [Property]
+        public string AfterSaleMemoType
+        {
+             get{ return _afterSaleMemoType; }
+             set{ _afterSaleMemoType=value; }
+        }
+
+        /// <summary>
+        ///加急时间
+        /// </summary>
+        [Property]
+        public DateTime? UrgencyTime { get; set; }
+
+        private int _isOffLineOrder=0;
+        /// <summary>
+        ///是否新增的线下单
+        /// </summary>
+        [Property]
+        public int IsOffLineOrder
+        {
+             get{ return _isOffLineOrder; }
+             set{ _isOffLineOrder=value; }
+        }
+
+        private string _payProofImg="";
+        /// <summary>
+        ///线下单付款凭证图片
+        /// </summary>
+        [Property]
+        public string PayProofImg
+        {
+             get{ return _payProofImg; }
+             set{ _payProofImg=value; }
+        }
+
+        private int _wechatTag=0;
+        /// <summary>
+        ///1微信单2推购单
+        /// </summary>
+        [Property]
+        public int wechatTag
+        {
+             get{ return _wechatTag; }
+             set{ _wechatTag=value; }
+        }
+
+        private string _backState="";
+        /// <summary>
+        ///已打回 已撤单 谁打回
+        /// </summary>
+        [Property]
+        public string BackState
+        {
+             get{ return _backState; }
+             set{ _backState=value; }
+        }
+
+        private string _makeSupplier="";
+        /// <summary>
+        ///制作产品的车间
+        /// </summary>
+        [Property]
+        public string MakeSupplier
+        {
+             get{ return _makeSupplier; }
+             set{ _makeSupplier=value; }
+        }
+
+
+        public static void Del(object id)
+        {
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("delete from test where id=" + id);
+            ExecuteNonQuery(sql.ToString());
+        }
+    }
+}

+ 342 - 0
BizCom/DicSysBase.cs

@@ -0,0 +1,342 @@
+using Castle.ActiveRecord;
+using System;
+using System.Data;
+using System.Text;
+
+namespace BizCom
+{
+    public class DicSysBase : ComBase<DicSysBase>
+    {
+        private string _code = "";
+        private string _memo = "";
+        private string _name = "";
+        private string _path = "";
+        public string _url = "";
+        public string _tag = "";
+        public string _icon = "";
+        public bool _isOperate = false;
+        public bool _oldOrder;
+        /// <summary>
+        /// 根结点名
+        /// </summary>
+        public string rootName;
+
+        /// <summary>
+        /// 页面标题显示
+        /// </summary>
+        public string titleName;
+
+        public string tableName;
+
+
+        [PrimaryKey(PrimaryKeyType.Identity)]
+        public int ID { get; set; }
+
+
+        /// <summary>
+        ///父节点ID
+        /// </summary>
+        [Property]
+        public int ParentID { get; set; }
+
+        /// <summary>
+        ///名称
+        /// </summary>
+        [Property]
+        public string Name
+        {
+            get { return _name; }
+            set { _name = value; }
+        }
+
+        /// <summary>
+        ///编号
+        /// </summary>
+        [Property]
+        public string Code
+        {
+            get { return _code; }
+            set { _code = value; }
+        }
+        /// <summary>
+        /// 老订单权限
+        /// </summary>
+        [Property]
+        public bool OldOrder
+        {
+            get { return _oldOrder; }
+            set { _oldOrder = value; }
+        }
+
+        /// <summary>
+        ///路径
+        /// </summary>
+        [Property]
+        public string Path
+        {
+            get { return _path; }
+            set { _path = value; }
+        }
+
+
+
+        /// <summary>
+        ///排序号
+        /// </summary>
+        [Property]
+        public int Sort { get; set; }
+
+        /// <summary>
+        ///删除标志
+        /// </summary>
+        [Property]
+        public bool IsDel { get; set; }
+
+        /// <summary>
+        ///备注
+        /// </summary>
+        [Property]
+        public string Memo
+        {
+            get { return _memo; }
+            set { _memo = value; }
+        }
+
+        //关联店铺
+        public string _pemShop = "";
+        public string pemShop
+        {
+            get { return _pemShop; }
+            set { _pemShop = value; }
+        }
+        public string Url
+        {
+            get { return _url; }
+            set { _url = value; }
+        }
+
+        public string Tag
+        {
+            get { return _tag; }
+            set { _tag = value; }
+        }
+
+        public string Icon
+        {
+            get { return _icon; }
+            set { _icon = value; }
+        }
+
+        public string _pCode = "";
+        /// <summary>
+        ///父代号
+        /// </summary>
+        public string PCode
+        {
+            get { return _pCode; }
+            set { _pCode = value; }
+        }
+
+        /// <summary>
+        ///是否操作
+        /// </summary>
+        public bool isOperate
+        {
+            get { return _isOperate; }
+            set { _isOperate = value; }
+        }
+
+        public string _hostFieldName = "";
+        /// <summary>
+        ///字段名
+        /// </summary>
+        public string HostFieldName
+        {
+            get { return _hostFieldName; }
+            set { _hostFieldName = value; }
+        }
+
+        public string _hostName = "";
+        /// <summary>
+        ///主机楼名称
+        /// </summary>
+        public string HostName
+        {
+            get { return _hostName; }
+            set { _hostName = value; }
+        }
+
+        public double _maxStock = 0;
+        public double _warningStock = 0;
+
+        public double MaxStock
+        {
+            get { return _maxStock; }
+            set { _maxStock = value; }
+        }
+        public double WarningStock
+        {
+            get { return _warningStock; }
+            set { _warningStock = value; }
+        }
+
+
+        #region 事件
+
+        /// <summary>
+        /// 获取Code
+        /// </summary>
+        /// <param name="pCode"></param>
+        /// <param name="pId"></param>
+        /// <returns></returns>
+        public virtual string GetCode(string pCode, int pId)
+        {
+            return "";
+        }
+
+        public void TransModular(object id, object pId, int sort, string table)
+        {
+            if (table == "") return;
+            StringBuilder sql = new StringBuilder();
+            sql.AppendFormat("declare @oldid int;");
+            sql.AppendFormat("select @oldid=parentid from {1} where id={0} ;", id, table);
+            sql.AppendFormat("update {2} set path=REPLACE(Path,@oldid,'{0}') where path like  '%|'+(select Convert(varchar,id) from {2} where ID={1})+'%|' or ID={1} ;", pId, id, table);
+            sql.AppendFormat("update {3} set parentid={0},sort={1} where id={2} ;", pId, sort, id, table);
+            TransExecuteNonQuery(sql.ToString());
+        }
+
+        public void SaveLine(object id, string prev, int st, int et, string table)
+        {
+            StringBuilder sql = new StringBuilder();
+            for (int i = st; i < st + et; i++)
+            {
+                sql.AppendFormat("insert into {0}(parentid,name,sort,pemShop)values({1},'{2}',{3}) ;", table, id, prev + (i < 10 ? ("0" + i) : i.ToString()), i);
+            }
+            TransExecuteNonQuery(sql.ToString());
+        }
+        /// <summary>
+        /// 获取数据
+        /// </summary>
+        /// <returns></returns>
+        public DataTable GetDataTable()
+        {
+            return GetDataTable("");
+        }
+        public DataTable GetDataTable(string sWhere)
+        {
+            return GetDataTable(0, sWhere);
+        }
+        public DataTable GetDataTable(int top, string sWhere)
+        {
+            string sTop = top > 0 ? "Top " + top : "";
+            string sql = "select {2} * from {0} {1} order by ParentID,Sort";
+            DataSet ds = DbConn.ExecuteDataset(string.Format(sql, TName, sWhere == "" ? "" : " where " + sWhere, sTop));
+            if (ds != null && ds.Tables.Count > 0) return ds.Tables[0];
+            else return null;
+        }
+
+        public static DataTable GetTable(string sName, string sWhere)
+        {
+            string sql = "select * from {0} {1} Order By ParentID,Sort";
+            DataSet ds = DbConn.ExecuteDataset(string.Format(sql, sName, sWhere == "" ? "" : " where " + sWhere));
+            if (ds != null && ds.Tables.Count > 0) return ds.Tables[0];
+            else return null;
+        }
+
+        public object GetEntity(object id)
+        {
+            DataTable dt = GetDataTable("ID=" + id);
+            ID = Convert.ToInt32(dt.Rows[0]["ID"]);
+            Name = dt.Rows[0]["Name"].ToString();
+            ParentID = Convert.ToInt32(dt.Rows[0]["ParentID"]);
+            if (dt.Columns.Contains("Url"))
+                Url = dt.Rows[0]["Url"].ToString();
+            if (dt.Columns.Contains("Tag"))
+                Tag = dt.Rows[0]["Tag"].ToString();
+            if (dt.Columns.Contains("isOperate"))
+                isOperate = Convert.ToBoolean(dt.Rows[0]["isOperate"]);
+            Code = dt.Rows[0]["Code"].ToString();
+            Path = dt.Rows[0]["Path"].ToString();
+            Sort = Convert.ToInt32(dt.Rows[0]["Sort"]);
+            IsDel = Convert.ToBoolean(dt.Rows[0]["IsDel"]);
+            OldOrder = Convert.ToBoolean(dt.Rows[0]["OldOrder"]);
+            Memo = dt.Rows[0]["Memo"].ToString();
+            return this;
+        }
+
+        public object GetParentName(int pId)
+        {
+            string sql = "select Name from {0} where ID={1}";
+            object result = DbConn.ExecuteScalar(string.Format(sql, TName, pId));
+            return result;
+        }
+
+        public object GetParentPath(int pId)
+        {
+            string sql = "select Path from {0} where ID={1}";
+            object result = DbConn.ExecuteScalar(string.Format(sql, TName, pId));
+            return result;
+        }
+
+        public DataRow GetParentFields(string fields, int pId)
+        {
+            string sql = "select {2} from {0} where ID={1}";
+            DataTable dt = ExecuteDataset(string.Format(sql, TName, pId, fields)).Tables[0];
+            if (dt != null && dt.Rows.Count > 0)
+                return dt.Rows[0];
+            return null;
+        }
+
+        public static object GetFieldByName(string field, string table, string name)
+        {
+            string sql = "select {0} from {1} where Name='{2}'";
+            object result = DbConn.ExecuteScalar(string.Format(sql, field, table, name));
+            return result;
+        }
+        public static int GetIDByName(string table, string name)
+        {
+            object result = GetFieldByName("ID", table, name);
+            if (result != null) return (int)result;
+            return 0;
+        }
+
+        public static void UpdatePath(string table)
+        {
+            string sql = "select * from " + table;
+            DataTable dt = ExecuteDataset(sql).Tables[0];
+            DataView dv = new DataView(dt);
+            DataView dv2 = new DataView(dt);
+            dv.RowFilter = "parentid<>0 and path=''";
+            StringBuilder tmpSql = new StringBuilder();
+            string spath = "";
+            foreach (DataRowView drv in dv)
+            {
+                dv2.RowFilter = "id=" + drv["parentid"];
+                if (dv2.Count > 0)
+                {
+                    if (dv2[0]["parentid"].ToString() == "0")
+                    {
+                        spath = "|" + dv2[0]["id"] + "|";
+                    }
+                    else
+                    {
+                        spath = dv2[0]["path"].ToString() + dv2[0]["id"] + "|";
+                    }
+                    tmpSql.Append("update " + table + " set path ='" + spath + "' where id=" + drv["id"] + " ;");
+                }
+                if (tmpSql.Length > 0)
+                {
+                    ExecuteNonQuery(tmpSql.ToString());
+                }
+            }
+        }
+
+        public void DelChild(int id)
+        {
+            string sql = string.Format("delete from {0} where Path like '%|{1}|%' ", TName, id);
+            ExecuteNonQuery(sql);
+        }
+
+        #endregion
+    }
+}

+ 10 - 0
BizCom/Enum/GoodsState.cs

@@ -0,0 +1,10 @@
+namespace BizCom.Enum
+{
+    public enum GoodsState
+    {
+        none = 0,//未发布
+        publish = 1,//己发布
+        close = 2,//关闭
+        finish = 5//结束
+    }
+}

+ 10 - 0
BizCom/Enum/LabOrderState.cs

@@ -0,0 +1,10 @@
+namespace BizCom.Enum
+{
+    public enum LabOrderState
+    {
+        def = 0,//预约未签到
+        sign = 1,//己签到
+        finish = 5,//结束使用
+        expire = 6//过期
+    }
+}

+ 9 - 0
BizCom/Enum/MessageState.cs

@@ -0,0 +1,9 @@
+namespace BizCom
+{
+    public enum MessageState
+    {
+        订单审核 = 0,
+        订单退款 = 1,
+        订单改价 = 2,
+    }
+}

+ 24 - 0
BizCom/Enum/ModelType.cs

@@ -0,0 +1,24 @@
+namespace BizCom.Enum
+{
+    public enum ModelType
+    {
+        /*
+           1:闲置出售
+           2.求购专区
+           3.校园招聘
+           4.赏金大厅
+           5.社团
+           6.校园资讯
+           7.合伙人
+           8.勤工俭学
+           */
+        ewu = 1,
+        wishs = 2,
+        recruit = 3,
+        task = 4,
+        assn = 5,
+        news = 6,
+        cop = 7,
+        qkrecruit = 8
+    }
+}

+ 18 - 0
BizCom/Enum/OrderState.cs

@@ -0,0 +1,18 @@
+namespace BizCom
+{
+    public enum OrderState
+    {
+        待审核 = -1,
+        待领单 = 0,
+        待发布 = 1,
+        待抢单 = 2,
+        待设计 = 3,
+        设计中 = 4,
+        设计完成 = 5,
+        下单完成 = 6,
+        已发货 = 7,
+        交易完成 = 8,
+        交易关闭 = 9
+    }
+
+}

+ 30 - 0
BizCom/Enum/ProductCategory.cs

@@ -0,0 +1,30 @@
+using System.Collections.Generic;
+
+namespace BizCom.Enum
+{
+    public class ProductCategory
+    {
+        public const int xianHuo = 1,//现货类
+        dingZhi = 2,//定制类
+        dianZiWenJian = 3;//电子文件
+
+        static Dictionary<int, string> map = null;
+        static ProductCategory()
+        {
+            if (map == null)
+            {
+                map = new Dictionary<int, string>();
+                map.Add(ProductCategory.xianHuo, "现货类");
+                map.Add(ProductCategory.dingZhi, "定制类");
+                map.Add(ProductCategory.dianZiWenJian, "电子文件");
+            }
+        }
+
+        public static string getText(int value)
+        {
+            return map[value];
+        }
+    }
+
+
+}

+ 14 - 0
BizCom/Enum/TaskPersonState.cs

@@ -0,0 +1,14 @@
+namespace BizCom.Enum
+{
+    public enum TaskPersonState
+    {
+        Tobe = 0,//待确认
+        Accept = 1,//被接受
+        Lose = 2,//未中标
+        Execute = 3,//开始执行
+        Abandon = 4,//提交放弃任务(无法完成)
+        Done = 5, //执行完成,提交验收
+        FailFinish = 9, //确认停止任务,任务结束
+        SuccessFinish = 10//确认完成任务,任务结束
+    }
+}

Some files were not shown because too many files changed in this diff