Ejemplo n.º 1
0
        public static void InitEdit(this RepositoryItemPopupContainerEdit edit, List <GridColumn> columns, object dataSource, string displayName, bool isMarkCheck)
        {
            edit.QueryResultValue += edit_QueryResultValue;
            edit.EditValueChanged += edit_EditValueChanged;
            edit.QueryDisplayText += edit_QueryDisplayText;
            PopupContainerControlExtention sample = new PopupContainerControlExtention(columns, dataSource, displayName, isMarkCheck);

            sample.Tag = edit;
            edit.Properties.PopupControl = sample;
            sample.BindData(dataSource);
        }
Ejemplo n.º 2
0
        public static void InitEdit(this RepositoryItemPopupContainerEdit edit, string layoutEntityName, string filterEntityName, bool isMarkCheck, CriteriaOperator filter)
        {
            edit.QueryResultValue += edit_QueryResultValue;
            edit.EditValueChanged += edit_EditValueChanged;

            edit.QueryDisplayText += edit_QueryDisplayText;
            PopupContainerControlExtention sample = new PopupContainerControlExtention(layoutEntityName, filterEntityName, isMarkCheck, filter);

            sample.Tag = edit;
            edit.Properties.PopupControl = sample;
            sample.BindData(null);
        }
Ejemplo n.º 3
0
        static void edit_EditValueChanged(object sender, EventArgs e)
        {
            RepositoryItemPopupContainerEdit editValue = sender as RepositoryItemPopupContainerEdit;

            if (editValue == null)
            {
                return;
            }
            PopupContainerControlExtention popupSample = editValue.Properties.PopupControl as PopupContainerControlExtention;

            if (popupSample == null)
            {
                return;
            }
            popupSample.LoadUserData();
        }
Ejemplo n.º 4
0
        static void edit_QueryDisplayText(object sender, QueryDisplayTextEventArgs e)
        {
            RepositoryItemPopupContainerEdit editValue = sender as RepositoryItemPopupContainerEdit;

            if (editValue == null)
            {
                return;
            }
            PopupContainerControlExtention popupSample = editValue.Properties.PopupControl as PopupContainerControlExtention;

            if (popupSample == null)
            {
                return;
            }
            e.DisplayText = GetPopupEditText(popupSample);
        }
Ejemplo n.º 5
0
        public static void SelectionChanged(object sender, EventArgs e)
        {
            PopupContainerControlExtention gridCheckMarks = (PopupContainerControlExtention)sender;

            if (!gridCheckMarks.IsMarkCheck)
            {
                return;
            }
            var edit = gridCheckMarks.Tag as PopupContainerEdit;

            if (edit == null)
            {
                return;
            }
            edit.Text = GetPopupEditText(gridCheckMarks);
        }
Ejemplo n.º 6
0
        public static ArrayList GetSelectionObjects(this RepositoryItemPopupContainerEdit edit)
        {
            PopupContainerControlExtention sample = edit.Properties.PopupControl as PopupContainerControlExtention;
            ArrayList result = new ArrayList();

            if (sample == null)
            {
                return(result);
            }
            if (sample.Selection.Count <= 0)
            {
                return(result);
            }
            for (int rIndex = 0; rIndex < sample.Selection.Count; rIndex++)
            {
                result.Add(sample.Selection[rIndex]);
            }
            return(result);
        }
Ejemplo n.º 7
0
        private static string GetPopupEditText(PopupContainerControlExtention gridCheckMarks)
        {
            if (gridCheckMarks == null)
            {
                return(string.Empty);
            }
            StringBuilder sb          = new StringBuilder();
            string        displayName = gridCheckMarks.LayoutEntityDisplayName;

            for (int rIndex = 0; rIndex < gridCheckMarks.Selection.Count; rIndex++)
            {
                if (sb.ToString().Length > 0)
                {
                    sb.Append(",");
                }
                var    selectItem = gridCheckMarks.Selection[rIndex];
                string str        = selectItem.GetType().GetProperty(displayName).GetValue(selectItem, null).ToString();
                sb.Append(str);
            }
            return(sb.ToString());
        }
