Пример #1
0
        /// <summary>
        /// 调用Combo更新状态
        /// </summary>
        /// <param name="sysNo"></param>
        /// <param name="targetStatus"></param>
        public virtual void ApproveOptionalAccessories(int?sysNo, ComboStatus targetStatus)
        {
            //Check审核人与创建人不能相同
            if (sysNo == null)
            {
                //throw new BizException("更新失败,参数有误!");
                throw new BizException(ResouceManager.GetMessageString("MKT.Promotion.Combo", "Combo_ArgsError"));
            }
            OptionalAccessoriesInfo oldEntity = _da.Load(sysNo.Value);

            //if (oldEntity.Status == ComboStatus.WaitingAudit && oldEntity.CreateUserSysNo == ServiceContext.Current.UserSysNo)
            //{
            //    throw new BizException(string.Format("{0} 创建人与审核人不能相同", oldEntity.Name));
            //}

            TransactionScopeFactory.TransactionAction(() =>
            {
                ObjectFactory <ComboProcessor> .Instance.UpdateStatus(sysNo, targetStatus);
                //更新PromotionEngine配置中活动的状态
                //_oaPromotionEngine.UpdateActivityStatus(sysNo.Value, targetStatus);

                ExternalDomainBroker.CreateOperationLog(
                    String.Format("{0}{1}SysNo:{2}| 状态:{3}",
                                  DateTime.Now.ToString(), "审核状态", sysNo
                                  , targetStatus == ComboStatus.Active ? "有效"
                : targetStatus == ComboStatus.Deactive ? "无效" : "待审核")
                    , BizEntity.Common.BizLogType.OptionalAccessories_Approve
                    , sysNo.Value, "8601");//[Mark][Alan.X.Luo 硬编码]
            });
        }
Пример #2
0
        //待审核状态显示红色
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            ComboStatus status = ComboStatus.WaitingAudit;

            Enum.TryParse <ComboStatus>(value.ToString(), out status);
            return(status == ComboStatus.WaitingAudit ? "Red" : "Black");
        }
Пример #3
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            ComboStatus status = ComboStatus.Deactive;

            Enum.TryParse <ComboStatus>(value.ToString(), out status);

            return(status == ComboStatus.Active);
        }
Пример #4
0
        public virtual void UpdateStatus(int?sysNo, ComboStatus targetStatus)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("UpdateStatus");

            cmd.SetParameterValue("@SysNo", sysNo);
            cmd.SetParameterValue("@Status", targetStatus);
            cmd.ExecuteNonQuery();
        }
Пример #5
0
        private void InteractWithCombo(ComputerConfigMaster msg)
        {
            ComputerConfigMaster oldEntity = _configDA.LoadMaster(msg.SysNo.Value);

            //1.只有在配置单状态变为运行或作废状态时才处理和Combo的交互
            //2.用户配置单不处理Combo
            if ((msg.Status != ComputerConfigStatus.Running && msg.Status != ComputerConfigStatus.Void) ||
                oldEntity.CustomerSysNo > 0)
            {
                return;
            }
            ComboStatus comboTargetStatus = ComboStatus.Deactive;

            if (msg.Status == ComputerConfigStatus.Running)
            {
                comboTargetStatus = ComboStatus.Active;
            }
            var comboBizProcessor = ObjectFactory <ComboProcessor> .Instance;
            var comboSysNo        = _configDA.GetComboSysNo(msg.SysNo.Value);

            if (comboSysNo > 0)
            {
                //Combo已存在,更新Combo状态
                comboBizProcessor.UpdateStatus(comboSysNo, comboTargetStatus);
            }
            else if (msg.Status != ComputerConfigStatus.Void)//作废时候同步状态不新增
            {
                //创建Combo
                ComboInfo comboInfo = new ComboInfo();
                comboInfo.CompanyCode    = msg.CompanyCode;
                comboInfo.WebChannel     = msg.WebChannel;
                comboInfo.IsShowName     = false;
                comboInfo.Name           = new LanguageContent(msg.ComputerConfigName.Length > 12 ? msg.ComputerConfigName.Substring(0, 12) : msg.ComputerConfigName);
                comboInfo.ReferenceSysNo = msg.SysNo;
                comboInfo.ReferenceType  = 2;
                comboInfo.SaleRuleType   = ComboType.Common;
                comboInfo.Status         = ComboStatus.Active;
                comboInfo.Priority       = msg.Priority;
                comboInfo.Items          = new List <ComboItem>();
                foreach (var c in msg.ConfigItemList)
                {
                    if (c.ProductSysNo > 0) //bug 95303 一个配置单有很多配件 不是每一个配件都必选
                    {
                        ComboItem item = new ComboItem();
                        item.ProductSysNo    = c.ProductSysNo;
                        item.Quantity        = c.ProductQty;
                        item.ProductUnitCost = c.UnitCost;
                        item.ProductID       = c.ProductID;
                        item.ProductName     = c.ProductName;
                        item.Discount        = c.Discount;
                        item.IsMasterItemB   = msg.ComputerConfigName == "CPU";
                        comboInfo.Items.Add(item);
                    }
                }
                comboBizProcessor.CreateCombo(comboInfo);
            }
        }
        public static string ToComboStatusText(ComboStatus comboStatus)
        {
            switch (comboStatus)
            {
            case ComboStatus.AllJustice:
                return(COMBO_STATUS_ALL_JUSTICE_TEXT);

            case ComboStatus.FullCombo:
                return(COMBO_STATUS_FULL_COMBO_TEXT);
            }

            return(COMBO_STATUS_NONE_TEXT);
        }
