123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using System;
- using JLHHJSvr.BLL;
- using JLHHJSvr.Com;
- using JLHHJSvr.Helper;
- using LJLib.Net.SPI.Server;
- using LJLib.SQLEX;
- namespace JLHHJSvr.Excutor
- {
- internal sealed class SaveSoftBedQuoteExcutor : ExcutorBase<SaveSoftBedQuoteRequest, SaveSoftBedQuoteResponse>
- {
- protected override void ExcuteInternal(SaveSoftBedQuoteRequest request, object state, SaveSoftBedQuoteResponse rslt)
- {
- var tokendata = BllHelper.GetToken(request.token);
- if (tokendata == null)
- {
- rslt.ErrMsg = "会话已经中断,请重新登录";
- return;
- }
- using (var con = GlobalVar.ConnectionString.NewSqlConnection())
- using (var cmd = con.CreateCommand())
- {
- con.Open();
- var softBedHelper = HelperBase.GetHelper<SoftBedHelper>(cmd, new HelperBase.Context() { tokendata = tokendata });
- using (cmd.Transaction = con.BeginTransaction())
- {
- try
- {
- softBedHelper.SaveSoftBed(request.softbed);
- cmd.Transaction.Commit();
- }
- catch (Exception e)
- {
- cmd.Transaction?.Rollback();
- rslt.ErrMsg = e.ToString();
- }
- }
- }
- }
- }
- }
|