Ejemplo n.º 1
0
        private void GetListQueryData()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                bool   bResult = false;
                string strErr  = string.Empty;

                bResult = Basic_Func.GetPreparationList(ref lstPreparation, _preparation, ref strErr);
                ckLstBoxPreparation.DataSource    = lstPreparation;
                ckLstBoxPreparation.DisplayMember = "pCode";
                ckLstBoxPreparation.ValueMember   = "bid";

                bResult = Basic_Func.GetBuildingList(ref lstBuilding, _building, ref strErr);
                lstBoxBuilding.DataSource    = lstBuilding;
                lstBoxBuilding.DisplayMember = "bName";
                lstBoxBuilding.ValueMember   = "bNo";

                if (!bResult || !string.IsNullOrEmpty(strErr))
                {
                    Common.Common_Func.ErrorMessage(strErr, "查询失败");
                }
            }
            catch (Exception ex)
            {
                Common.Common_Func.ErrorMessage(ex.Message, "查询失败");
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Ejemplo n.º 2
0
        private void BindComboBoxs()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                Building _building = new Building();

                bool   bResult = false;
                string strErr  = string.Empty;

                bResult = Basic_Func.GetBuildingList(ref _lstBuilding, _building, ref strErr);

                cbbBuildingLst.DataSource    = _lstBuilding;
                cbbBuildingLst.DisplayMember = "bName";
                cbbBuildingLst.ValueMember   = "ID";

                if (_preparation.bid != 0)
                {
                    for (int i = 0; i < _lstBuilding.Count - 1; i++)
                    {
                        if (_lstBuilding[i].ID == _preparation.bid)
                        {
                            cbbBuildingLst.SelectedIndex = i;
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Common.Common_Func.ErrorMessage(ex.Message, "查询失败");
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }