Example #1
0
    protected void gvPayoutItem_RowCreated(object sender, GridViewRowEventArgs e)
    {
        switch (e.Row.RowType)
        {
        case DataControlRowType.DataRow:
            RmsPM.Web.UserControls.InputSubject ud_ucPayoutInputSubject = (RmsPM.Web.UserControls.InputSubject)e.Row.FindControl("ucPayoutInputSubject");
            ud_ucPayoutInputSubject.SubjectSetCode = this.txtSubjectSetCode.Value;

            break;
        }
    }
Example #2
0
    protected void gvPayoutItem_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
    {
        switch (e.Row.RowType)
        {
        case DataControlRowType.DataRow:
            DataRowView ud_drvItem = (DataRowView)e.Row.DataItem;

            WebNumericEdit ud_txtPayoutCash         = (WebNumericEdit)e.Row.FindControl("txtPayoutCash");
            WebNumericEdit ud_txtPayoutExchangeRate = (WebNumericEdit)e.Row.FindControl("txtPayoutExchangeRate");
            Label          ud_lblPayoutItemMoney    = (Label)e.Row.FindControl("lblPayoutItemMoney");
            RmsPM.Web.UserControls.InputSubject ud_ucPayoutInputSubject = (RmsPM.Web.UserControls.InputSubject)e.Row.FindControl("ucPayoutInputSubject");

            string ud_sPaymentMoneyType = ud_drvItem["PaymentMoneyType"] == DBNull.Value ? string.Empty : ud_drvItem["PaymentMoneyType"].ToString();

            bool ud_bChecked = false;

            if (ud_drvItem["Checked"] != DBNull.Value && ud_drvItem["Checked"].ToString() == "1")
            {
                ud_bChecked = true;
            }

            if (ud_sPaymentMoneyType == ucExchangeRate.MoneyType)
            {
                ud_txtPayoutExchangeRate.Enabled = false;
            }
            else
            {
                ud_txtPayoutExchangeRate.Enabled = true;
            }


            decimal ud_dePayoutItemMoney = ud_txtPayoutCash.ValueDecimal * ud_txtPayoutExchangeRate.ValueDecimal;

            ud_lblPayoutItemMoney.Text = ud_dePayoutItemMoney.ToString("N");

            break;
        }
    }
Example #3
0
    /// <summary>
    /// 屏幕数据保存到临时表
    /// </summary>
    /// <returns></returns>
    private DataTable ScreenToTable(bool isBindGrid)
    {
//        DataTable ud_dtDtl = RmsPM.BLL.PaymentRule.GeneratePayoutItemTable("");
        DataTable ud_dtDtl = GetDefaultPayoutItemTable();

        RmsPM.BLL.PaymentRule.VoucherDetailAddColumnSubjectName(ud_dtDtl, this.txtSubjectSetCode.Value);
        ud_dtDtl.Columns.Add("SubjectHint", typeof(String));

        decimal ud_dePayoutExchangeRate = ucExchangeRate.ExchangeRate;

        foreach (GridViewRow ud_gvrRow in this.gvPayoutItem.Rows)
        {
            HtmlInputHidden txtSelect          = (HtmlInputHidden)ud_gvrRow.FindControl("txtSelect");
            HtmlInputHidden txtPayoutItemCode  = (HtmlInputHidden)ud_gvrRow.FindControl("txtPayoutItemCode");
            HtmlInputHidden txtPaymentItemCode = (HtmlInputHidden)ud_gvrRow.FindControl("txtPaymentItemCode");
            HtmlInputHidden txtSummary         = (HtmlInputHidden)ud_gvrRow.FindControl("txtSummary");
            HtmlInputHidden txtItemMoney       = (HtmlInputHidden)ud_gvrRow.FindControl("txtItemMoney");
            HtmlInputHidden txtTotalPayoutCash = (HtmlInputHidden)ud_gvrRow.FindControl("txtTotalPayoutCash");
            HtmlInputHidden txtRemainItemCash  = (HtmlInputHidden)ud_gvrRow.FindControl("txtRemainItemCash");
            HtmlInputHidden txtCostCode        = (HtmlInputHidden)ud_gvrRow.FindControl("txtCostCode");
            HtmlInputHidden txtCostName        = (HtmlInputHidden)ud_gvrRow.FindControl("txtCostName");
            HtmlInputHidden txtPaymentID       = (HtmlInputHidden)ud_gvrRow.FindControl("txtPaymentID");


            WebNumericEdit txtPayoutCash = (WebNumericEdit)ud_gvrRow.FindControl("txtPayoutCash");
            RmsPM.Web.UserControls.InputSubject ucPayoutInputSubject = (RmsPM.Web.UserControls.InputSubject)ud_gvrRow.FindControl("ucPayoutInputSubject");
            WebNumericEdit txtPayoutExchangeRate = (WebNumericEdit)ud_gvrRow.FindControl("txtPayoutExchangeRate");


            string ud_sPayoutItemCode       = txtPayoutItemCode.Value;
            string ud_sPayoutItemCodeFilter = string.Format("PayoutItemCode='{0}'", ud_sPayoutItemCode);

            foreach (DataRow dr in ud_dtDtl.Select(ud_sPayoutItemCodeFilter))
            {
                dr["Checked"] = RmsPM.BLL.ConvertRule.ToInt(txtSelect.Value);

                dr["PayoutCash"]   = txtPayoutCash.ValueDecimal;
                dr["MoneyType"]    = dr["PaymentMoneyType"];
                dr["ExchangeRate"] = txtPayoutExchangeRate.ValueDecimal;

                if (ucExchangeRate.MoneyType == "人民币 (RMB)")
                {
                    dr["PayoutMoney"] = txtPayoutCash.ValueDecimal * txtPayoutExchangeRate.ValueDecimal;
                }
                else
                {
                    dr["PayoutMoney"] = txtPayoutCash.ValueDecimal * (decimal)dr["ExchangeRate"];
                }

                dr["PayoutMoneyType"]    = ucExchangeRate.MoneyType;
                dr["PayoutExchangeRate"] = ucExchangeRate.ExchangeRate;

                dr["SubjectCode"] = ucPayoutInputSubject.Value;
                dr["SubjectName"] = ucPayoutInputSubject.Text;
                dr["SubjectHint"] = ucPayoutInputSubject.Hint;
            }
        }

        if (isBindGrid)
        {
            this.BindGridView(ud_dtDtl);
        }

        return(ud_dtDtl);
    }