12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- using System;
- using System.Collections.Generic;
- using System.Data.SqlClient;
- using System.Diagnostics;
- using System.IO;
- using System.IO.Compression;
- using System.Linq;
- using System.Text;
- using JLHHJSvr.BLL;
- using JLHHJSvr.Com;
- using JLHHJSvr.DBA.DBModle;
- using LJLib.Net.SPI.Server;
- using PhoneUI.BLL.L1BLL;
- namespace JLHHJSvr.Excutor
- {
- internal sealed class GetSysUserFileStringExcutor : ExcutorBase<GetSysUserFileStringRequest, GetSysUserFileStringResponse>
- {
- protected override void ExcuteInternal(GetSysUserFileStringRequest request, object state, GetSysUserFileStringResponse rslt)
- {
- if (request.empid == null)
- {
- rslt.ErrMsg = "参数错误,empid不能为null";
- return;
- }
- if (request.dwname == null)
- {
- rslt.ErrMsg = "参数错误,dwname不能为null";
- return;
- }
- if (request.itemname == null)
- {
- rslt.ErrMsg = "参数错误,itemname不能为null";
- return;
- }
- var tokendata = BllHelper.GetToken(request.token);
- if (tokendata == null)
- {
- rslt.ErrMsg = "会话已经中断";
- return;
- }
- //if (string.IsNullOrEmpty(tokendata.ConStr))
- //{
- // rslt.ErrMsg = "当前账套未设置数据库";
- // return;
- //}
- using (var con = new SqlConnection(GlobalVar.ConnectionString))
- using (var cmd = con.CreateCommand())
- {
- con.Open();
- var ufs = HelperBase.GetHelper<SysUserFileString>(cmd);
- if (request.empid.Value == -1)
- {
- rslt.itemvalue = ufs.getSystemLayout(request.dwname, request.itemname, request.ifcompress);
- }
- else
- {
- rslt.itemvalue = ufs.GetValue(request.empid.Value, request.dwname, request.itemname, string.Empty, request.ifcompress == 1 ? true : false);
- }
- if (string.IsNullOrEmpty(rslt.itemvalue))//如果没有自己的布局方案,尝试获取系统的布局方案
- {
- rslt.itemvalue = ufs.getSystemLayout(request.dwname, request.itemname, request.ifcompress);
- }
- if (request.ifdel != null && request.ifdel == 1)
- {
- ufs.delLayout(tokendata.empid, request.dwname, request.itemname);
- }
- }
- }
- }
- }
|