diff --git a/B3ClientService/B3ClientService.csproj b/B3ClientService/B3ClientService.csproj
index 783c81f..df12c72 100644
--- a/B3ClientService/B3ClientService.csproj
+++ b/B3ClientService/B3ClientService.csproj
@@ -133,6 +133,7 @@
+
diff --git a/B3ClientService/BO/BaseInfo/PurchaseType.cs b/B3ClientService/BO/BaseInfo/PurchaseType.cs
index 0dfa394..d9c3e01 100644
--- a/B3ClientService/BO/BaseInfo/PurchaseType.cs
+++ b/B3ClientService/BO/BaseInfo/PurchaseType.cs
@@ -8,10 +8,7 @@ using TSingSoft.WebPluginFramework;
namespace BWP.B3ClientService.BO
{
[Serializable,BOClass]
- public class PurchaseType
+ public class PurchaseType : BaseInfo
{
- public short ID { get; set; }
-
- public string Name { get; set; }
}
}
diff --git a/B3ClientService/BO/Bill/WeightBill/WeightBill.cs b/B3ClientService/BO/Bill/WeightBill/WeightBill.cs
index a646da9..8d04f7f 100644
--- a/B3ClientService/BO/Bill/WeightBill/WeightBill.cs
+++ b/B3ClientService/BO/Bill/WeightBill/WeightBill.cs
@@ -39,7 +39,7 @@ namespace BWP.B3ClientService.BO
public string Zone_Name { get; set; }
- public short? PurchaseType_ID { get; set; }
+ public long? PurchaseType_ID { get; set; }
public string PurchaseType_Name { get; set; }
diff --git a/B3ClientService/DataPatch/UpdatePurchaseTypeColumn.cs b/B3ClientService/DataPatch/UpdatePurchaseTypeColumn.cs
new file mode 100644
index 0000000..c817560
--- /dev/null
+++ b/B3ClientService/DataPatch/UpdatePurchaseTypeColumn.cs
@@ -0,0 +1,19 @@
+using Forks.EnterpriseServices.BusinessInterfaces;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using TSingSoft.WebPluginFramework.Install;
+
+namespace BWP.B3ClientService.DataPatch
+{
+ [DataPatch]
+ public class UpdatePurchaseTypeColumn : IDataPatch
+ {
+ public void Execute(TransactionContext context)
+ {
+ var sql = @"update B3ClientService_WeightBill set PurchaseType_ID=PurchaseType_ID+1";
+ context.Session.ExecuteSqlNonQuery(sql);
+ }
+ }
+}
diff --git a/B3ClientService/Rpcs/BaseInfoRpc.cs b/B3ClientService/Rpcs/BaseInfoRpc.cs
index 8986ba3..678c08c 100644
--- a/B3ClientService/Rpcs/BaseInfoRpc.cs
+++ b/B3ClientService/Rpcs/BaseInfoRpc.cs
@@ -101,22 +101,7 @@ namespace BWP.B3ClientService.Rpcs
[Rpc]
public static List GetPurchaseTypeList(string input, string args, int top)
{
- var query = new DQueryDom(new JoinAlias(typeof(PurchaseType)));
- if (top > 50)
- top = 50;
- query.Range = SelectRange.Top(top);
- query.Columns.Add(DQSelectColumn.Field("ID"));
- query.Columns.Add(DQSelectColumn.Field("Name"));
- var list = new List();
- using (var session = Dmo.NewSession())
- {
- using (var reader = session.ExecuteReader(query))
- {
- while (reader.Read())
- list.Add(new WordPair(reader[1].ToString(), reader[0].ToString()));
- }
- }
- return list;
+ return GetBaseInfoList(input, args, top);
}
[Rpc]
diff --git a/B3ClientService/Rpcs/RpcBO/Bill/WeightBill/SWeightBill.cs b/B3ClientService/Rpcs/RpcBO/Bill/WeightBill/SWeightBill.cs
index 8cfeaa0..226a41d 100644
--- a/B3ClientService/Rpcs/RpcBO/Bill/WeightBill/SWeightBill.cs
+++ b/B3ClientService/Rpcs/RpcBO/Bill/WeightBill/SWeightBill.cs
@@ -27,7 +27,7 @@ namespace BWP.B3ClientService.RpcBO
public long? Zone_ID { get; set; }
- public short? PurchaseType_ID { get; set; }
+ public long? PurchaseType_ID { get; set; }
public long? Car_ID { get; set; }
diff --git a/B3ClientService/Tasks/SyncInfoFromServer.cs b/B3ClientService/Tasks/SyncInfoFromServer.cs
index da42200..8eb1842 100644
--- a/B3ClientService/Tasks/SyncInfoFromServer.cs
+++ b/B3ClientService/Tasks/SyncInfoFromServer.cs
@@ -336,20 +336,7 @@ namespace BWP.B3ClientService.Tasks
void SyncPurchaseType()
{
- var list = RpcFacade.Call>("/MainSystem/B3ButcherManage/Rpcs/TouchScreenRpcs/GetPurchaseType");
- using (var context = new TransactionContext())
- {
- var sql1 = @"truncate table [B3ClientService_PurchaseType];";
- context.Session.ExecuteSqlNonQuery(sql1);
- foreach (RpcObject o in list)
- {
- var entity = new PurchaseType();
- entity.ID = o.Get("ID");
- entity.Name = o.Get("Name");
- context.Session.Insert(entity);
- }
- context.Commit();
- }
+ SyncBaseInfo("GetPurchaseType");
}
void SyncSupplier()