public void JisuanInfoTest() { DingdanCreateInfo createInfo = new DingdanCreateInfo(); createInfo.XiadanRiqi = new DateTime(2014, 8, 15); createInfo.JiekuanFangshi = "1个月月结"; createInfo.Kehu = new Kehu(); Dingdan dingdan = new Dingdan(createInfo); DingdanChangeInfo changeInfo = new DingdanChangeInfo(dingdan); DingdanMingxiCreateInfo mingxiCreateInfo = new DingdanMingxiCreateInfo { Dingdan = dingdan, XiaoshouDijia = 9, XiaoshouDanjia = 10, Shuliang = 1000, Yewulv = 0.03, YewulvFangshi = "按金额" }; DingdanMingxi mingxi = new DingdanMingxi(mingxiCreateInfo); changeInfo.MingxiList.Add(mingxi); ShoukuanCreateInfo shoukuanCreateInfo = new ShoukuanCreateInfo { Dingdan = dingdan, ShoukuanJine = 300, ShoukuanRiqi = dingdan.XiadanRiqi }; Shoukuan shoukuan = new Shoukuan(shoukuanCreateInfo); changeInfo.ShoukuanList.Add(shoukuan); dingdan.Change(changeInfo); Assert.AreEqual(10000, mingxi.Zongjine); Assert.AreEqual(300, mingxi.Yewufei); Assert.AreEqual(9.7, Math.Round(mingxi.ShijiDanjia, 2)); Assert.AreEqual(97, Math.Round(mingxi.Butie, 2)); Assert.AreEqual(51, Math.Round(mingxi.Ticheng, 2)); }
public DingdanMingxiDetailsModel JisuanMingxi(DingdanMingxiDetailsModel model) { DingdanMingxi mingxi = this.CreateDingdanMingxi(null, model); mingxi.Jisuan(); return(new DingdanMingxiDetailsModel(mingxi)); }
public void JisuanInfoTest() { DingdanCreateInfo createInfo = new DingdanCreateInfo(); createInfo.XiadanRiqi = new DateTime(2014, 8, 15); createInfo.JiekuanFangshi = "1个月月结"; createInfo.Kehu = new Kehu(); Dingdan dingdan = new Dingdan(createInfo); DingdanChangeInfo changeInfo = new DingdanChangeInfo(dingdan); DingdanMingxiCreateInfo mingxiCreateInfo = new DingdanMingxiCreateInfo { Dingdan = dingdan, XiaoshouDijia = 11, XiaoshouDanjia = 10, Shuliang = 100, Yewulv = 0.2, YewulvFangshi = "按金额" }; DingdanMingxi mingxi = new DingdanMingxi(mingxiCreateInfo); changeInfo.MingxiList.Add(mingxi); ShoukuanCreateInfo shoukuanCreateInfo = new ShoukuanCreateInfo { Dingdan = dingdan, ShoukuanJine = 300, ShoukuanRiqi = dingdan.XiadanRiqi }; Shoukuan shoukuan = new Shoukuan(shoukuanCreateInfo); changeInfo.ShoukuanList.Add(shoukuan); dingdan.Change(changeInfo); Assert.AreEqual(dingdan.JiekuanRiqi, new DateTime(2014, 9, 30)); Assert.AreEqual(dingdan.WeishoukuanJine, 700); Assert.AreEqual(dingdan.YingshoukuanJine, 1000); Assert.AreEqual(dingdan.YishoukuanJine, 300); Assert.AreEqual(dingdan.Ticheng, mingxi.JisuanTicheng(shoukuan.ShoukuanJine, shoukuan.ShoukuanRiqi)); }
private DingdanMingxiDataModel GetMingxiModel(DingdanMingxi mingxi) { DingdanMingxiDataModel model = new DingdanMingxiDataModel(); ClassPropertyHelper.ChangeProperty(model, mingxi); model.ChanpinId = mingxi.Chanpin.Id; return(model); }
public DingdanMingxiBaseModel(DingdanMingxi mingxi) { ClassPropertyHelper.ChangeProperty(this, mingxi); this.danwei = mingxi.Chanpin.Danwei; this.guige = mingxi.Chanpin.Guige; this.xinghao = mingxi.Chanpin.Xinghao; this.chanpin = new ChanpinInputModel(mingxi.Chanpin); }
public DingdanMingxiGridModel(DingdanMingxi mingxi) : base(mingxi) { this.dingdanhao = mingxi.Dingdan.Danhao; this.yewuyuan = mingxi.Dingdan.Yewuyuan.Name; this.fahuoDanhao = mingxi.Dingdan.FahuoDanhao; this.fahuoRiqi = mingxi.Dingdan.FahuoRiqi; this.xiadanRiqi = mingxi.Dingdan.XiadanRiqi; this.kehu = mingxi.Dingdan.Kehu.Name; }
private List <DingdanMingxi> CreateDingdanMingxiList(Dingdan dingdan, List <DingdanMingxiDataModel> models) { List <DingdanMingxi> mingxiList = new List <DingdanMingxi>(); if (models != null) { foreach (DingdanMingxiDataModel model in models) { DingdanMingxiCreateInfo createInfo = new DingdanMingxiCreateInfo(); createInfo.Dingdan = dingdan; createInfo.Chanpin = this._coreManager.ChanpinManager.GetChanpinById(model.ChanpinId); ClassPropertyHelper.ChangeProperty(createInfo, model); DingdanMingxi mingxi = new DingdanMingxi(createInfo); mingxiList.Add(mingxi); } } return(mingxiList); }
public DingdanMingxiDetailsModel(DingdanMingxi mingxi) : base(mingxi) { }