Exemplo n.º 1
0
    private void SetSize(BillState state)
    {
        float t_height = startingHeight;
        float t_width  = startingWidth;

        switch (state)
        {
        case BillState.Normal:
            break;

        case BillState.CrouchedOnLand:
            t_height = startingHeight / 4f;
            t_width  = startingWidth * 2.8f;
            break;

        case BillState.CrouchedInWater:
            t_height = startingHeight / 10f;
            break;

        case BillState.InWater:
            t_height = startingHeight / 2f;
            break;

        case BillState.Jumping:
            t_height = startingHeight / 2f;
            break;
        }

        SetSizeHelper(t_height, t_width);
    }
Exemplo n.º 2
0
        public static void UpdateState(SpareEntities db, TB_BILL bill, BillState state)
        {
            bill.State = (int)state;//更新【单据】状态为:完成
            OperateType operType;

            switch (state)
            {
            case BillState.New:
            case BillState.Handling:
                bill.StartTime = DateTime.Now.ToString(SysConfig.LongTimeString);
                operType       = OperateType.Update;
                break;

            case BillState.Finished:
                bill.FinishTime = DateTime.Now.ToString(SysConfig.LongTimeString);
                operType        = OperateType.Finish;
                break;

            case BillState.Cancelled:
                bill.FinishTime = DateTime.Now.ToString(SysConfig.LongTimeString);
                operType        = OperateType.Cancel;
                break;

            default:
                bill.StartTime = DateTime.Now.ToString(SysConfig.LongTimeString);
                operType       = OperateType.Update;
                break;
            }
            AddOrUpdate(db, bill);
            BillLogController.Add(db, bill, bill.OperName, operType); //创建【单据日志】
        }
Exemplo n.º 3
0
        public static void UpdateState(SpareEntities db, TB_BILL bill, BillState state)
        {
            bill.State = (int)state;//更新【单据】状态为:完成
            OperateType operType;

            switch (state)
            {
            case BillState.New:
            case BillState.Handling:
                operType = OperateType.Update;
                break;

            case BillState.Finished:
                operType = OperateType.Finish;
                break;

            case BillState.Cancelled:
                operType = OperateType.Cancel;
                break;

            default:
                operType = OperateType.Update;
                break;
            }
            BillLogController.Add(db, bill, bill.OperName, operType); //创建【单据日志】
        }
Exemplo n.º 4
0
        protected override DataTemplate SelectTemplateCore(object item, DependencyObject container)
        {
            if (DesignMode.DesignModeEnabled)
            {
                return(OverdueBillItemTemplate);
            }

            BillState state = (item as Bill).State;

            switch (state)
            {
            case BillState.OVERDUE:
                return(OverdueBillItemTemplate);

            case BillState.CLOSED:
                return(ClosedBillItemTemplate);

            case BillState.OPEN:
                return(OpenBillItemTemplate);

            case BillState.FUTURE:
                return(FutureBillItemTemplate);

            default:
                return(OverdueBillItemTemplate);   // base.SelectTemplateCore(item, container);
            }
        }
Exemplo n.º 5
0
    public Color GetBillColor(BillState state)
    {
        switch (state)
        {
        case BillState.None: {
            return(defaultBillColor);
        }

        case BillState.Done: {
            return(doneBillColor);
        }

        case BillState.Debt: {
            return(debtBillColor);
        }

        case BillState.Waiting: {
            return(wattingBillColor);
        }

        case BillState.Cancel: {
            return(cancelBillColor);
        }

        default: {
            return(defaultBillColor);
        }
        }
    }
Exemplo n.º 6
0
 public CityBill(CityOffice givenOwner, BillAction requestedAction, BillObject requestedTarget)
 {
     owners = new Stack <CityOffice>();
     owners.Push(givenOwner);
     state  = BillState.Proposed;
     action = requestedAction;
     target = requestedTarget;
 }
Exemplo n.º 7
0
 public SoaCellViewerVM(LeaseDTO leaseDTO, DateTime businessDate, BillState billState, ITenantDBsDir args) : base(args)
 {
     Lease       = leaseDTO;
     Date        = businessDate;
     Bill        = billState;
     Adjustments = new AdjustmentsListVM(Lease.Id, Bill.BillCode, Date, AppArgs);
     Adjustments.TotalSumChanged += (s, e) => ReturnDialogResult(true);
 }
