Exemplo n.º 1
0
        private void BtnAdd_Click(object sender, EventArgs e)
        {
            if (btnAdd.Enabled)
            {
                if (ComparisonUtils.IsEqualTo_String(GlobalVariables.ProgCode, WIN_APP_TABS._frmUserDetails))
                {
                    FrmUserDetails frm = new FrmUserDetails()
                    {
                        S1 = btnAdd.Text, Text = "User Addition"
                    };
                    frm.StartPosition = FormStartPosition.CenterScreen;


                    frm.ShowDialog(Parent);
                }
            }

            FillDataToGrid();
        }
Exemplo n.º 2
0
        private void BtnEdit_Click(object sender, EventArgs e)
        {
            if (btnEdit.Enabled)
            {
                if (ComparisonUtils.IsEqualTo_String(GlobalVariables.ProgCode, WIN_APP_TABS._frmUserDetails))
                {
                    //DataRow CurrentRow = gridView_UserMaster.GetDataRow(gridView_UserMaster.FocusedRowHandle);
                    //gridControl_UserMaster.Ge

                    //ColumnView detailView = (ColumnView)gridControl_UserMaster.FocusedView;
                    //
                    //int foundIndex = detailView.GetDataSourceRowIndex(detailView.FocusedRowHandle);

                    //DataRow CurrentRow = detailView.GetDataRow(detailView.FocusedRowHandle);

                    int row = (gridControl_UserMaster.FocusedView as ColumnView).FocusedRowHandle;

                    ColumnView detailView         = (ColumnView)gridControl_UserMaster.FocusedView;
                    string     cellValue_UserName = detailView.GetRowCellValue(row, "UserName").ToString();
                    PrintLogWin.PrintLog(cellValue_UserName
                                         );


                    //int foundIndex = userMasterBindingSource.Find("clients_id", cellValue);
                    //userMasterBindingSource.Position = foundIndex;

                    FrmUserDetails frm = new FrmUserDetails()
                    {
                        S1 = btnEdit.Text, Text = "User Editing", UserName = cellValue_UserName
                    };
                    frm.StartPosition = FormStartPosition.CenterScreen;

                    frm.ShowDialog(Parent);
                }
            }

            FillDataToGrid();
        }