コード例 #1
0
ファイル: UnitTest3.cs プロジェクト: WISD/WisdCar
        public void TestMethod2()
        {
            RechargeVO entity = new RechargeVO();
            entity.ActualRechargeAmount = 200;
            entity.ClubCardID = 4;
            entity.ClubCardNo = "00001";
            entity.ClubCardPackageID = "1";

            entity.CreatedDate = DateTime.Now;
            entity.CreatorID = "001";
            entity.LastModifiedDate = DateTime.Now;
            entity.LastModifierID = "002";
            entity.LogicalStatus = 1;
            entity.CustID = 1;
            entity.CustName = "qingsong";
            entity.DiscountInfo = "sssss";
            entity.DiscountRate = 0.5M;
            entity.OriginalStore = "minangqu";
            entity.PayType = 0;
            entity.PlatformRechargeAmount = 400;
            entity.RechargeDate = DateTime.Now;
            entity.RechargeStore = "xuhui";
            entity.RechargeType = 0;
            entity.SalesMan = "songge";
            entity.RechargeSerialNo = "11101010101";

            //VO to PO
            Mapper.CreateMap<RechargeVO, RechargeLogPO>().ForMember(dest => dest.RechargeSerialNo, opt => opt.MapFrom(src => src.RechargeSerialNo));

            Mapper.CreateMap<ClubCardPO, ClubCardVO>().IgnoreUnmappedProperties();
            Mapper.CreateMap<PackageVO, PackagePO>();
            Mapper.CreateMap<PackagePO, PackageVO>().IgnoreUnmappedProperties();

            Mapper.CreateMap<IDataReader, PackageItemMappingPO>();
            Mapper.CreateMap<PackageItemMappingPO, PkgItemVO>();

            RechargeMgm clubMgm = new RechargeMgm();

            clubMgm.RechargePkg(entity);
        }
コード例 #2
0
ファイル: RechargeLogController.cs プロジェクト: WISD/WisdCar
        public JsonResult GetRechargeLogList()
        {
            ReturnedData data = new ReturnedData();
            try
            {
                string custName = NullHelper.Convert<string>(Request["Name"], "");
                string cardNo = NullHelper.Convert<string>(Request["CardNo"], "");
                string reStroe = NullHelper.Convert<string>(Request["Dore"], "");
                string beginDate = NullHelper.Convert<string>(Request["from"], null);
                string endDate = NullHelper.Convert<string>(Request["to"], null);
                string creator = NullHelper.Convert<string>(Request["Operator"], "");

                RechargeMgm recMgm = new RechargeMgm();
                RechargeLogQueryEntity entity = new RechargeLogQueryEntity()
                {
                    CustName=custName,
                    Creator=creator,
                    ClubCardNO=cardNo,
                    StoreID=reStroe,
                    StartDate=string.IsNullOrEmpty(beginDate)?null:(DateTime?)Convert.ToDateTime(beginDate),
                    EndDate = string.IsNullOrEmpty(endDate)? null : (DateTime?)Convert.ToDateTime(endDate)
                };

                var list = recMgm.GetRechargeCashLog(entity);
                data.Success = true;
                data.Data = list;
            }
            catch(Exception ex)
            {
                data.Success = false;
                data.Message = "出现错误,请联系维护人员";
                LogHandler.Error(ex.Message.ToString());
                data.Error = ex.ToString();
            }
            return Json(data, JsonRequestBehavior.AllowGet);
        }
