/// <summary> 数据操作 /// </summary> /// <param name="strJson">json字串</param> /// <returns></returns> public string JsonOperate(string strJson) { RespFunStruct resp = new RespFunStruct(); string returnStr = string.Empty; string opName = string.Empty; try { string objStr = HXCCommon.DotNetEncrypt.DESEncrypt.Decrypt(strJson); ReqeFunStruct reqeObj = Newtonsoft.Json.JsonConvert.DeserializeObject <ReqeFunStruct>(objStr); opName = reqeObj.userIDOP.OPName; if (string.IsNullOrEmpty(reqeObj.AccCode)) { resp.IsSuccess = "0"; resp.Msg = "帐套不能为空"; } else { SetDbName(reqeObj.AccCode, false); string errMsg = LoginSessionInfo.Instance.ValidaiteUser(reqeObj.AccCode, reqeObj.userIDOP.UserID, reqeObj.PCClientCookieStr); if (!string.IsNullOrEmpty(errMsg)) { resp.IsSuccess = "0"; resp.Msg = errMsg; } else { switch (reqeObj.SubSysName) { case SubSysName.CommonBaseFuncCall: resp = CommonBaseFuncCall.ComFunCall(reqeObj); break; case SubSysName.ExtendBaseFuncCall: resp = ExtendBaseFuncCall.ExtBaseFuncCall(reqeObj); break; } } } } catch (Exception ex) { resp.IsSuccess = "0"; resp.Msg = "【接口调用】-" + opName + ":" + ex.Message; GlobalStaticObj_Server.WCFLogService.WriteLog("数据操作-" + opName, ex); } returnStr = HXCCommon.DotNetEncrypt.DESEncrypt.Encrypt(Newtonsoft.Json.JsonConvert.SerializeObject(resp)); return(returnStr); }
/// <summary> 数据操作 /// </summary> /// <param name="strJson">json字串</param> /// <returns></returns> public string JsonOperate(string strJson) { RespFunStruct resp = new RespFunStruct(); string returnStr = string.Empty; try { string objStr = HXCCommon.DotNetEncrypt.DESEncrypt.Decrypt(strJson); ReqeFunStruct reqeObj = Newtonsoft.Json.JsonConvert.DeserializeObject <ReqeFunStruct>(objStr); if (string.IsNullOrEmpty(reqeObj.AccCode)) { resp.IsSuccess = "0"; resp.Msg = "帐套不能为空"; } else { SetDbName(reqeObj.AccCode, false); if (!LoginSessionInfo.Instance.ValidaiteUser(reqeObj.userIDOP.UserID, reqeObj.PCClientCookieStr)) { resp.IsSuccess = "0"; resp.Msg = "用户验证失败"; } else { switch (reqeObj.SubSysName) { case SubSysName.CommonBaseFuncCall: resp = CommonBaseFuncCall.ComFunCall(reqeObj); break; case SubSysName.ExtendBaseFuncCall: resp = ExtendBaseFuncCall.ExtBaseFuncCall(reqeObj); break; } } } } catch (Exception ex) { resp.IsSuccess = "0"; resp.Msg = "执行失败:" + ex.Message; Utility.Log.Log.writeLineToLog("【数据操作】" + ex.Message, "wcf服务"); } returnStr = HXCCommon.DotNetEncrypt.DESEncrypt.Encrypt(Newtonsoft.Json.JsonConvert.SerializeObject(resp)); return(returnStr); }