public AdminRegistration(string title,int mode, Admin admin)
        {
            // TODO: Complete member initialization
            InitializeComponent();
            this.titleLabel.Text = title;
            this.Text = this.title;
            this.mode = mode;
            this.admin= admin;

            AdminGroupDao adminGroupDao = new AdminGroupDao();
            adminGroupDao.notifyDBfinished += new NotifyDBfinishedHandler(this.AdminGroup_Receive);
            adminGroupDao.getAdminGroups();
        }
 public void DeleteAdmin(int row, int col)
 {
     int adminNo = Convert.ToInt32(this.adminGrid[row, 0].DisplayText);
     Admin admin = new Admin();
     admin.AdminNo = adminNo;
     this.adminDao.DeleteAdmin(admin);
 }
 private void Modify_Click(object sender, EventArgs e)
 {
     int row = celContext.Position.Row;
     AdminCommand adminCommand = this.adminSetting.adminCommandList[row - 1];
     Admin admin = new Admin();
     admin.AdminNo = adminCommand.AdminNo;
     admin.AdminGroupNo = adminCommand.AdminGroupNo;
     admin.Name = adminCommand.Name;
     admin.Id = adminCommand.Id;
     admin.Password = adminCommand.Password;
     AdminRegistration adminReg = new AdminRegistration("관리자 수정", Constants.MODIFY, admin);
     if (adminReg.ShowDialog() == DialogResult.OK)
     {
         this.adminSetting.adminDao.ModifyAdmin(admin);
     };
 }
        private void okBtn_Click(object sender, EventArgs e)
        {
            string message = "";
            bool check = true;

            if (this.nameBox.Text.Length == 0)
            {
                message = "이름을 입력해주세요";
                check = false;
            }
            if (this.idBox.Text.Length == 0)
            {
                message = "ID를 입력해주세요";
                check = false;
            }
            if (this.passwordBox.Text.Length == 0)
            {
                message = "비밀번호를 입력해주세요";
                check = false;
            }
            if (!check)
            {
                MessageBox.Show(message);
                return;
            }
            Admin admin;
            if (this.mode == Constants.CREATE)
            {
                admin = new Admin();
            }
            else
            {
                admin = this.Admin;
            }

            admin.AdminGroupNo = Convert.ToInt32(this.groupComboBox.SelectedValue);
            admin.Id = this.idBox.Text;
            admin.Name = this.nameBox.Text;
            admin.Password = this.passwordBox.Text;
            this.Admin = admin;

            this.DialogResult = DialogResult.OK;
            this.Close();
        }