Exemplo n.º 8
0
        private void HandleKeyboardInput()
        {
            if (inputHelper.IsNewKeyPress(Keys.Escape))
            {
                Exit();
            }

            billState = BillState.IDLE;
            if (inputHelper.IsKeyDown(Keys.Space) && !inputHelper.IsNewKeyPress(Keys.Space))
            {
                billState = BillState.FIGHT_STANCE;
            }

            if (inputHelper.IsKeyDown(Keys.Right))
            {
                billState            = BillState.WALKING;
                billPosition.X      += 5f;
                titlePosition.X     += 5f;
                frameratePosition.X += 5f;
                cameraPosition.X    -= 5f;
                rectangle1.X        += 5;
                rectangle2.X        += 5;
            }
            else if (inputHelper.IsKeyDown(Keys.Left))
            {
                billPosition.X      -= 5f;
                titlePosition.X     -= 5f;
                frameratePosition.X -= 5f;
                cameraPosition.X    += 5f;
                rectangle1.X        -= 5;
                rectangle2.X        -= 5;
                billState            = BillState.WALKING;
            }

            if (inputHelper.IsKeyDown(Keys.Down))
            {
                billPosition.Y += 5f;
                billState       = BillState.WALKING;
                //cameraPosition.Y -= 5f;
            }
            else if (inputHelper.IsKeyDown(Keys.Up))
            {
                billPosition.Y -= 5f;
                billState       = BillState.WALKING;
                //cameraPosition.Y += 5f;
            }

            if (inputHelper.IsNewKeyPress(Keys.Space))
            {
                billState = BillState.ATTACKING;
            }

            view = Matrix.CreateTranslation(new Vector3(cameraPosition - screenCenter, 0f)) * Matrix.CreateTranslation(new Vector3(screenCenter, 0f));
        }
Exemplo n.º 9
0
 public decimal GetTotalDue(LeaseDTO lse, BillState state, DateTime date)
 {
     if (state == null)
     {
         return(GetRegularDue(lse, date));
     }
     else
     {
         return((state.OpeningBalance ?? 0)
                + state.TotalPenalties
                + state.TotalAdjustments
                + GetRegularDue(lse, date));
     }
 }
Exemplo n.º 10
0
        public BillState ComputeBill(BillCode billCode, LeaseDTO lease, DateTime date, decimal?previousBalance)
        {
            var composr = GetBillComposer(billCode);
            var state   = new BillState
            {
                BillCode       = billCode,
                OpeningBalance = previousBalance,
                Penalties      = composr.ComputePenalties(lease, date, previousBalance),
                Payments       = composr.ReadPayments(lease, date),
                Adjustments    = composr.ReadAdjustments(lease, date),
            };

            state.ClosingBalance = composr.ComputeClosingBalance(lease, state, date);
            return(state);
        }
Exemplo n.º 11
0
        public override decimal ComputeClosingBalance(LeaseDTO lse, BillState billState, DateTime date)
        {
            switch (lse.Rent.PenaltyRule)
            {
                case RentPenalty.DailySurcharge:
                case RentPenalty.DailySurcharge_NoRoundOff:
                case RentPenalty.MonthlySurcharge:
                case RentPenalty.ZeroSurcharge:
                    return base.ComputeClosingBalance(lse, billState, date);

                case RentPenalty.ZeroBackrent:
                    return 0.0M;

                default:
                    throw Fault.BadArg(nameof(lse.Rent.PenaltyRule), lse.Rent.PenaltyRule);
            }
        }
Exemplo n.º 12
0
    private void SetState(BillState state)
    {
        switch (state)
        {
        case BillState.Normal:
            onFloor   = !isFallingThrough;
            inWater   = false;
            isJumping = false;
            break;

        case BillState.CrouchedOnLand:
            isCrouched = true;
            break;

        case BillState.CrouchedInWater:
            isCrouched = true;
            break;

        case BillState.InWater:
            inWater          = true;
            onFloor          = false;
            isFallingThrough = false;
            isCrouched       = false;


            if (currentState != BillState.CrouchedInWater)
            {
                stopMoving = true;
                Invoke("StartMovingInWater", 0.5f);
                SetSize(BillState.CrouchedInWater);
            }
            break;

        case BillState.Jumping:
            onFloor    = false;
            isJumping  = true;
            isCrouched = false;
            break;
        }

        if (!stopMoving)
        {
            SetSize(state);
        }
        currentState = state;
    }
