123 lines
3.2 KiB
C#
123 lines
3.2 KiB
C#
using NaiBa.Util.Extension;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace TemuKJD.KJDForms.SalesCenterForms
|
|
{
|
|
public partial class UcActivityDiscountCtrl : UserControl
|
|
{
|
|
public UcActivityDiscountCtrl()
|
|
{
|
|
InitializeComponent();
|
|
this.Load += UcActivityDiscountCtrl_Load;
|
|
}
|
|
|
|
private void UcActivityDiscountCtrl_Load(object sender, EventArgs e)
|
|
{
|
|
if (isLess)
|
|
label1.Text = "<" + discount.ToString().Trim('0');
|
|
else
|
|
label1.Text = discount.ToString().Trim('0').PadLeft(0, ' ').Trim();
|
|
}
|
|
|
|
private bool isLess = false;
|
|
/// <summary>
|
|
/// 折扣数值
|
|
/// </summary>
|
|
[Description("是否小于折扣"), Category("UserProperty")]
|
|
public bool IsLess
|
|
{
|
|
get
|
|
{
|
|
return isLess;
|
|
}
|
|
set
|
|
{
|
|
isLess = value;
|
|
}
|
|
}
|
|
|
|
|
|
private int discount = 90;
|
|
/// <summary>
|
|
/// 折扣数值
|
|
/// </summary>
|
|
[Description("折扣数值"), Category("UserProperty")]
|
|
public int Discount
|
|
{
|
|
get
|
|
{
|
|
return discount;
|
|
}
|
|
set
|
|
{
|
|
if (discount != value)
|
|
{
|
|
discount = value;
|
|
if (isLess)
|
|
label1.Text = "<" + discount.ToString().Trim('0');
|
|
else
|
|
label1.Text = discount.ToString().Trim('0').PadLeft(0, ' ').Trim();
|
|
this.Invalidate();
|
|
}
|
|
}
|
|
}
|
|
|
|
private int inventory = 10;
|
|
/// <summary>
|
|
/// 活动库存
|
|
/// </summary>
|
|
[Description("活动库存"), Category("UserProperty")]
|
|
public int Inventory
|
|
{
|
|
get
|
|
{
|
|
return inventory;
|
|
}
|
|
set
|
|
{
|
|
if (inventory != value)
|
|
{
|
|
inventory = value;
|
|
this.numInventory.Value = inventory;
|
|
this.Invalidate();
|
|
}
|
|
}
|
|
}
|
|
|
|
[Description("默认库存"), Category("UserProperty")]
|
|
public bool IsDefaultInventory
|
|
{
|
|
get
|
|
{
|
|
return this.chkMinInventory.Checked;
|
|
}
|
|
set
|
|
{
|
|
if (this.chkMinInventory.Checked != value)
|
|
{
|
|
this.chkMinInventory.Checked = value;
|
|
this.Invalidate();
|
|
}
|
|
}
|
|
}
|
|
|
|
private void numInventory_ValueChanged(object sender, EventArgs e)
|
|
{
|
|
this.inventory = numInventory.Value.ParseToInt();
|
|
}
|
|
|
|
private void chkDefaultInventory_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
numInventory.Enabled = !chkMinInventory.Checked;
|
|
}
|
|
}
|
|
}
|