Exemplo n.º 1
0
        public IList <HistoryInfo> SearchByCondition(Dictionary <string, object> arr, DataAccessor theDataAccessor, ref SystemMessageInfo theSystemMessageInfo)
        {
            HistoryInfo         objHistoryInfo   = new HistoryInfo();
            IList <HistoryInfo> _objIHistoryInfo = new List <HistoryInfo>();
            //转换为Datatable
            DataTable dt = ConvertMethod.getDateTable("table", arr);
            //dataTable转换为XML
            string objXmlDocument = Helper.ConvertMethod.CDataToXml(dt);

            ////加密xml进行返回
            string Parameter = ConvertMethod.EncryptDESByKey8(objXmlDocument, ConfigurationSettings.AppSettings["password"]);

            DataSet objDataSet = new DataSet();

            try
            {
                string strReturnXml = ServiceWrapper.Current.SelectCarInformationHistoryRecord(Parameter);

                //先解密成xml格式
                strReturnXml = ConvertMethod.DecryptDESByKey8(strReturnXml, ConfigurationSettings.AppSettings["password"]);

                objDataSet = Helper.FormatConvert.CXmlToDataSet(strReturnXml);
                CurrentUser.Current.TotalCount = Int32.Parse(objDataSet.Tables["tb_card_historycount"].Rows[0]["count"].ToString());
                try
                {
                    if (objDataSet.Tables.Count > 2)
                    {
                        foreach (DataRow objDataRow in objDataSet.Tables["tb_card_history"].Rows)
                        {
                            objHistoryInfo = GetInfoFromDataRow(objDataRow);
                            _objIHistoryInfo.Add(objHistoryInfo);
                        }
                    }
                }
                catch (Exception e)
                {
                    _objSystemMessageInfo           = _objSystemMessage.GetInfoByCode("WebServiceParseToInfoFail");
                    _objSystemMessageInfo.Success   = false;
                    _objSystemMessageInfo.Exception = e.Message;
                }
            }
            catch (Exception e)
            {
                _objSystemMessageInfo           = _objSystemMessage.GetInfoByCode("WebServiceConnectFail");
                _objSystemMessageInfo.Success   = false;
                _objSystemMessageInfo.Exception = e.Message;
            }
            theSystemMessageInfo = _objSystemMessageInfo;
            return(_objIHistoryInfo);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据SAASID跟用户账户密码查询该C/S用户是否存在
        /// </summary>
        /// <param name="theHashtable"></param>
        /// <param name="theDataAccessor"></param>
        /// <param name="theSystemMessageInfo"></param>
        /// <returns></returns>
        public UserInfo SelectUserCountByID(Dictionary <string, object> arr, DataAccessor theDataAccessor, ref SystemMessageInfo theSystemMessageInfo)
        {
            SystemMessage     _objSystemMessage     = new SystemMessage();
            SystemMessageInfo _objSystemMessageInfo = new SystemMessageInfo();

            UserInfo objUserInfo = new UserInfo();

            //转换为Datatable
            DataTable dt = ConvertMethod.getDateTable("table", arr);
            //dataTable转换为XML
            string objXmlDocument = Helper.ConvertMethod.CDataToXml(dt);

            ////加密xml进行返回
            string Parameter = ConvertMethod.EncryptDESByKey8(objXmlDocument, ConfigurationSettings.AppSettings["password"]);

            DataSet objDataSet = new DataSet();

            try
            {
                string strReturnXml = ServiceWrapper.Current.ClientUserAuthentication(Parameter);

                //先解密成xml格式
                strReturnXml = ConvertMethod.DecryptDESByKey8(strReturnXml, ConfigurationSettings.AppSettings["password"]);

                objDataSet = Helper.FormatConvert.CXmlToDataSet(strReturnXml);
                try
                {
                    if (objDataSet.Tables.Count > 1)
                    {
                        foreach (DataRow objDataRow in objDataSet.Tables["tb_user"].Rows)
                        {
                            objUserInfo = GetInfoFromDataRow(objDataRow);
                        }
                    }
                    if (objDataSet.Tables.Count == 3)
                    {
                        objUserInfo.IsPower = true;
                        foreach (DataRow objDataRow in objDataSet.Tables["tb_right"].Rows)
                        {
                            //解析权限 2012.01.04 zhangwenjin add
                            objUserInfo.RightInfoList.Add(GetRightInfoFromDataRow(objDataRow));
                        }
                    }
                    if (objDataSet.Tables.Count == 1)
                    {
                        return(null);
                    }
                }
                catch (Exception e)
                {
                    _objSystemMessageInfo           = _objSystemMessage.GetInfoByCode("WebServiceParseToInfoFail");
                    _objSystemMessageInfo.Success   = false;
                    _objSystemMessageInfo.Exception = e.Message;
                }
            }
            catch (Exception e)
            {
                _objSystemMessageInfo           = _objSystemMessage.GetInfoByCode("WebServiceConnectFail");
                _objSystemMessageInfo.Success   = false;
                _objSystemMessageInfo.Exception = e.Message;
            }

            theSystemMessageInfo = _objSystemMessageInfo;
            return(objUserInfo);
        }