Exemplo n.º 13
0
    protected virtual void Respawn()
    {
        vel          = Vector2.zero;
        onFloor      = false;
        currentState = BillState.Null;
        SetState(BillState.Jumping);
        if (inWater)
        {
            // ScaleUp();
            inWater = false;
        }

        transform.position = spawner.transform.position;

        leftOrRight = 1;
        StartCoroutine(Blink(invincibleSeconds));
        gun = new BasicGun(this);
    }
Exemplo n.º 14
0
        /// <summary>
        /// Checks for at least one filter in the GetCustomer request.
        /// See GetCustomer Post https://developers.neto.com.au/documentation/engineers/api-documentation/customers/getcustomer
        /// </summary>
        /// <returns>bool</returns>
        internal override bool isValid()
        {
            if (DateAddedFrom != DateTime.MinValue)
            {
                return(true);
            }

            if (DateAddedTo != DateTime.MinValue)
            {
                return(true);
            }

            if (DateUpdatedFrom != DateTime.MinValue)
            {
                return(true);
            }

            if (DateUpdatedTo != DateTime.MinValue)
            {
                return(true);
            }

            int requiredFilterCount = Username.NullSafeLength() +
                                      Type.NullSafeLength() +
                                      Active.NullSafeLength() +
                                      Email.NullSafeLength() +
                                      Company.NullSafeLength() +
                                      OnCreditHold.NullSafeLength() +
                                      NewsletterSubscriber.NullSafeLength() +
                                      UserGroup.NullSafeLength() +
                                      BillState.NullSafeLength();


            if (requiredFilterCount != 0)
            {
                return(true);
            }

            throw new NetoRequestException("At least one filter is required in the GetCustomer request");
        }
Exemplo n.º 15
0
 public void Begin()
 {
     state = BillState.InProgress;
 }
Exemplo n.º 16
0
	protected virtual void Respawn() {
		vel = Vector2.zero;
		onFloor = false;
		currentState = BillState.Null;
		SetState (BillState.Jumping);
		if (inWater) {
			// ScaleUp();
			inWater = false;
		}

		transform.position = spawner.transform.position;

		leftOrRight = 1;
		StartCoroutine(Blink(invincibleSeconds));
		gun = new BasicGun (this);
	}
Exemplo n.º 17
0
	private void SetSize(BillState state) {
		float t_height = startingHeight;
		float t_width = startingWidth;

		switch (state) {
			case BillState.Normal:
				break;
			case BillState.CrouchedOnLand:
				t_height = startingHeight / 4f;
				t_width = startingWidth * 2.8f;
				break;
			case BillState.CrouchedInWater:
				t_height = startingHeight / 10f;
				break;
			case BillState.InWater:
				t_height = startingHeight / 2f;
				break;
			case BillState.Jumping:
				t_height = startingHeight / 2f;
				break;
		}

		SetSizeHelper(t_height, t_width);
	}
Exemplo n.º 18
0
	private void SetState (BillState state) {

		switch (state) {
		case BillState.Normal:
			onFloor = !isFallingThrough;
			inWater = false;
			isJumping = false;
			break;
		case BillState.CrouchedOnLand:
			isCrouched = true;
			break;
		case BillState.CrouchedInWater:
			isCrouched = true;
			break;
		case BillState.InWater:
			inWater = true;
			onFloor = false;
			isFallingThrough = false;
			isCrouched = false;


			if (currentState != BillState.CrouchedInWater) {
				stopMoving = true;
				Invoke("StartMovingInWater", 0.5f);
				SetSize (BillState.CrouchedInWater);
			}
			break;
		case BillState.Jumping:
			onFloor = false;
			isJumping = true;
			isCrouched = false;
			break;
		}

		if (!stopMoving) SetSize (state);
		currentState = state;
	}
Exemplo n.º 19
0
 public virtual decimal ComputeClosingBalance(LeaseDTO lse, BillState billState, DateTime date)
 => GetTotalDue(lse, billState, date) - billState.TotalPayments;
