Example #1
0
        private void gridDataView_DoubleClick(object sender, EventArgs e)
        {
            //int rowHandle = gridDataView.GetDataRowHandleByGroupRowHandle(gridDataView.FocusedRowHandle);
            int rowHandle = gridDataView.FocusedRowHandle;

            if (rowHandle >= 0)
            {
                string objectname = gridDataView.GetRowCellValue(rowHandle, FMM_PRODUCTION_LINE_FIELDS.FIELD_LINE_NAME).ToString();
                string key        = gridDataView.GetRowCellValue(rowHandle, FMM_PRODUCTION_LINE_FIELDS.FIELD_PRODUCTION_LINE_KEY).ToString();
                if (null == objectname || objectname.Length < 1)
                {
                    return;
                }
                if (null == key || key.Length < 1)
                {
                    return;
                }
                UdaEntity tempEntity = new UdaEntity(objectname);
                tempEntity.ObjectKey   = key;
                tempEntity.LineCode    = gridDataView.GetRowCellValue(rowHandle, FMM_PRODUCTION_LINE_FIELDS.FIELD_LINE_CODE).ToString();
                tempEntity.Description = gridDataView.GetRowCellValue(rowHandle, FMM_PRODUCTION_LINE_FIELDS.FIELD_DESCRIPTIONS).ToString();
                //LineConfViewContent OrderContent = new LineConfViewContent(new UdaEntity(tempEntity.ObjectName));
                //WorkbenchSingleton.Workbench.ShowView(OrderContent);
                _objectEntity = tempEntity;
                //_objCategory = EntityType.Line.ToString();
                //_udaCommonControl = new UdaCommonControlEx(EntityType.Line, _objectEntity.ObjectKey, _objectEntity.LinkedToTable);
                MapAttributeToControl();
                State = ControlState.Edit;
                OnAfterStateChanged(State);
            }
        }
Example #2
0
        public LineConfCtrl(UdaEntity udaEntity, EntityType objectType)
        {
            InitializeComponent();
            //this.gridDataView.DoubleClick += new System.EventHandler(this.gridDataView_DoubleClick);
            _objectEntity = udaEntity;
            _objCategory  = objectType.ToString();

            afterStateChanged += new AfterStateChanged(OnAfterStateChanged);
            if (_objectEntity.ObjectName.Length < 1)
            {
                _udaCommonControl = new UdaCommonControlEx(objectType, "", "");
                _udaCommonControl.UserDefinedAttrs = _objectEntity.UserDefinedAttrsEx;
                State = ControlState.New;
            }
            else
            {
                _udaCommonControl = new UdaCommonControlEx(objectType, _objectEntity.ObjectKey, _objectEntity.LinkedToTable);
                MapAttributeToControl();

                if (_objectEntity.Status == EntityStatus.InActive)
                {
                    State = ControlState.Edit;
                }
                else
                {
                    State = ControlState.ReadOnly;
                }
            }
            _udaCommonControl.Dock = DockStyle.Fill;
            UdaPanel.Controls.Add(_udaCommonControl);
        }
Example #3
0
        /// <summary>
        /// 构造函数。
        /// </summary>
        /// <param name="udaEntity">表示用户自定义属性的实体对象。</param>
        public LineConfViewContent(UdaEntity udaEntity)
            : base()
        {
            if (null != udaEntity && udaEntity.ObjectName.Length > 0)
            {
                //TitleName = "线别维护" + "_" + udaEntity.ObjectName;
                TitleName = StringParser.Parse("${res:FanHai.Hemera.Addins.FMM.LineConfCtrl.title}") + "_" + udaEntity.ObjectName;
            }
            else
            {
                //TitleName = "线别维护";
                TitleName = StringParser.Parse("${res:FanHai.Hemera.Addins.FMM.LineConfCtrl.title}");
            }
            Panel panel = new Panel();

            //set panel dock style
            panel.Dock = DockStyle.Fill;
            //set panel BorderStyle
            panel.BorderStyle = BorderStyle.FixedSingle;
            LineConfCtrl _lineConfCtrl = new LineConfCtrl(udaEntity, EntityType.Line);

            _lineConfCtrl.Dock = DockStyle.Fill;
            //将控件对象加入到Panel中。
            //设置Panel为该视图对象的控件对象,用于在应用程序平台上显示可视化的视图界面。
            panel.Controls.Add(_lineConfCtrl);
            //set panel to view content
            this.control = panel;
        }