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); }
private void ButtonNew_Click(object sender, RoutedEventArgs e) { _ViewModel = InitParam(_OP.StartsWith("sd")); this.DataContext = _ViewModel; cbReserveInventory_Checked(null, null); //ButtonSave.IsEnabled = true; }
/// <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); }
/// <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); }
/// <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); }
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); }
/// <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)); }); }
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; } }
/// <summary> /// 加载毛利率相关 /// </summary> /// <param name="CountdownVM"></param> /// <param name="callback"></param> public void LoadMarginRateInfo(CountdownInfoVM CountdownVM, EventHandler <RestClientEventArgs <string> > callback) { }