using System; using System.Collections.Generic; using System.Data.SqlClient; using System.Linq; using System.Text; using DirectService.Tools; using JLHHJSvr.BLL; using JLHHJSvr.Com; using JLHHJSvr.Com.Model; using JLHHJSvr.Helper; using JLHHJSvr.LJException; using JLHHJSvr.Tools; using LJLib.DAL.SQL; using LJLib.Net.SPI.Server; namespace JLHHJSvr.Excutor { internal sealed class GetMattressPackagMxExcutor : ExcutorBase { protected override void ExcuteInternal(GetMattressPackagMxRequest request, object state, GetMattressPackagMxResponse rslt) { var tokendata = BllHelper.GetToken(request.token); if (tokendata == null) { rslt.ErrMsg = "会话已经中断,请重新登录"; return; } if (request.mattresstypeid == 0) { rslt.ErrMsg = "床垫类别不能为0"; return; } using (var con = new SqlConnection(GlobalVar.ConnectionString)) using (var cmd = con.CreateCommand()) { con.Open(); using (cmd.Transaction = con.BeginTransaction()) { var helper = HelperBase.GetHelper(cmd, new HelperBase.Context() { tokendata = tokendata }); var dw_2 = new List(); // 导入 2-按包装方式 的公式 helper.wf_import_bz(request.packtype, ref dw_2); helper.wf_sort_mx(ref dw_2); helper.wf_default_mtrlid(request.pricelistid, ref dw_2); rslt.mattressMx = dw_2; } } } } }