Beispiel #1
0
        public void Bind()
        {
            #region  拉框赋值

            var dic = new QuoteTemplateBLL().GetField();

            // 日期格式
            this.DateFormat.DataTextField  = "show";
            this.DateFormat.DataValueField = "val";
            this.DateFormat.DataSource     = dic.FirstOrDefault(_ => _.Key == "DateFormat").Value;
            this.DateFormat.DataBind();
            this.DateFormat.SelectedIndex = 0;
            //数字格式
            this.NumberFormat.DataTextField  = "show";
            this.NumberFormat.DataValueField = "val";
            this.NumberFormat.DataSource     = dic.FirstOrDefault(_ => _.Key == "NumberFormat").Value;
            this.NumberFormat.DataBind();
            //货币格式(正数)
            this.CurrencyPositivePattern.DataTextField  = "show";
            this.CurrencyPositivePattern.DataValueField = "val";
            this.CurrencyPositivePattern.DataSource     = dic.FirstOrDefault(_ => _.Key == "CurrencyPositivePattern").Value;
            this.CurrencyPositivePattern.DataBind();
            //货币格式(负数)
            this.CurrencyNegativePattern.DataTextField  = "show";
            this.CurrencyNegativePattern.DataValueField = "val";
            this.CurrencyNegativePattern.DataSource     = dic.FirstOrDefault(_ => _.Key == "CurrencyNegativePattern").Value;
            this.CurrencyNegativePattern.DataBind();
            #endregion
        }
