Ejemplo n.º 1
0
        /// <summary>
        /// 获取汽修商户相关信息
        /// </summary>
        /// <param name="paramMerchantCode">汽修商客户编码</param>
        private bool GetARMerchantInfo(string paramMerchantCode)
        {
            if (string.IsNullOrEmpty(paramMerchantCode))
            {
                //汽修商客户ID为空,汽修商户信息获取失败
                MessageBoxs.Show(Trans.IS, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0016, SystemTableColumnEnums.PIS_AutoFactoryCustomer.Name.AFC_ID, MsgParam.AUTOFACTORY + MsgParam.INFORMATION + MsgParam.GET), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(false);
            }

            //从缓存中获取汽修商户信息
            List <MDLPIS_AutoFactoryCustomer> resultAutoFactoryCustomerList = CacheDAX.Get(CacheDAX.ConfigDataKey.ARMerchant) as List <MDLPIS_AutoFactoryCustomer>;

            if (resultAutoFactoryCustomerList == null)
            {
                //汽修商户信息获取失败
                MessageBoxs.Show(Trans.IS, this.ToString(), MsgHelp.GetMsg(MsgCode.I_0002, MsgParam.AUTOFACTORY + MsgParam.INFORMATION + MsgParam.GET), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(false);
            }

            //获取该汽修商Code
            string tempAutoFactoryCode = string.Empty;
            List <MDLPIS_AutoFactoryCustomer> tempAutoFactoryCustomerList = resultAutoFactoryCustomerList.Where(p => p.AFC_Code == paramMerchantCode).ToList();

            if (tempAutoFactoryCustomerList.Count == 1)
            {
                tempAutoFactoryCode = tempAutoFactoryCustomerList[0].AFC_Code;
            }

            #region 获取商户数据库配置Key

            _arMerchantCode = BLLCom.GetMerchantDbConfigKey(tempAutoFactoryCode);

            if (string.IsNullOrEmpty(_arMerchantCode))
            {
                //请选择有效的汽修商户
                MessageBoxs.Show(Trans.IS, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0013, MsgParam.VALID + MsgParam.OF + MsgParam.AUTOFACTORY), MessageBoxButtons.OK,
                                 MessageBoxIcon.Information);
                return(false);
            }

            #endregion

            return(true);
        }