protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { if (!int.TryParse(this.Page.Request.QueryString["preSaleId"], out this.preSaleId)) { base.GotoResourceNotFound(); } else { ProductPreSaleInfo preSaleInfoWithNameAndPrice = ProductPreSaleHelper.GetPreSaleInfoWithNameAndPrice(this.preSaleId); if (preSaleInfoWithNameAndPrice != null) { this.lblProductName.Text = preSaleInfoWithNameAndPrice.ProductName; this.lblSalePrice.Text = "¥" + preSaleInfoWithNameAndPrice.SalePrice.F2ToString("f2"); if (preSaleInfoWithNameAndPrice.DepositPercent > 0) { this.lblDeposit.Text = preSaleInfoWithNameAndPrice.DepositPercent + "% (¥" + Math.Round(preSaleInfoWithNameAndPrice.SalePrice * (decimal)preSaleInfoWithNameAndPrice.DepositPercent / 100m, 2) + ")"; } else if (preSaleInfoWithNameAndPrice.Deposit > decimal.Zero) { this.lblDeposit.Text = "¥" + preSaleInfoWithNameAndPrice.Deposit.ToString(); } Label label = this.lblPreSaleEndDate; DateTime dateTime = preSaleInfoWithNameAndPrice.PreSaleEndDate; label.Text = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); Label label2 = this.lblPaymentStartDate; dateTime = preSaleInfoWithNameAndPrice.PaymentStartDate; label2.Text = dateTime.ToString("yyyy-MM-dd"); Label label3 = this.lblPaymentEndDate; dateTime = preSaleInfoWithNameAndPrice.PaymentEndDate; label3.Text = dateTime.ToString("yyyy-MM-dd"); if (preSaleInfoWithNameAndPrice.DeliveryDays > 0) { this.lblDelivery.Text = "尾款支付后" + preSaleInfoWithNameAndPrice.DeliveryDays.ToString() + "天发货"; } else if (preSaleInfoWithNameAndPrice.DeliveryDate.HasValue) { Label label4 = this.lblDelivery; dateTime = preSaleInfoWithNameAndPrice.DeliveryDate.Value; label4.Text = dateTime.ToString("yyyy-MM-dd"); } } else { base.GotoResourceNotFound(); } } } }
protected void Page_Load(object sender, EventArgs e) { this.btnAddPreSale.Click += this.btnAddPreSale_Click; this.PreSaleEndDate.CalendarParameter["format"] = "yyyy-mm-dd hh:ii:00"; this.PreSaleEndDate.CalendarParameter["minView"] = "0"; if (!base.IsPostBack) { if (!int.TryParse(this.Page.Request.QueryString["preSaleId"], out this.preSaleId)) { base.GotoResourceNotFound(); } else { if (ProductPreSaleHelper.IsPreSaleHasOrder(this.preSaleId)) { this.ShowMsg("该预售已产生订单,不能修改!", false, "ProductPreSale.aspx"); } ProductPreSaleInfo preSaleInfoWithNameAndPrice = ProductPreSaleHelper.GetPreSaleInfoWithNameAndPrice(this.preSaleId); if (preSaleInfoWithNameAndPrice != null) { HiddenField hiddenField = this.hidPreSaleId; int num = preSaleInfoWithNameAndPrice.PreSaleId; hiddenField.Value = num.ToString(); HiddenField hiddenField2 = this.hidProductId; num = preSaleInfoWithNameAndPrice.ProductId; hiddenField2.Value = num.ToString(); this.hidProductName.Value = preSaleInfoWithNameAndPrice.ProductName; this.hidSalePrice.Value = preSaleInfoWithNameAndPrice.SalePrice.F2ToString("f2"); if (preSaleInfoWithNameAndPrice.DepositPercent > 0) { this.radDepositPercent.Checked = true; TextBox textBox = this.txtDepositPercent; num = preSaleInfoWithNameAndPrice.DepositPercent; textBox.Text = num.ToString(); } else if (preSaleInfoWithNameAndPrice.Deposit > decimal.Zero) { this.radDeposit.Checked = true; this.txtDeposit.Text = preSaleInfoWithNameAndPrice.Deposit.ToString(); } this.PreSaleEndDate.SelectedDate = preSaleInfoWithNameAndPrice.PreSaleEndDate; this.PaymentStartDate.SelectedDate = preSaleInfoWithNameAndPrice.PaymentStartDate; this.PaymentEndDate.SelectedDate = preSaleInfoWithNameAndPrice.PaymentEndDate; if (preSaleInfoWithNameAndPrice.DeliveryDays > 0) { this.radDeliveryDays.Checked = true; TextBox textBox2 = this.txtDeliveryDays; num = preSaleInfoWithNameAndPrice.DeliveryDays; textBox2.Text = num.ToString(); } else if (preSaleInfoWithNameAndPrice.DeliveryDate.HasValue) { this.radDeliveryDate.Checked = true; this.DeliveryDate.SelectedDate = preSaleInfoWithNameAndPrice.DeliveryDate; } } else { base.GotoResourceNotFound(); } } } }