| | |
| | | |
| | | namespace Gs.DevApp.UserControl |
| | | { |
| | | public partial class UcComBox : DevExpress.XtraEditors.XtraUserControl |
| | | public partial class UcComBox : XtraUserControl |
| | | { |
| | | private string _Text = "-请选择-"; |
| | | |
| | | private string _Value = "0"; |
| | | |
| | | public UcComBox() |
| | | { |
| | | InitializeComponent(); |
| | |
| | | txt_isStatus.Properties.Items.Add(new CboItemEntity("-1", "不正常")); |
| | | } |
| | | |
| | | private string _Value = "0"; |
| | | private string _Text = "-请选择-"; |
| | | |
| | | /// <summary> |
| | | /// 显示值 |
| | | /// 显示值 |
| | | /// </summary> |
| | | public string Txt |
| | | { |
| | | get { return this.txt_isStatus.Text.ToString(); } |
| | | set { this._Text = value; } |
| | | get => txt_isStatus.Text; |
| | | set => _Text = value; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 对象值 |
| | | /// 对象值 |
| | | /// </summary> |
| | | public string Val |
| | | { |
| | | get |
| | | { |
| | | switch (this.txt_isStatus.SelectedIndex) |
| | | switch (txt_isStatus.SelectedIndex) |
| | | { |
| | | case 0: |
| | | return "0"; |
| | |
| | | } |
| | | set |
| | | { |
| | | this._Value = value; |
| | | _Value = value; |
| | | if (!string.IsNullOrEmpty(value)) |
| | | { |
| | | switch (int.Parse(value)) |
| | | { |
| | | case 0: |
| | | this.txt_isStatus.SelectedIndex=0; |
| | | txt_isStatus.SelectedIndex = 0; |
| | | break; |
| | | case 1: |
| | | this.txt_isStatus.SelectedIndex = 1; |
| | | txt_isStatus.SelectedIndex = 1; |
| | | break; |
| | | case -1: |
| | | this.txt_isStatus.SelectedIndex = 2; |
| | | txt_isStatus.SelectedIndex = 2; |
| | | break; |
| | | default: |
| | | this.txt_isStatus.SelectedIndex = 0; |
| | | txt_isStatus.SelectedIndex = 0; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | // return this.Text.ToString(); |
| | | //} |
| | | } |
| | | } |
| | | } |