Exemplo n.º 20
0
 public void Finish()
 {
     state = BillState.Complete;
     AssignBack();
 }
Exemplo n.º 21
0
    public List <DropDownListItem> GetListItemStateBill(List <DropDownListItem> items, BillState state)
    {
        items = dropDownListItems;
        switch (state)
        {
        case BillState.None: {
            items[0].IsDisabled = true;
            items[1].IsDisabled = false;
            items[2].IsDisabled = false;
            items[3].IsDisabled = false;
            items[4].IsDisabled = false;
            break;
        }

        case BillState.Done: {
            items[0].IsDisabled = true;
            items[1].IsDisabled = true;
            items[2].IsDisabled = true;
            items[3].IsDisabled = true;
            items[4].IsDisabled = true;
            break;
        }

        case BillState.Debt: {
            items[0].IsDisabled = true;
            items[1].IsDisabled = false;
            items[2].IsDisabled = true;
            items[3].IsDisabled = true;
            items[4].IsDisabled = true;
            break;
        }

        case BillState.Waiting: {
            items[0].IsDisabled = true;
            items[1].IsDisabled = false;
            items[2].IsDisabled = false;
            items[3].IsDisabled = true;
            items[4].IsDisabled = true;
            break;
        }

        case BillState.Cancel: {
            items[0].IsDisabled = true;
            items[1].IsDisabled = false;
            items[2].IsDisabled = false;
            items[3].IsDisabled = false;
            items[4].IsDisabled = true;
            break;
        }

        default: {
            items[0].IsDisabled = true;
            items[1].IsDisabled = false;
            items[2].IsDisabled = false;
            items[3].IsDisabled = false;
            items[4].IsDisabled = false;
            break;
        }
        }
        items[0].IsDisabled = false;
        items[1].IsDisabled = false;
        items[2].IsDisabled = false;
        items[3].IsDisabled = false;
        items[4].IsDisabled = false;
        return(items);
    }
Exemplo n.º 22
0
 public SettledBill(BillState state)
 {
     this.Bill = state.Bill;
 }