Пример #7
0
        private async Task LoadStatusLookupAsync()
        {
            ComboStatus.Clear();
            ComboStatus.Add(new NullLookupItem {
                DisplayMember = " - "
            });
            var combolookup1 = await _lookupDataService.GetComboLookupAsync(ComboGroups.Status);

            foreach (var item in combolookup1)
            {
                ComboStatus.Add(item);
            }
        }
Пример #8
0
        private void ckbSelectAllRow_Click(object sender, RoutedEventArgs e)
        {
            CheckBox chk  = (CheckBox)sender;
            dynamic  rows = this.dataComboList.ItemsSource;

            if (rows != null)
            {
                foreach (dynamic row in rows)
                {
                    ComboStatus status = ComboStatus.Active;
                    Enum.TryParse <ComboStatus>(row.Status.ToString(), out status);

                    if (status == ComboStatus.Active)
                    {
                        row.IsChecked = chk.IsChecked.Value ? true : false;
                    }
                }
            }
        }
Пример #9
0
        /// <summary>
        /// 仅仅更新状态,不做任何检查,主要是为外部系统提供服务
        /// </summary>
        /// <param name="sysNo"></param>
        /// <param name="targetStatus"></param>
        public virtual void UpdateStatus(int?sysNo, ComboStatus targetStatus)
        {
            TransactionScopeFactory.TransactionAction(() =>
            {
                _da.UpdateStatus(sysNo, targetStatus);
                //更新活动状态
                //ObjectFactory<ComboPromotionEngine>.Instance.UpdateComboActivityStatus(sysNo.Value, targetStatus);

                // 发送待办消息
                switch (targetStatus)
                {
                // 待审核
                case ComboStatus.WaitingAudit:
                    EventPublisher.Publish <ComboSaleSubmitMessage>(new ComboSaleSubmitMessage
                    {
                        ComboSaleSysNo   = sysNo.Value,
                        CurrentUserSysNo = ServiceContext.Current.UserSysNo
                    });
                    break;

                // 有效
                case ComboStatus.Active:
                    EventPublisher.Publish <ComboSaleActiveMessage>(new ComboSaleActiveMessage
                    {
                        ComboSaleSysNo   = sysNo.Value,
                        CurrentUserSysNo = ServiceContext.Current.UserSysNo
                    });
                    break;

                // 无效
                case ComboStatus.Deactive:
                    EventPublisher.Publish <ComboSaleAuditRefuseMessage>(new ComboSaleAuditRefuseMessage
                    {
                        ComboSaleSysNo   = sysNo.Value,
                        CurrentUserSysNo = ServiceContext.Current.UserSysNo
                    });
                    break;
                }
            });
        }
