public DiscountProgram CreateDiscountProgram(DiscountProgramBean bean) { DiscountProgram beanBack = new DiscountProgram(); beanBack.DiscountId = bean.DiscountId; beanBack.Code = bean.Code; beanBack.Name = bean.Name; beanBack.ByDish = bean.ByDish; beanBack.Rate = bean.Rate; beanBack.CreateDatetime = bean.CreateDatetime; beanBack.CreateBy = bean.CreateBy; beanBack.Deleted = bean.Deleted; beanBack.Status = bean.Status; beanBack.UpdateDatetime = bean.UpdateDatetime; beanBack.UpdateBy = bean.UpdateBy; return(beanBack); }
//主窗体初始化 public DisCountViewModel(IDiscountDataService dataService) { _DataService = dataService; //查询折扣方案绑定grid ProgramV = new ObservableCollection<DiscountProgramBean>(); DetailV = new ObservableCollection<DiscountDetailBean>(); List<DiscountProgram> dis = _DataService.queryAll(); bool a = dis != null; if (a) { foreach (var d in dis) { DiscountProgramBean bean = new DiscountProgramBean(); bean = bean.CreateDiscountProgramBean(d); Line = Line + 1; ProgramV.Add(new DiscountProgramBean { LineNumber = Line, DiscountId = bean.DiscountId, Code = bean.Code, Name = bean.Name, ByDish = bean.ByDish, Rate = bean.Rate }); } } }
public DiscountProgram CreateDiscountProgram(DiscountProgramBean bean) { DiscountProgram beanBack = new DiscountProgram(); beanBack.DiscountId = bean.DiscountId; beanBack.Code = bean.Code; beanBack.Name = bean.Name; beanBack.ByDish = bean.ByDish; beanBack.Rate = bean.Rate; beanBack.CreateDatetime = bean.CreateDatetime; beanBack.CreateBy = bean.CreateBy; beanBack.Deleted = bean.Deleted; beanBack.Status = bean.Status; beanBack.UpdateDatetime = bean.UpdateDatetime; beanBack.UpdateBy = bean.UpdateBy; return beanBack; }