Beispiel #1
0
        public bool NASCustomFieldTypeBuiltInSingleSelectionListControlDataViewingState_CRUD()
        {
            NASCustomFieldPredefinitionData predefinitionData =
                NASCustomFieldTypeBuiltInSingleSelectionListStrategy.GetPredefinitionDataOfObject(ObjectCustomFieldId);
            string text = String.Empty;

            if (predefinitionData != null)
            {
                text = predefinitionData.Name == null || predefinitionData.Name.Trim().Length == 0 ?
                       predefinitionData.Code : predefinitionData.Name;
                imgRemove.Visible = true;
            }
            else
            {
                text = "Chỉnh sửa";
                imgRemove.Visible = false;
            }
            hyperlinkBuiltInSingleSelectionListDataViewing.Text = text;

            ObjectCustomField objectCustomField =
                session.GetObjectByKey <ObjectCustomField>(ObjectCustomFieldId);

            //////12/22/2013 Duc.Vo----START
            /// Dump - null object khi ko co du lieu cho CustomFieldType
            ////////////////////////////////
            if (objectCustomField.CustomFieldType == null)
            {
                objectCustomField.CustomFieldType = CustomFieldTypeFlag.CUSTOM_FIELD_TYPE_DEFAULT.Value;
                objectCustomField.Save();
            }
            //////12/22/2013 Duc.Vo----END
            if (objectCustomField.CustomFieldType.Equals(CustomFieldTypeFlag.CUSTOM_FIELD_TYPE_MASTER.Value))
            {
                hyperlinkBuiltInSingleSelectionListDataViewing.Font.Bold = true;
                imgRemove.Visible = false;
            }
            else if (objectCustomField.CustomFieldType.Equals(CustomFieldTypeFlag.CUSTOM_FIELD_TYPE_READONLY.Value))
            {
                hyperlinkBuiltInSingleSelectionListDataViewing.ClientSideEvents.Click = null;
                hyperlinkBuiltInSingleSelectionListDataViewing.Cursor    = "default";
                hyperlinkBuiltInSingleSelectionListDataViewing.ForeColor = Color.Gray;
                imgRemove.Visible = false;
            }
            else if (objectCustomField.CustomFieldType.Equals(CustomFieldTypeFlag.CUSTOM_FIELD_TYPE_MASTER_READONLY.Value))
            {
                hyperlinkBuiltInSingleSelectionListDataViewing.ClientSideEvents.Click = null;
                hyperlinkBuiltInSingleSelectionListDataViewing.Cursor    = "default";
                hyperlinkBuiltInSingleSelectionListDataViewing.ForeColor = Color.Gray;
                hyperlinkBuiltInSingleSelectionListDataViewing.Font.Bold = true;
                imgRemove.Visible = false;
            }

            return(true);
        }
Beispiel #2
0
        public bool NASCustomFieldTypeBuiltInSingleSelectionListControlDataEditingState_CRUD()
        {
            NASCustomFieldPredefinitionData predefinitionData =
                NASCustomFieldTypeBuiltInSingleSelectionListStrategy.GetPredefinitionDataOfObject(ObjectCustomFieldId);

            if (predefinitionData != null)
            {
                cboBuiltInSingleSelectionList.Value = predefinitionData.RefId;
                cboBuiltInSingleSelectionList.DataBindItems();
                //imgRemove.Visible = true;
            }
            else
            {
                cboBuiltInSingleSelectionList.SelectedIndex = -1;
                //imgRemove.Visible = false;
            }
            imgRemove.Visible = false;
            return(true);
        }