Example #1
0
        /// <summary>
        ///
        /// </summary>
        private void InitForm()
        {
            hfaction.Value = action;

            if (UserInfo != null)
            {
                #region 用户基本信息
                this.lblUserId.Text     = UserInfo.ID.ToString();
                this.lblUserName.Text   = UserInfo.UserName;
                this.lblUserStatus.Text = Enum.GetName(typeof(UserStatusEnum), UserInfo.Status);
                this.lblFullName.Text   = UserInfo.full_name;
                #endregion

                if (UsersAmt != null)
                {
                    #region 用户余额
                    decimal balanceAmt = 0M, freezeAmt = 0M, withdrawingAmt = 0M, detentionAmt = 0M;

                    balanceAmt     = UsersAmt.Balance;
                    freezeAmt      = UsersAmt.Freeze;
                    withdrawingAmt = UsersAmt.Unpayment;

                    detentionAmt = viviapi.BLL.Finance.Trade.GetUserTotalDetentionAmt(UserInfo.ID);

                    balanceAmt = balanceAmt - freezeAmt - withdrawingAmt - detentionAmt;

                    if (balanceAmt < 0M)
                    {
                        balanceAmt = 0M;
                    }

                    lblTotalBalance.Text   = (UsersAmt.Balance).ToString("f2");
                    lblWithdrawingAmt.Text = withdrawingAmt.ToString("f2");
                    lblFreezeAmt.Text      = freezeAmt.ToString("f2");
                    lblBalance.Text        = (balanceAmt).ToString("f2");

                    lblDeposit.Text = detentionAmt.ToString("f2");
                    #endregion
                }

                if (MSettlementAccount != null)
                {
                    #region 结算账号
                    lblStlAcctAccoutType.Text = viviapi.BLL.User.SettlementAccount.GetAccoutTypeName(MSettlementAccount.AccoutType);
                    lblStlAcctPayee.Text      = MSettlementAccount.PayeeName;
                    lblStlAcctBank.Text       = MSettlementAccount.PayeeBank;

                    if (MSettlementAccount.Pmode == 1)
                    {
                        lblSetAcctBankAddress.Text = MSettlementAccount.BankProvince + MSettlementAccount.BankCity + " " + MSettlementAccount.BankAddress;
                    }
                    this.lblStlAcctBankAccout.Text = MSettlementAccount.Account;
                    #endregion
                }
            }

            if (ItemInfo.ID > 0)
            {
                lblTranno.Text         = ItemInfo.Tranno;
                this.lblsettleAmt.Text = ItemInfo.Amount.ToString("f2");
                this.lblAddTime.Text   = FormatConvertor.DateTimeToTimeString(ItemInfo.Addtime);

                lblPayeeName.Text = ItemInfo.PayeeName;
                lblBank.Text      = ItemInfo.PayeeBank;

                lblPayeeaddress.Text = ItemInfo.BankProvince + ItemInfo.BankCity + " " + ItemInfo.Payeeaddress;

                lblAccount.Text = ItemInfo.Account;

                ChargesBox.Text = ItemInfo.Charges.ToString("f2");


                if (ItemInfo.Status != WithdrawStatus.Paying)
                {
                    this.TaxBox.Enabled      = false;
                    this.TaxBox.ReadOnly     = true;
                    this.ChargesBox.Enabled  = false;
                    this.ChargesBox.ReadOnly = true;
                    this.btnSure.Text        = "已支付";
                    this.btnSure.Enabled     = false;
                }
                if (action == "pay")
                {
                    btnSure.Visible = true;
                    btnSave.Visible = false;
                }
                else if (action == "modi")
                {
                    btnSure.Visible = false;
                    btnSave.Visible = true;
                }
            }
        }
Example #2
0
        /// <summary>
        /// 写执行日志文件。
        /// </summary>
        /// <param name="config">配置信息。</param>
        public static void WriteLog(ScheduledTaskConfiguration config)
        {
            if ((config != null) && LogSetting.ScheduledTaskLogEnabled)
            {
                try
                {
                    string str = string.Format("Task\t\t\t\t= {0}\r\nTime              = {1}", config.ScheduledTaskType, FormatConvertor.DateTimeToTimeString(DateTime.Now, true));
                    // LogHelper.Write(LogSetting.ScheduleTaskLogFilePath(DateTime.Today, config), str);

                    log.Info(str);
                }
                catch (Exception exception)
                {
                    ExceptionHandler.HandleException(exception);
                }
            }
        }