Exemple #1
0
        public NeweggAmbassadorEntity GetNeweggAmbassadorInfo(NeweggAmbassadorEntity entity)
        {
            DataCommand dc = DataCommandManager.GetDataCommand("GetNeweggAmbassadorInfo");

            dc.SetParameterValue("@CustomerSysno", entity.AmbassadorSysNo);
            dc.SetParameterValue("@CompanyCode", entity.CompanyCode);
            NeweggAmbassadorEntity result = dc.ExecuteEntity <NeweggAmbassadorEntity>();

            return(result);
        }
Exemple #2
0
        /// <summary>
        /// 取消申请。
        /// </summary>
        /// <param name="batchInfo"></param>
        public void CancelRequestNeweggAmbassadorStatus(NeweggAmbassadorBatchInfo batchInfo)
        {
            if (batchInfo == null || batchInfo.NeweggAmbassadors == null || batchInfo.NeweggAmbassadors.Count <= 0)
            {
                return;
            }
            foreach (NeweggAmbassadorSatusInfo statusInfo in batchInfo.NeweggAmbassadors)
            {
                if (statusInfo != null)
                {
                    NeweggAmbassadorEntity entity = new NeweggAmbassadorEntity();
                    entity.AmbassadorSysNo = statusInfo.AmbassadorSysNo;
                    entity.CompanyCode     = statusInfo.CompanyCode;

                    var tempStatusInfo = _neweggAmbassadorDA.GetNeweggAmbassadorInfo(entity);
                    if (tempStatusInfo != null && tempStatusInfo.CustomerMark != null && tempStatusInfo.CustomerMark == AmbassadorStatus.UnActive)
                    {
                        bool result = _neweggAmbassadorDA.CancelRequestNeweggAmbassador(statusInfo);
                        if (result)
                        {
                            statusInfo.OrignCustomerMark = null;

                            //Log信息。
                            NeweggAmbassadorMaintainLogInfo logInfo = new NeweggAmbassadorMaintainLogInfo();
                            logInfo.AmbassadorSysNo = statusInfo.AmbassadorSysNo.Value;
                            logInfo.Status          = "E";
                            logInfo.CompanyCode     = batchInfo.CompanyCode;
                            logInfo.Note            = null;

                            //记录下激活和取消的泰隆优选大使Log
                            _neweggAmbassadorDA.LogNeweggAmbassadorMaintainInfo(logInfo);
                        }
                    }
                }
            }
        }