public MemberGrade(int argJiFen) { enumGradeLevel objLevel = GetGradeLevel(argJiFen); enumSpeed objSpeed = GetSpeed(objLevel); m_objGrade = new MemberGradeEntity(objLevel, GetNextGradeLevel(objLevel), argJiFen, objSpeed); }
public MemberGradeEntity(enumGradeLevel argGradeName, enumGradeLevel argNextGradeName, int argJiFen, enumSpeed argSpeed) { gradeId = 0; gradeLevel = argGradeName; start = 0; end = 0; nextGradeLevel = argNextGradeName; jiFen = argJiFen; speed = argSpeed; }
public bool GenerateResult() { /** * 方鼎银行贵金属购买凭证 * * 销售单号:0000001 日期:2019-07-02 15:00:00 * 客户卡号:6236609999 会员姓名:马丁 客户等级:金卡 累计积分:19720 * * 商品及数量 单价 金额 * (001001)世园会五十国钱币册x2, 998.00, 1996.00 * (001002)2019北京世园会纪念银章大全40gx3, 1380.00, 4140.00 * (002002)中国经典钱币套装x1, 998.00, 998.00 * (002003)中国银象棋12gx5, 698.00, 3490.00 * 合计:10624.00 * * 优惠清单: * (001002)2019北京世园会纪念银章大全40g: -414.00 * (002003)中国银象棋12g: -350.00 * 优惠合计:764.00 * * 应收合计:9860.00 * 收款: * 9折券 * 余额支付:9860.00 * * 客户等级与积分: * 新增积分:9860 * 恭喜您升级为金卡客户! * * ***/ string strGoods = ""; string strDiscounts = ""; double totalPayPrice = 0.0f; double totalDiscountPrice = 0.0f; for (int i = 0; i < m_objSalesGoods.Count; ++i) { Goods goods = m_objSalesGoods[i]; strGoods += string.Format("({0}){1}x{2}, {3}, {4}", goods.GoodsNo, goods.GoodsName, goods.Number, goods.Price, (goods.TotalPrice + goods.DiscountPrice).ToString("F")); if (goods.DiscountPrice > 0.0f) { strDiscounts += string.Format("({0}){1}: -{2}", goods.GoodsNo, goods.GoodsName, goods.DiscountPrice.ToString("F")); if (i + 1 < m_objSalesGoods.Count) { strDiscounts += "\r\n"; } } if (i + 1 < m_objSalesGoods.Count) { strGoods += "\r\n"; } totalPayPrice += goods.TotalPrice; totalDiscountPrice += goods.DiscountPrice; } m_swWriter.WriteLine("方鼎银行贵金属购买凭证"); m_swWriter.WriteLine(""); m_swWriter.WriteLine(string.Format("销售单号:{0} 日期:{1}", m_objOrderInfo.orderId, m_objOrderInfo.createTime)); enumGradeLevel gradeLevel = m_objCurMember.JiFen.GetGradeLevel(); enumSpeed speed = m_objCurMember.JiFen.GetSpeed(); int jiFen = 0; switch (speed) { case enumSpeed.SPEED1: jiFen = (int)(totalPayPrice * 1); break; case enumSpeed.SPEED1_5: jiFen = (int)(totalPayPrice * 1.5); break; case enumSpeed.SPEED1_8: jiFen = (int)(totalPayPrice * 1.8); break; case enumSpeed.SPEED2: jiFen = (int)(totalPayPrice * 2); break; default: jiFen = (int)(totalPayPrice * 1); break; } m_objCurMember.JiFen.AddJiFen(jiFen); m_swWriter.WriteLine(string.Format("客户卡号:{0} 会员姓名:{1} 客户等级:{2} 累计积分:{3}", m_objCurMember.CardNo, m_objCurMember.Name, m_objCurMember.JiFen.GetGradeName(gradeLevel), m_objCurMember.JiFen.GetJiFen())); m_swWriter.WriteLine(""); m_swWriter.WriteLine("商品及数量 单价 金额"); m_swWriter.WriteLine(strGoods); m_swWriter.WriteLine("合计:" + (totalPayPrice + totalDiscountPrice).ToString("F")); m_swWriter.WriteLine(""); m_swWriter.WriteLine("优惠清单:"); m_swWriter.WriteLine(strDiscounts); m_swWriter.WriteLine("优惠合计:" + totalDiscountPrice.ToString("F")); m_swWriter.WriteLine(""); m_swWriter.WriteLine("应收合计:" + totalPayPrice.ToString("F")); m_swWriter.WriteLine("收款:"); if (m_objOrderInfo.discountCards.Length > 0) { m_swWriter.WriteLine(m_objOrderInfo.discountCards[0]); } m_swWriter.WriteLine("余额支付:" + totalPayPrice.ToString("F")); m_swWriter.WriteLine(""); m_swWriter.WriteLine("客户等级与积分:"); m_swWriter.WriteLine("新增积分:" + jiFen); enumGradeLevel newgradeLevel = m_objCurMember.JiFen.GetGradeLevel(m_objCurMember.JiFen.GetJiFen()); if (newgradeLevel == m_objCurMember.JiFen.GetNextGradeLevel()) { m_swWriter.WriteLine("恭喜您升级为{0}客户!", m_objCurMember.JiFen.GetGradeName(newgradeLevel)); } m_swWriter.Flush(); return(true); }