Exemplo n.º 23
0
 public void Reject()
 {
     state = BillState.Proposed;
     AssignBack();
 }
        public IActionResult Unifiedorder(UnidiedorderData udata)
        {
            using (_dbContext)
            {
                var response = ResponseModelFactory.CreateResultInstance;

                var stu = _dbContext.StudentBill.FirstOrDefault(x => x.StudentBillUuid == udata.BillGuid);


                if (stu == null)
                {
                    response.SetFailed("未查找到对应缴费信息");
                    return(Ok(response));
                }
                if (stu.OrderMoney >= stu.AmountPayable)
                {
                    response.SetFailed("已缴费");
                    return(Ok(response));
                }

                //时间戳
                string timeStamp = TenPayV3Util.GetTimestamp();
                //随机字符串
                string nonceStr = TenPayV3Util.GetNoncestr();
                string appid    = "wx0bf342f51437ca67";

                //获取学校绑定商户信息
                var school = _dbContext.School.FirstOrDefault(x => x.SchoolUuid == udata.Guid);
                if (school == null)
                {
                    response.SetFailed("未查找到对应学校");
                    return(Ok(response));
                }
                if (school.Yard == null || school.Secretkey == null)
                {
                    response.SetFailed("未查找到对应学校商户信息");
                    return(Ok(response));
                }


                //商户号
                string mch_id = school.Yard;                                                 //"1600884893";
                //商户支付秘钥
                string partnerKey = AES.AesDecrypt(school.Secretkey, HaiKan3.Utils.AES.Key); //"ew6QCdWiDfcif902EbC07dh0icTuM5le";
                //签名
                string sign      = "";
                string sign_type = "MD5";

                //商品描述
                string body = udata.Body;
                //商户订单号
                string out_trade_no = "";
                //标价金额(单位:分)
                int total_fee = udata.Totalfee;
                //终端IP
                //string spbill_create_ip = "183.158.56.51"; //Request.HttpContext.Connection.RemoteIpAddress.ToString();
                string spbill_create_ip = Request.HttpContext.Connection.RemoteIpAddress.ToString();
                _logger.LogInformation("ip:" + spbill_create_ip);
                //通知地址
                string notify_url = "http://msz-b.jiulong.yoruan.com/test/PayCallBack";
                //string notify_url = "http://msz-b.jiulong.yoruan.com/api/v1/student/StudentBill/PayCallBack";
                //交易类型
                string trade_type = "JSAPI";
                //预支付id
                string prepayId = "";
                //微信调用支付的签名
                string paySign = "";
                //用户openid
                string     openid = udata.Openid;
                Store_Info info   = new Store_Info()
                {
                    address   = "xxxxxx",
                    area_code = "330185",
                    id        = "MSZzf" + appid,
                    name      = "码上知支付商城",
                };
                TenPayV3UnifiedorderRequestData_SceneInfo sceneInfo = new TenPayV3UnifiedorderRequestData_SceneInfo(false);
                sceneInfo.store_info = info;

                //生成订单号
                out_trade_no = DateTime.Now.ToString("yyyyMMddHHmmss") + TenPayV3Util.BuildRandomStr(14);
                _logger.LogInformation("订单号:" + out_trade_no);


                TenPayV3UnifiedorderRequestData requestData = new TenPayV3UnifiedorderRequestData(appid, mch_id, body, out_trade_no, total_fee, spbill_create_ip, notify_url, Senparc.Weixin.TenPay.TenPayV3Type.JSAPI, openid, partnerKey, nonceStr, null, DateTime.Now, DateTime.Now.AddHours(2), null, null, "CNY", null, null, false, sceneInfo, null);

                var urlFormat = ReurnPayApiUrl("https://api.mch.weixin.qq.com/{0}pay/unifiedorder");
                var data      = requestData.PackageRequestHandler.ParseXML();//获取XML
                _logger.LogInformation("xml:" + data);
                var str = PostXmlMethod.PostXmla(urlFormat, data);
                _logger.LogInformation("postxml:" + str);

                DataSet       ds     = new DataSet();
                StringReader  stream = new StringReader(str);     //读取字符串为数据量
                XmlTextReader reader = new XmlTextReader(stream); //对XML的数据流的只进只读访问
                ds.ReadXml(reader);                               //把数据读入DataSet

                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (ds.Tables[0].Rows[0]["return_code"].ToString() == "SUCCESS")
                    {
                        _logger.LogInformation("成功");
                        _logger.LogInformation("timeStamp:" + timeStamp + "; nonceStr:" + nonceStr + "; prepayId:" + ds.Tables[0].Rows[0]["prepay_id"].ToString() + "; paySign:" + ds.Tables[0].Rows[0]["sign"].ToString() + "; partnerKey:" + partnerKey);
                        response.SetData(new { appid = ds.Tables[0].Rows[0]["appid"].ToString(), timeStamp, nonceStr, prepayId = ds.Tables[0].Rows[0]["prepay_id"].ToString(), sign_type, paySign = ds.Tables[0].Rows[0]["sign"].ToString(), sjcode = Electroniccode.getString(32), key = partnerKey, outtradeno = out_trade_no });
                        BillState bill = new BillState()
                        {
                            BillUuid  = Guid.NewGuid(),
                            BillNum   = out_trade_no,
                            Appid     = appid,
                            MchId     = mch_id,
                            Money     = total_fee,
                            Key       = partnerKey,
                            SbillUuid = udata.BillGuid,
                        };
                        _logger.LogInformation("订单记录:" + JsonConvert.SerializeObject(bill));
                        _dbContext.BillState.Add(bill);
                        _dbContext.SaveChanges();
                        return(Ok(response));
                    }
                    else
                    {
                        response.SetFailed(ds.Tables[0].Rows[0]["return_msg"].ToString());
                        _logger.LogInformation("异常");
                        _logger.LogInformation(ds.Tables[0].Rows[0]["return_msg"].ToString());
                        return(Ok(response));
                    }
                }
                else
                {
                    response.SetFailed("订单信息为空");
                    return(Ok(response));
                }
            }
        }
Exemplo n.º 25
0
 public static bool? Show(LeaseDTO leaseDTO, DateTime businessDate, BillState billState, ITenantDBsDir args)
     => new SoaCellViewerVM(leaseDTO, businessDate, billState, args).Show<SoaCellViewerWindow>(showModal: true);