lu
2025-02-14 e97f3a0b90112386f96def011c6d4864d974594a
DevApp/Gs.DevApp/UserControl/UcLookHuoZhu.cs
@@ -18,18 +18,24 @@
            get;
            set;
        }
        public string HzId
        {
            get;
            set;
        }
        public bool IsReadly { get; set; }
        public UcLookHuoZhu()
        {
            InitializeComponent();
            txt_qt018.Properties.NullText = "请选择";
            this.txt_qt025.SelectedIndexChanged += (s, e) =>
            txt_hzabc.Properties.NullText = "请选择";
            this.txt_hzlxabc.SelectedIndexChanged += (s, e) =>
            {
                int _strType = txt_qt025.SelectedIndex;
                txt_hzabc.EditValue = null;
                int _strType = txt_hzlxabc.SelectedIndex;
                string _orgId = OrgId;
                this.searchLookUpEdit1View.Columns.Clear();
                txt_qt018.Properties.DataSource = null;
                txt_hzabc.Properties.DataSource = null;
                if (_strType <= 0) return;
                string _strMeth = "";
                string _DisplayMember = "";
@@ -150,11 +156,13 @@
                    var strReturn = UtilityHelper.HttpPost("", _strMeth, json);
                    var rtn = UtilityHelper.ReturnToTablePage(strReturn);
                    var dt = rtn.rtnData.list;
                    txt_qt018.Properties.DataSource = dt;
                    txt_qt018.Properties.DisplayMember = _DisplayMember;
                    txt_qt018.Properties.ValueMember = _ValueMember;
                    txt_qt018.ForceInitialize();
                    txt_qt018.Properties.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
                    txt_hzabc.Properties.DataSource = dt;
                    txt_hzabc.Properties.DisplayMember = _DisplayMember;
                    txt_hzabc.Properties.ValueMember = _ValueMember;
                    txt_hzabc.ForceInitialize();
                    txt_hzabc.Properties.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
                    if (!string.IsNullOrEmpty(HzId))
                        SetHzId(HzId);
                }
                catch (Exception ex)
                {
@@ -169,10 +177,10 @@
        /// <returns></returns>
        public string GetHzId()
        {
            var row2 = txt_qt018.GetSelectedDataRow() as DataRowView;
            var row2 = txt_hzabc.GetSelectedDataRow() as DataRowView;
            if (row2 != null)
            {
                string inHz = txt_qt025.SelectedIndex > 1 ? row2["Id"].ToString() : row2["fid"].ToString();
                string inHz = txt_hzlxabc.SelectedIndex > 1 ? row2["Id"].ToString() : row2["fid"].ToString();
                return inHz;
            }
            return "";
@@ -183,9 +191,9 @@
        /// <returns></returns>
        public string GetHzLx()
        {
            if (txt_qt025.SelectedIndex <= 0)
            if (txt_hzlxabc.SelectedIndex <= 0)
                return "";
            string id = txt_qt025.Text.Trim();
            string id = txt_hzlxabc.Text.Trim();
            return id;
        }
@@ -198,18 +206,22 @@
        {
            if (Code == "-1" || string.IsNullOrEmpty(Code))
            {
                txt_qt018.EditValue = null;
                txt_hzabc.EditValue = null;
                return;
            }
            txt_qt018.EditValue = Int64.Parse(((Code.ToString().Trim())));
            txt_hzabc.EditValue = Int64.Parse(((Code.ToString().Trim())));
            txt_hzabc.Text = Code;
        }
        /// <summary>
        /// 设置
        /// </summary>
        /// <param name="Code"></param>
        public void SetHzLx(int Code)
        public void SetHzLx(string Code)
        {
            txt_qt025.SelectedIndex = Code;
            if (string.IsNullOrEmpty(Code))
                txt_hzlxabc.SelectedIndex = 0;
            else
                txt_hzlxabc.Text = Code;
        }
    }
}