Ejemplo n.º 8
0
        public static List <Guid> GetSelection(this RepositoryItemPopupContainerEdit edit)
        {
            PopupContainerControlExtention sample = edit.Properties.PopupControl as PopupContainerControlExtention;
            List <Guid> result = new List <Guid>();

            if (sample == null)
            {
                return(result);
            }
            if (sample.Selection.Count <= 0)
            {
                return(result);
            }
            for (int rIndex = 0; rIndex < sample.Selection.Count; rIndex++)
            {
                var selectItem  = sample.Selection[rIndex];
                var selectValue = selectItem.GetType().GetProperty(sample.LayOutEntityKey).GetValue(selectItem, null);
                result.Add((Guid)selectValue);
            }
            return(result);
        }
Ejemplo n.º 9
0
        static void edit_QueryResultValue(object sender, QueryResultValueEventArgs e)
        {
            RepositoryItemPopupContainerEdit editValue = sender as RepositoryItemPopupContainerEdit;

            if (editValue == null)
            {
                return;
            }
            PopupContainerControlExtention popupSample = editValue.Properties.PopupControl as PopupContainerControlExtention;

            if (popupSample == null)
            {
                return;
            }
            var selectedList = editValue.GetSelection();

            if (selectedList.Count > 0)
            {
                e.Value = selectedList[0];
            }
        }
Ejemplo n.º 10
0
        public static void InitEdit(this PopupContainerEdit edit, string layoutEntityName, string filterEntityName, bool isMarkCheck, CriteriaOperator filter)
        {
            if (!isMarkCheck)
            {
                edit.Popup += (sender, e) =>
                {
                    PopupContainerEdit editValue = sender as PopupContainerEdit;
                    if (editValue == null)
                    {
                        return;
                    }
                    PopupContainerControlExtention popupSample = editValue.Properties.PopupControl as PopupContainerControlExtention;
                    if (popupSample == null)
                    {
                        return;
                    }
                    popupSample.SetRowFocus();
                };
                edit.QueryResultValue += (sender, e) =>
                {
                    PopupContainerEdit editValue = sender as PopupContainerEdit;
                    if (editValue == null)
                    {
                        return;
                    }
                    PopupContainerControlExtention popupSample = editValue.Properties.PopupControl as PopupContainerControlExtention;
                    if (popupSample == null)
                    {
                        return;
                    }
                    var selectedList = editValue.GetSelection();
                    if (selectedList.Count > 0)
                    {
                        e.Value = selectedList[0];
                    }
                };
                edit.EditValueChanged += (sender, e) =>
                {
                    PopupContainerEdit editValue = sender as PopupContainerEdit;
                    if (editValue == null)
                    {
                        return;
                    }
                    PopupContainerControlExtention popupSample = editValue.Properties.PopupControl as PopupContainerControlExtention;
                    if (popupSample == null)
                    {
                        return;
                    }
                    popupSample.LoadUserData();
                };

                edit.QueryDisplayText += (sender, e) =>
                {
                    PopupContainerEdit editValue = sender as PopupContainerEdit;
                    if (editValue == null)
                    {
                        return;
                    }
                    PopupContainerControlExtention popupSample = editValue.Properties.PopupControl as PopupContainerControlExtention;
                    if (popupSample == null)
                    {
                        return;
                    }
                    e.DisplayText = GetPopupEditText(popupSample);
                };
            }
            PopupContainerControlExtention sample = new PopupContainerControlExtention(layoutEntityName, filterEntityName, isMarkCheck, filter);

            sample.SelectionChanged += new PopupContainerControlExtention.SelectionChangedEventHandler(SelectionChanged);
            sample.Tag = edit;
            edit.Properties.PopupControl = sample;
            sample.BindData(null);
        }