using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Project.Dialog
{
    public partial class fSelectDept : FCOMMON.fBase
    {
        public string deptName { get; set; }
        public fSelectDept()
        {
            InitializeComponent();
            deptName = string.Empty;
            this.fpSpread1.KeyDown += (s1, e1) => { SelectData(); };
            this.fpSpread1.CellDoubleClick += (s1, e1) => { SelectData(); };
        }

        private void fSelectDept_Load(object sender, EventArgs e)
        {
            // TODO: 이 코드는 데이터를 'dsMSSQL.UserGroup' 테이블에 로드합니다. 필요한 경우 이 코드를 이동하거나 제거할 수 있습니다.
            this.ta.Fill(this.dsMSSQL.UserGroup);
            var ta = new dsMSSQLTableAdapters.UserGroupTableAdapter();
            
        }
        void SelectData()
        {
            var drv = this.bs.Current as DataRowView;
            if (drv == null) return;
            var dr = drv.Row as dsMSSQL.UserGroupRow;
            this.deptName = dr.dept;
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
    }
}
