/// <summary> /// 编辑体验券 /// </summary> /// <param name="ex">体验券</param> /// <returns>ResultDesc</returns> public void EditExperience(ExperienceInformation ex) { ExperienceWindow win = new ExperienceWindow() { Owner = Application.Current.MainWindow, CurExperienceInformation = ex, StartDate=ex.StartDate, EndDate=ex.EndDate, EffectiveTime=ex.EffectiveTime }; if (win.ShowDialog() == true) { if (win.CurExperienceInformation != null) { if (win.CurExperienceInformation.Name == "开户送券") win.CurExperienceInformation.Type = 1; else win.CurExperienceInformation.Type = 2; } win.CurExperienceInformation.StartDate = win.StartDate; win.CurExperienceInformation.EndDate = new DateTime(win.EndDate.Year, win.EndDate.Month, win.EndDate.Day, 23, 59, 59); win.CurExperienceInformation.EffectiveTime = new DateTime(win.EffectiveTime.Year, win.EffectiveTime.Month, win.EffectiveTime.Day, 23, 59, 59); ErrType err = _businessService.EditExperience(_loginID, win.CurExperienceInformation); if (err.Err != ERR.SUCCESS) MessageBox.Show("保存体验券失败!", "提示信息", MessageBoxButton.OK, MessageBoxImage.Error); else MessageBox.Show("保存体验券成功!", "提示信息", MessageBoxButton.OK, MessageBoxImage.Information); } }
/// <summary> /// 添加体验券 /// </summary> public ExperienceInformation AddExperience() { ExperienceWindow win = new ExperienceWindow() { Owner=Application.Current.MainWindow, CurExperienceInformation=new ExperienceInformation() }; if (win.ShowDialog() == true) { if (win.CurExperienceInformation != null) { if (win.CurExperienceInformation.Name == "开户送券") win.CurExperienceInformation.Type = 1; else win.CurExperienceInformation.Type = 2; } win.CurExperienceInformation.StartDate = win.StartDate; win.CurExperienceInformation.EndDate = new DateTime(win.EndDate.Year, win.EndDate.Month, win.EndDate.Day,23,59,59); win.CurExperienceInformation.EffectiveTime = new DateTime(win.EffectiveTime.Year, win.EffectiveTime.Month, win.EffectiveTime.Day, 23, 59, 59); ErrType err = _businessService.AddExperience(_loginID,win.CurExperienceInformation); if (err.Err != ERR.SUCCESS) { MessageBox.Show("添加体验券失败!", "提示信息", MessageBoxButton.OK, MessageBoxImage.Error); return null; } } return win.CurExperienceInformation; }