예제 #1
0
        private CountdownInfoVM InitParam(bool _isPromotionSchedule)
        {
            CountdownInfoVM vm = new CountdownInfoVM();

            vm.IsPromotionSchedule = _isPromotionSchedule;

            // 以下为初始化时的默认值
            vm.StartTime = DateTime.Parse(DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") + " 00:00:00");

            if (vm.IsPromotionSchedule)
            {
                vm.Status = CountdownStatus.Init;//促销计划初始状态为  初始
            }
            else
            {
                vm.Status  = CountdownStatus.Ready;//限时抢购初始状态为 就绪
                vm.EndTime = DateTime.Parse(DateTime.Now.AddDays(1).ToShortDateString() + " 23:59:59");
            }
            vm.BaseLine    = "5";
            vm.CompanyCode = CPApplication.Current.CompanyCode;

            //vm.IsReservedQty = true;
            vm.MaxPerOrder = "5";
            vm.ChannelID   = "1";
            return(vm);
        }
예제 #2
0
 private void ButtonNew_Click(object sender, RoutedEventArgs e)
 {
     _ViewModel       = InitParam(_OP.StartsWith("sd"));
     this.DataContext = _ViewModel;
     cbReserveInventory_Checked(null, null);
     //ButtonSave.IsEnabled = true;
 }
예제 #3
0
        /// <summary>
        /// 创建
        /// </summary>
        /// <param name="CountdownVM"></param>
        /// <param name="callback"></param>
        public void Create(CountdownInfoVM CountdownVM, EventHandler <RestClientEventArgs <CountdownInfo> > callback)
        {
            var data = CountdownVM.ConvertVM <CountdownInfoVM, CountdownInfo>((v, en) =>
            {
            });

            string relativeUrl = "/MKTService/Countdown/Create";

            restClient.Create <CountdownInfo>(relativeUrl, data, callback);
        }
예제 #4
0
        /// <summary>
        /// 加载分仓数量列表
        /// </summary>
        public void GetGrossMargin(CountdownInfoVM CountdownVM, EventHandler <RestClientEventArgs <GrossMarginMsg> > callback)
        {
            var data = CountdownVM.ConvertVM <CountdownInfoVM, CountdownInfo>((v, en) =>
            {
                en.WebChannel = new BizEntity.Common.WebChannel()
                {
                    ChannelID = v.ChannelID
                };
            });
            string relativeUrl = "/MKTService/Countdown/GetGrossMargin";

            restClient.Query <GrossMarginMsg>(relativeUrl, data, callback);
        }
예제 #5
0
        /// <summary>
        /// 批量作废
        /// </summary>
        /// <param name="sysNoList"></param>
        /// <param name="callback"></param>
        public void Void(CountdownInfoVM CountdownVM, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            var data = CountdownVM.ConvertVM <CountdownInfoVM, CountdownInfo>((v, en) =>
            {
                en.WebChannel = new BizEntity.Common.WebChannel()
                {
                    ChannelID = v.ChannelID
                };
            });

            string relativeUrl = "/MKTService/Countdown/Abandon";

            restClient.Update(relativeUrl, data, callback);
        }
예제 #6
0
        public void CheckOptionalAccessoriesInfoMsg(CountdownInfoVM CountdownVM, EventHandler <RestClientEventArgs <string> > callback)
        {
            var data = CountdownVM.ConvertVM <CountdownInfoVM, CountdownInfo>((v, en) =>
            {
                en.WebChannel = new BizEntity.Common.WebChannel()
                {
                    ChannelID = v.ChannelID
                };
            });

            string relativeUrl = "/MKTService/Countdown/CheckOptionalAccessoriesInfoMsg";

            restClient.Update <string>(relativeUrl, data, callback);
        }
예제 #7
0
        /// <summary>
        /// 加载
        /// </summary>
        /// <param name="sysNo"></param>
        /// <param name="callback"></param>
        public void Load(int sysNo, EventHandler <RestClientEventArgs <CountdownInfoVM> > callback)
        {
            string relativeUrl = string.Format("/MKTService/CountdownInfo/{0}", sysNo);

            restClient.Query <CountdownInfo>(relativeUrl, (o, arg) =>
            {
                CountdownInfoVM countdownInfoVM = arg.Result.Convert <CountdownInfo, CountdownInfoVM>((entity, vm) =>
                {
                    vm.StartTime = entity.StartTime;
                    vm.EndTime   = entity.EndTime;
                });

                callback(o, new RestClientEventArgs <CountdownInfoVM>(countdownInfoVM, _Page));
            });
        }
예제 #8
0
        public override void OnPageLoad(object sender, EventArgs e)
        {
            base.OnPageLoad(sender, e);
            if (!string.IsNullOrEmpty(this.Request.Param))
            {
                _OP = this.Request.Param;
            }
            this.ucItemMaster.ProductSelected += new EventHandler <ProductSelectedEventArgs>(ucItemMaster_ProductSelected);
            _Facade = new CountdownFacade(this);

            LoadChannel();
            if (int.TryParse(_OP, out _SysNo))
            {
                _Facade.Load(_SysNo, (o, args) =>
                {
                    if (!args.FaultsHandle())
                    {
                        _ViewModel = args.Result;
                        _ViewModel.StatusVisibility = true;
                        this.DataContext            = _ViewModel;
                        ucItemMaster.SetProductSysNo(int.Parse(_ViewModel.ProductSysNo));
                        GetProductDetail();
                        SetStockQty();
                        _ViewModel.ChannelID = "1";
                        if (_ViewModel.Status == CountdownStatus.Interupt || _ViewModel.Status == CountdownStatus.Finish || _ViewModel.Status == CountdownStatus.Abandon || _ViewModel.Status == CountdownStatus.WaitForVerify || _ViewModel.Status == CountdownStatus.WaitForPrimaryVerify)
                        {
                            SetAllReadOnlyOrEnable();
                        }
                        if (_ViewModel.Status == CountdownStatus.WaitForVerify || _ViewModel.Status == CountdownStatus.WaitForPrimaryVerify)
                        {
                            txtVerifyMemo.IsEnabled  = true;
                            txtVerifyMemo.IsReadOnly = false;
                        }
                    }

                    this.Title = _ViewModel.IsPromotionScheduleStr + ResCountdownMaintain.Msg_Maintain;
                    #region 促销计划
                    if (_ViewModel.IsPromotionSchedule)
                    {
                        _ViewModel.IsHomePageShow = false;
                        txtQuickTimes.Visibility  = Visibility.Collapsed;
                        lstQuickTimes.Visibility  = Visibility.Collapsed;
                    }
                    #endregion
                });
            }
            else
            {
                _ViewModel = InitParam(_OP.StartsWith("sd"));
                #region 促销计划
                if (_ViewModel.IsPromotionSchedule)
                {
                    rbIsNeedVerify.IsChecked   = true;
                    txtIsNeedSubmit.Visibility = Visibility.Collapsed;
                    ButtonFormClear.Visibility = Visibility.Visible;
                    txtQuickTimes.Visibility   = Visibility.Collapsed;
                    lstQuickTimes.Visibility   = Visibility.Collapsed;
                }
                #endregion
                this.DataContext = _ViewModel;
                this.Title       = _ViewModel.IsPromotionScheduleStr + ResCountdownMaintain.Msg_Maintain;
            }
        }
예제 #9
0
 /// <summary>
 /// 加载毛利率相关
 /// </summary>
 /// <param name="CountdownVM"></param>
 /// <param name="callback"></param>
 public void LoadMarginRateInfo(CountdownInfoVM CountdownVM, EventHandler <RestClientEventArgs <string> > callback)
 {
 }