Пример #1
0
        /// <summary>
        /// BIND DATA TO WORKSHOP
        /// </summary>
        private bool BindDataToLookUpEditContol(int parentLevel)
        {
            DataSet dataSet = new DataSet();


            #region leWorkShop() List

            this.leWorkShop.Properties.DisplayMember = FMM_LOCATION_FIELDS.FIELD_LOCATION_NAME;     //LOCATION_NAME
            this.leWorkShop.Properties.ValueMember   = FMM_LOCATION_FIELDS.FIELD_LOCATION_KEY;      //LOCATION_KEY

            #endregion

            //get bind data 获取绑定数据,传入参数值parentLevel为0初始值 1工厂 2楼层 5车间
            dataSet = _locationEntity.GetWorkshopBindData(parentLevel);


            if (_locationEntity.ErrorMsg != "")
            {
                MessageBox.Show(StringParser.Parse("${res:FanHai.Hemera.Addins.EMS.LocationCtrl.MsgLocationInitializeFailure}"));
                return(false);
            }
            else
            {
                if (dataSet.Tables.Contains(FMM_LOCATION_FIELDS.DATABASE_TABLE_NAME))
                {
                    leWorkShop.Properties.DataSource = dataSet.Tables[FMM_LOCATION_FIELDS.DATABASE_TABLE_NAME];
                }
            }
            return(true);
        }