Beispiel #2
0
        public void Bind()
        {
            var dic = new QuoteTemplateBLL().GetField();

            //分组
            this.GroupBy.DataTextField  = "show";
            this.GroupBy.DataValueField = "val";
            this.GroupBy.DataSource     = dic.FirstOrDefault(_ => _.Key == "GroupBy").Value;
            this.GroupBy.DataBind();
            this.GroupBy.SelectedIndex = 0;
            //显示
            this.Itemize.DataTextField  = "show";
            this.Itemize.DataValueField = "val";
            this.Itemize.DataSource     = dic.FirstOrDefault(_ => _.Key == "Itemize").Value;
            this.Itemize.DataBind();
            //排序字段
            this.SortBy.DataTextField  = "show";
            this.SortBy.DataValueField = "val";
            this.SortBy.DataSource     = dic.FirstOrDefault(_ => _.Key == "SortBy").Value;
            this.SortBy.DataBind();
            //可选变量
            this.Variable.DataTextField  = "show";
            this.Variable.DataValueField = "val";
            this.Variable.DataSource     = new QuoteTemplateBLL().GetInvoiceBodyVariableField();
            this.Variable.DataBind();
            this.Variable.Items.Insert(0, new ListItem()
            {
                Value = "0", Text = "显示全部变量", Selected = true
            });
            var           list = new QuoteTemplateBLL().GetBodyAllInvoiceVariable();
            StringBuilder sb   = new StringBuilder();

            foreach (string va in list)
            {
                sb.Append("<option class='val' ondblclick='dbclick(this);'>" + va.Replace("'", "") + "</option>");
            }
            this.VariableList.Text       = sb.ToString();
            this.GetVaild.DataTextField  = "show";
            this.GetVaild.DataValueField = "val";
            this.GetVaild.DataSource     = new QuoteTemplateBLL().GetInvoiceBodyVariableField();
            this.GetVaild.DataBind();
            this.GetVaild.Items.Insert(0, new ListItem()
            {
                Value = "0", Text = "显示全部变量", Selected = true
            });
            this.GetVaildlist.Text = sb.ToString();
        }
        /// <summary>
        /// 绑定数据
        /// </summary>
        public void Bind()
        {
            #region  拉框赋值

            var dic = new QuoteTemplateBLL().GetField();

            // 日期格式
            this.DateFormat.DataTextField  = "show";
            this.DateFormat.DataValueField = "val";
            this.DateFormat.DataSource     = dic.FirstOrDefault(_ => _.Key == "DateFormat").Value;
            this.DateFormat.SelectedValue  = data.date_display_format_id.ToString();
            this.DateFormat.DataBind();
            //数字格式
            this.NumberFormat.DataTextField  = "show";
            this.NumberFormat.DataValueField = "val";
            this.NumberFormat.DataSource     = dic.FirstOrDefault(_ => _.Key == "NumberFormat").Value;
            this.NumberFormat.SelectedValue  = data.number_display_format_id.ToString();
            this.NumberFormat.DataBind();
            //货币格式(正数)
            this.CurrencyPositivePattern.DataTextField  = "show";
            this.CurrencyPositivePattern.DataValueField = "val";
            this.CurrencyPositivePattern.DataSource     = dic.FirstOrDefault(_ => _.Key == "CurrencyPositivePattern").Value;
            this.CurrencyPositivePattern.SelectedValue  = data.currency_positive_format_id.ToString();
            this.CurrencyPositivePattern.DataBind();
            //货币格式(负数)
            this.CurrencyNegativePattern.DataTextField  = "show";
            this.CurrencyNegativePattern.DataValueField = "val";
            this.CurrencyNegativePattern.DataSource     = dic.FirstOrDefault(_ => _.Key == "CurrencyNegativePattern").Value;
            this.CurrencyNegativePattern.SelectedValue  = data.currency_negative_format_id.ToString();
            this.CurrencyNegativePattern.DataBind();


            this.Name.Text        = data.name;
            this.Description.Text = data.description;
            if (data.is_active != 1)
            {
                this.Active.Checked = false;
            }
            if (data.show_each_tax_in_tax_group == 1)
            {
                this.show_each_tax_in_tax_group.Checked = true;
            }
            if (data.show_each_tax_in_tax_period == 1)
            {
                this.show_each_tax_in_tax_period.Checked = true;
                k = 1;
            }
            if (data.show_tax_cate == 1)
            {
                this.show_tax_cate.Checked = true;
            }
            if (data.show_tax_cate_superscript == 1)
            {
                this.show_tax_cate_superscript.Checked = true;
            }


            var data_tax = new EMT.Tools.Serialize().DeserializeJson <QuoteTemplateAddDto.Tax_Total_Disp>(data.tax_total_disp);
            this.SemiAnnualTotal.Text             = data_tax.Semi_Annual_Total;
            this.IncludingOptionalQuoteItems.Text = data_tax.Including_Optional_Quote_Items;
            this.ItemTotal.Text               = data_tax.Item_Total;
            this.Subtotal.Text                = data_tax.Subtotal;
            this.Total.Text                   = data_tax.Total;
            this.TotalTaxes.Text              = data_tax.Total_Taxes;
            this.YearlySubtotal.Text          = data_tax.Yearly_Subtotal;
            this.YearlyTotal.Text             = data_tax.Yearly_Total;
            this.ShippingTotal.Text           = data_tax.Shipping_Total;
            this.ShippingSubtotal.Text        = data_tax.Shipping_Subtotal;
            this.SemiAnnualSubtotal.Text      = data_tax.Semi_Annual_Subtotal;
            this.QuarterlySubtotal.Text       = data_tax.Quarterly_Subtotal;
            this.QuarterlyTotal.Text          = data_tax.Quarterly_Total;
            this.MonthlySubtotal.Text         = data_tax.Monthly_Subtotal;
            this.OptionalSubtotal.Text        = data_tax.Optional_Subtotal;
            this.OptionalTotal.Text           = data_tax.Optional_Total;
            this.MonthlyTotal.Text            = data_tax.Monthly_Total;
            this.OneTimeDiscountSubtotal.Text = data_tax.One_Time_Discount_Subtotal;
            this.OneTimeDiscountTotal.Text    = data_tax.One_Time_Discount_Total;
            this.OneTimeSubtotal.Text         = data_tax.One_Time_Subtotal;
            this.OneTimeTotal.Text            = data_tax.One_Time_Total;

            switch (data.page_number_location_id)
            {
            case (int)PAGE_NUMBER_LOCATION.NO: this.showNO.Checked = true; break;

            case (int)PAGE_NUMBER_LOCATION.BOTTOMLEFT: this.showLeft.Checked = true; break;

            case (int)PAGE_NUMBER_LOCATION.BOTTOMCENTER: this.showCenter.Checked = true; break;

            case (int)PAGE_NUMBER_LOCATION.BOTTOMRIGHT: this.showRight.Checked = true; break;
            }

            switch (data.paper_size_id)
            {
            case (int)PAGE_SIZE.LETTER: this.Letter.Checked = true; break;

            case (int)PAGE_SIZE.A4: this.A4.Checked = true; break;
            }

            #endregion
        }