Пример #10
0
        public virtual void ApproveCombo(int?sysNo, ComboStatus targetStatus)
        {
            //Check审核人与创建人不能相同
            if (sysNo == null)
            {
                //throw new BizException("更新失败,参数有误!");
                throw new BizException(ResouceManager.GetMessageString("MKT.Combo", "Combo_ArgsError"));
            }
            ComboInfo oldEntity = _da.Load(sysNo.Value);

            //if (oldEntity.Status == ComboStatus.WaitingAudit && oldEntity.CreateUserSysNo == ServiceContext.Current.UserSysNo)
            //{
            //    throw new BizException(string.Format("{0} 创建人与审核人不能相同", oldEntity.Name));
            //}

            TransactionScopeFactory.TransactionAction(() =>
            {
                this.UpdateStatus(sysNo, targetStatus);
                //更新活动状态
                //ObjectFactory<ComboPromotionEngine>.Instance.UpdateComboActivityStatus(sysNo.Value, targetStatus);
            });
        }
        public static double GetOverPower(double baseRating, int score, ComboStatus comboStatus)
        {
            var playRating = GetPlayRating(baseRating, score, true);

            if (playRating <= 0)
            {
                return(0);
            }

            var basePoint = playRating;

            if (score >= GetBorderScore(Rank.Max))
            {
                basePoint += 0.25m;
            }
            else
            {
                switch (comboStatus)
                {
                case ComboStatus.AllJustice:
                    basePoint += 0.2m;
                    break;

                case ComboStatus.FullCombo:
                    basePoint += 0.1m;
                    break;
                }
            }

            var overPower = basePoint * 5;

            if (score < GetBorderScore(Rank.S))
            {
                overPower = Math.Floor(overPower * 100) / 100;
            }

            return((double)overPower);
        }
Пример #12
0
 private static void AssertUnit(
     Unit unit,
     int id,
     string name,
     string genre,
     Difficulty difficulty,
     int score,
     Rank rank,
     bool isClear,
     ComboStatus comboStatus,
     ChainStatus chainStatus)
 {
     Assert.IsNotNull(unit);
     Assert.AreEqual(id, unit.Id, "ID");
     Assert.AreEqual(name, unit.Name, "楽曲名");
     Assert.AreEqual(genre, unit.Genre, "ジャンル");
     Assert.AreEqual(difficulty, unit.Difficulty, "難易度");
     Assert.AreEqual(score, unit.Score, "スコア");
     Assert.AreEqual(rank, unit.Rank, "ランク");
     Assert.AreEqual(isClear, unit.IsClear, "クリア");
     Assert.AreEqual(comboStatus, unit.ComboStatus, "コンボランプ");
     Assert.AreEqual(chainStatus, unit.ChainStatus, "チェインランプ");
 }
Пример #13
0
 public void UpdateComboStatus()
 {
     if (Combo < 10)
     {
         ComboStatus = ComboStatus.Combo0;
     }
     else if (Combo < 30)
     {
         ComboStatus = ComboStatus.Combo10;
     }
     else if (Combo < 50)
     {
         ComboStatus = ComboStatus.Combo30;
     }
     else if (Combo < 100)
     {
         ComboStatus = ComboStatus.Combo50;
     }
     else
     {
         ComboStatus = ComboStatus.Combo100;
     }
 }
 public void ApproveOptionalAccessories(int?sysNo, ComboStatus targetStatus)
 {
     _processor.ApproveOptionalAccessories(sysNo, targetStatus);
 }
Пример #15
0
 public void ApproveCombo(int sysNo, ComboStatus targetStatus)
 {
     _processor.ApproveCombo(sysNo, targetStatus);
 }
Пример #16
0
 /// <summary>
 /// 仅仅更新状态,不做任何检查,主要是为外部系统提供服务
 /// </summary>
 /// <param name="sysNo"></param>
 /// <param name="targetStatus"></param>
 public void UpdateStatus(int sysNo, ComboStatus targetStatus)
 {
     _processor.UpdateStatus(sysNo, targetStatus);
 }