コード例 #3
0
ファイル: RechargeController.cs プロジェクト: WISD/WisdCar
        public JsonResult RechargeCashSub()
        {
            ReturnedData data = new ReturnedData();

            try
            {
                string cardno = NullHelper.Convert<string>(Request["cno"], "");
                decimal rechargeAmount = NullHelper.Convert<decimal>(Request["rechargeAcc"], 0M);
                decimal rechargeDiscount = NullHelper.Convert<decimal>(Request["discount"], 0M);
                IClubCardMgm cardMgm = new ClubCardMgm();

                var card = cardMgm.GetClubCardByCardNo(cardno);
                RechargeVO recharge = new RechargeVO();
                recharge.ClubCardID = card.ClubCardID;
                recharge.ClubCardNo = card.ClubCardNo;
                recharge.ActualRechargeAmount = rechargeAmount;
                recharge.CustID = card.CustomerID;
                recharge.CustName = card.CustName;
                recharge.DiscountRate = rechargeDiscount;
                if (rechargeDiscount == 0)
                {
                    rechargeDiscount = 1;
                }
                recharge.PlatformRechargeAmount =Math.Round(rechargeAmount/ rechargeDiscount,2);
                recharge.RechargeDate = DateTime.Now;
                recharge.RechargeStore = Emp.StroeName;
                recharge.OriginalStore = card.OpenCardStore;
                recharge.PayType = (int)PayType.Cash;
                recharge.LastModifierID = Emp.UserName;
                recharge.LastModifiedDate = DateTime.Now;
                recharge.CreatedDate = DateTime.Now;
                recharge.CreatorID = Emp.UserName;
                recharge.DiscountInfo = "会员现金折扣";
                recharge.ClubCardPackageID = "";
                recharge.RechargeType = (int)RechargeType.ClubCash;
                recharge.RechargeSerialNo = SerialNoGenerator.GenRechargeSerialNo(Emp.StoreId);
                recharge.SalesMan = card.SalesMan;

                IRechargeMgm rechargeMgm = new RechargeMgm();
                rechargeMgm.RechargeCash(recharge);
                data.Success = true;
                Session.Add("recharge", recharge);
            }
            catch (Exception ex)
            {
                data.Success = false;
                data.Error = ex.ToString();
                data.Message = "充值失败";

            }

            return Json(data,JsonRequestBehavior.AllowGet);
        }
コード例 #4
0
ファイル: RechargeController.cs プロジェクト: WISD/WisdCar
        public JsonResult RechargePkgSub()
        {
            ReturnedData data = new ReturnedData();
            try
            {
                string cardNo = NullHelper.Convert<string>(Request["cardNo"], null);
                int pkgId = NullHelper.Convert<int>(Request["pkgId"], -1);
                decimal disCount = NullHelper.Convert<decimal>(Request["disCount"], 0M);
                decimal rechAmount = NullHelper.Convert<decimal>(Request["rechAmount"], 0M);
                decimal pkgPrice = NullHelper.Convert<decimal>(Request["pkgPrice"], 0M);
                IClubCardMgm cardMgm = new ClubCardMgm();
                RechargeMgm rechMgm = new RechargeMgm();

                var card = cardMgm.GetClubCardByCardNo(cardNo);
                RechargeVO recharge = new RechargeVO();
                recharge.ClubCardID = card.ClubCardID;
                recharge.ClubCardNo = card.ClubCardNo;
                recharge.ActualRechargeAmount = rechAmount;
                recharge.CustID = card.CustomerID;
                recharge.CustName = card.CustName;
                recharge.DiscountRate = disCount;
                recharge.Reserved1 = card.ClubCardTypeName;

                recharge.PlatformRechargeAmount = pkgPrice;
                recharge.RechargeDate = DateTime.Now;
                recharge.RechargeStore = Emp.StroeName;
                recharge.OriginalStore = card.OpenCardStore;
                recharge.PayType = (int)PayType.Cash;
                recharge.LastModifierID = Emp.UserName;
                recharge.LastModifiedDate = DateTime.Now;
                recharge.CreatedDate = DateTime.Now;
                recharge.CreatorID = Emp.UserName;
                recharge.DiscountInfo = "会员套餐折扣";
                recharge.ClubCardPackageID =pkgId.ToString();
                recharge.RechargeType = (int)RechargeType.ClubPackage;
                recharge.RechargeSerialNo = SerialNoGenerator.GenRechargeSerialNo(Emp.StoreId);
                recharge.SalesMan = card.SalesMan;

                var reMes= rechMgm.RechargePkg(recharge);
                if (reMes == 1)
                {
                    Session.Add("rehPkg", recharge);
                    data.Success = true;
                    data.Message = "套餐购买成功";
                }
                else
                {
                    data.Success = false;
                    data.Message = "套餐购买失败";
                }

            }
            catch(Exception ex)
            {
                data.Success = false;
                data.Message = "系统错误,请联系维护人员";
                data.Error = ex.ToString();
                LogHandler.Error(ex.Message.ToString());
            }
            return Json(data,JsonRequestBehavior.AllowGet);
        }
コード例 #5
0
ファイル: UnitTest3.cs プロジェクト: WISD/WisdCar
 public void TestMethod1()
 {
     RechargeMgm clubMgm = new RechargeMgm();
     RechargeVO entity = new RechargeVO();
     clubMgm.RechargeCash(entity);
 }