Browse Source

需求单No.138390 屠宰场管理新增档案“收购类型” 把原有的NamedValue类型换成档案

master
yibo 8 years ago
parent
commit
fd37a5db92
6 changed files with 24 additions and 36 deletions
  1. +1
    -4
      B3ClientService/BO/BaseInfo/PurchaseType.cs
  2. +1
    -1
      B3ClientService/BO/Bill/WeightBill/WeightBill.cs
  3. +19
    -0
      B3ClientService/DataPatch/UpdatePurchaseTypeColumn.cs
  4. +1
    -16
      B3ClientService/Rpcs/BaseInfoRpc.cs
  5. +1
    -1
      B3ClientService/Rpcs/RpcBO/Bill/WeightBill/SWeightBill.cs
  6. +1
    -14
      B3ClientService/Tasks/SyncInfoFromServer.cs

+ 1
- 4
B3ClientService/BO/BaseInfo/PurchaseType.cs View File

@ -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; }
}
}

+ 1
- 1
B3ClientService/BO/Bill/WeightBill/WeightBill.cs View File

@ -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; }


+ 19
- 0
B3ClientService/DataPatch/UpdatePurchaseTypeColumn.cs View File

@ -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);
}
}
}

+ 1
- 16
B3ClientService/Rpcs/BaseInfoRpc.cs View File

@ -101,22 +101,7 @@ namespace BWP.B3ClientService.Rpcs
[Rpc]
public static List<WordPair> 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<WordPair>();
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<PurchaseType>(input, args, top);
}
[Rpc]


+ 1
- 1
B3ClientService/Rpcs/RpcBO/Bill/WeightBill/SWeightBill.cs View File

@ -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; }


+ 1
- 14
B3ClientService/Tasks/SyncInfoFromServer.cs View File

@ -336,20 +336,7 @@ namespace BWP.B3ClientService.Tasks
void SyncPurchaseType()
{
var list = RpcFacade.Call<List<RpcObject>>("/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<short>("ID");
entity.Name = o.Get<string>("Name");
context.Session.Insert(entity);
}
context.Commit();
}
SyncBaseInfo<PurchaseType>("GetPurchaseType");
}
void SyncSupplier()


Loading…
Cancel
Save