Пример #1
0
        public CustomersForm()
        {
            InitializeComponent();

            txtPostNo.ButtonClick += delegate(object sender, ButtonPressedEventArgs e)
            {
                if (e.Button.Kind == ButtonPredefines.Ellipsis)
                {
                    var postdata = SearchPostCode.Find();
                    if (postdata != null && postdata.GetType() == typeof(DataMap))
                    {
                        txtPostNo.EditValue   = postdata.GetValue("POST_NO");
                        txtZoneNo.EditValue   = postdata.GetValue("ZONE_NO");
                        txtAddress1.EditValue = postdata.GetValue("ADDRESS1");
                        txtAddress2.EditValue = postdata.GetValue("ADDRESS2");
                        txtAddress2.Focus();
                    }
                }
            };
        }
Пример #2
0
        void InitGrid()
        {
            #region 조회리스트
            gridList.Init();
            gridList.AddGridColumns(
                new XGridColumn()
            {
                FieldName = "ROW_NO"
            },
                new XGridColumn()
            {
                FieldName = "CUSTOMER_ID", HorzAlignment = HorzAlignment.Center, Width = 80
            },
                new XGridColumn()
            {
                FieldName = "CUSTOMER_NAME", Caption = "거래처명", Width = 200
            },
                new XGridColumn()
            {
                FieldName = "CUSTOMER_TYPE", HorzAlignment = HorzAlignment.Center, Width = 80
            },
                new XGridColumn()
            {
                FieldName = "USE_YN", HorzAlignment = HorzAlignment.Center, Width = 80, RepositoryItem = gridList.GetRepositoryItemCheckEdit()
            }
                );

            gridList.RowCellClick += delegate(object sender, RowCellClickEventArgs e)
            {
                if (e.RowHandle < 0)
                {
                    return;
                }

                try
                {
                    if (e.Button == System.Windows.Forms.MouseButtons.Left && e.Clicks == 1)
                    {
                        GridView view = sender as GridView;
                        DetailDataLoad(view.GetRowCellValue(e.RowHandle, "CUSTOMER_ID"));
                    }
                }
                catch (Exception ex)
                {
                    ShowErrBox(ex);
                }
            };
            #endregion

            #region 연락처
            gridPhones.Init();
            gridPhones.AddGridColumns(
                new XGridColumn()
            {
                FieldName = "ROW_NO"
            },
                new XGridColumn()
            {
                FieldName = "REG_ID", HorzAlignment = HorzAlignment.Center, Visible = false, Width = 40
            },
                new XGridColumn()
            {
                FieldName = "CUSTOMER_ID", HorzAlignment = HorzAlignment.Center, Visible = false, Width = 50
            },
                new XGridColumn()
            {
                FieldName = "PHONE_TYPE", HorzAlignment = HorzAlignment.Center, Width = 100
            },
                new XGridColumn()
            {
                FieldName = "PHONE_NUMBER", Width = 120
            },
                new XGridColumn()
            {
                FieldName = "REMARKS", Width = 200
            },
                new XGridColumn()
            {
                FieldName = "INS_TIME"
            },
                new XGridColumn()
            {
                FieldName = "INS_USER_NAME"
            },
                new XGridColumn()
            {
                FieldName = "UPD_TIME"
            },
                new XGridColumn()
            {
                FieldName = "UPD_USER_NAME"
            }
                );

            gridPhones.SetRepositoryItemLookUpEdit("PHONE_TYPE", "CODE", "LIST_NAME", "CodeHelp", "GetCodeHelpLookup", null, new DataMap()
            {
                { "PARENT_CODE", "PHONE_TYPE" }
            });
            gridPhones.SetEditable("PHONE_NUMBER", "PHONE_TYPE", "REMARKS");

            gridPhones.SetColumnBackColor(Color.Black, "ROW_NO");
            gridPhones.SetColumnForeColor(Color.Yellow, "ROW_NO");
            gridPhones.ColumnFix("ROW_NO");
            #endregion

            #region 주소록
            gridAddress.Init();
            gridAddress.AddGridColumns(
                new XGridColumn()
            {
                FieldName = "ROW_NO"
            },
                new XGridColumn()
            {
                FieldName = "REG_ID", HorzAlignment = HorzAlignment.Center, Visible = false, Width = 40
            },
                new XGridColumn()
            {
                FieldName = "CUSTOMER_ID", HorzAlignment = HorzAlignment.Center, Visible = false, Width = 50
            },
                new XGridColumn()
            {
                FieldName = "ADDRESS_TYPE", HorzAlignment = HorzAlignment.Center, Width = 100
            },
                new XGridColumn()
            {
                FieldName = "ADDRESS_ID", Width = 80, Visible = false
            },
                new XGridColumn()
            {
                FieldName = "POST_NO", Width = 120
            },
                new XGridColumn()
            {
                FieldName = "ZONE_NO", Width = 80
            },
                new XGridColumn()
            {
                FieldName = "ADDRESS1", Width = 200
            },
                new XGridColumn()
            {
                FieldName = "ADDRESS2", Width = 200
            },
                new XGridColumn()
            {
                FieldName = "REMARKS", Width = 200
            },
                new XGridColumn()
            {
                FieldName = "INS_TIME"
            },
                new XGridColumn()
            {
                FieldName = "INS_USER_NAME"
            },
                new XGridColumn()
            {
                FieldName = "UPD_TIME"
            },
                new XGridColumn()
            {
                FieldName = "UPD_USER_NAME"
            }
                );

            gridAddress.SetRepositoryItemLookUpEdit("ADDRESS_TYPE", "CODE", "LIST_NAME", "CodeHelp", "GetCodeHelpLookup", null, new DataMap()
            {
                { "PARENT_CODE", "ADDRESS_TYPE" }
            });
            gridAddress.SetRepositoryItemButtonEdit("POST_NO");
            (gridAddress.MainView.Columns["POST_NO"].ColumnEdit as RepositoryItemButtonEdit).TextEditStyle = TextEditStyles.DisableTextEditor;
            (gridAddress.MainView.Columns["POST_NO"].ColumnEdit as RepositoryItemButtonEdit).Buttons.Add(new EditorButton()
            {
                Caption = "삭제", Kind = ButtonPredefines.Delete
            });
            (gridAddress.MainView.Columns["POST_NO"].ColumnEdit as RepositoryItemButtonEdit).ButtonClick += delegate(object sender, ButtonPressedEventArgs e)
            {
                if (e.Button.Kind == ButtonPredefines.Ellipsis)
                {
                    var postdata = SearchPostCode.Find();
                    if (postdata != null && postdata.GetType() == typeof(DataMap))
                    {
                        gridAddress.SetValue(gridAddress.FocusedRowHandle, "POST_NO", postdata.GetValue("POST_NO"));
                        gridAddress.SetValue(gridAddress.FocusedRowHandle, "ZONE_NO", postdata.GetValue("ZONE_NO"));
                        gridAddress.SetValue(gridAddress.FocusedRowHandle, "ADDRESS1", postdata.GetValue("ADDRESS1"));
                        gridAddress.SetValue(gridAddress.FocusedRowHandle, "ADDRESS2", postdata.GetValue("ADDRESS2"));
                        gridAddress.SetFocus(gridAddress.FocusedRowHandle, "ADDRESS2");
                    }
                }
                else if (e.Button.Kind == ButtonPredefines.Delete)
                {
                    gridAddress.SetValue(gridAddress.FocusedRowHandle, "POST_NO", null);
                    gridAddress.SetValue(gridAddress.FocusedRowHandle, "ZONE_NO", null);
                    gridAddress.SetValue(gridAddress.FocusedRowHandle, "ADDRESS1", null);
                    gridAddress.SetValue(gridAddress.FocusedRowHandle, "ADDRESS2", null);
                }
            };

            gridAddress.SetEditable("ADDRESS_TYPE", "POST_NO", "ADDRESS2", "REMARKS");

            gridAddress.SetColumnBackColor(Color.Black, "ROW_NO");
            gridAddress.SetColumnForeColor(Color.Yellow, "ROW_NO");
            gridAddress.ColumnFix("ROW_NO");
            #endregion
        }