private void btn_Click(Object o, EventArgs e)
        {
            //MessageBox.Show("동작확인 : btn_Click");

            Button button = (Button)o;

            if (button.Name == "설정완료")
            {
                if (관리자라디오버튼.Checked == false && 회원라디오버튼.Checked == false)
                {
                    MessageBox.Show("회원의 권한을 선택해주세요");
                }

                //MessageBox.Show("설정완료");
                if (관리자라디오버튼.Checked == true)
                {
                    MessageBox.Show("관리자 권한 변경 완료");
                    MySql mysql = new MySql();
                    mysql.NonQuery_INSERT(string.Format("update signup set member_rank = 0 where user_number = {0};", 회원번호Temp값));
                }
                else if (회원라디오버튼.Checked == true)
                {
                    MessageBox.Show("회원 권한 변경 완료");
                    MySql mysql = new MySql();
                    mysql.NonQuery_INSERT(string.Format("update signup set member_rank = 1 where user_number = {0};", 회원번호Temp값));
                }
            }
            else if (button.Name == "취소")
            {
                this.Close();
            }
        }
Esempio n. 2
0
        public void delay_rental_check()
        {
            MySql  mysql  = new MySql();
            string sql    = string.Format("update book_rental set rental_status = 1 where rental_number in (select rental_number from book_rental where (TO_DAYS(now()) - TO_DAYS(return_schedule)) > 0 and rental_status <> 2);");
            bool   status = mysql.NonQuery_INSERT(sql);

            if (status)
            {
                //MessageBox.Show("미반납 상태 업데이트 완료");
            }
            else
            {
                //MessageBox.Show("미반납 상태 업데이트 실패");
            }
        }
Esempio n. 3
0
        public void GetUpdate()
        {
            MySql  mysql  = new MySql();
            string sql    = string.Format("update book_rental set rental_status = 2 WHERE rental_number = {0};", no);
            bool   status = mysql.NonQuery_INSERT(sql);

            if (status)
            {
                mysql  = new MySql();
                sql    = string.Format("update book_info set availability = '가능' where book_number in (select book_number from book_rental where rental_status = 2);");
                status = mysql.NonQuery_INSERT(sql);
                MessageBox.Show("반납성공");
            }
            else
            {
                MessageBox.Show("반납실패");
            }
        }
Esempio n. 4
0
        private void btn_Click(Object o, EventArgs e)
        {
            Button button = (Button)o;

            ///  버튼 설정.
            if (button.Name == "등록")
            {
                if (Textbox1.Text == "" || Textbox2.Text == "" || Textbox3.Text == "" || Textbox4.Text == "")
                {
                    MessageBox.Show("입력칸을 모두 채워주세요");
                    return;
                }

                LOGIN_FORM login = new LOGIN_FORM();

                MySql  mysql = new MySql();
                string sql   = string.Format("insert into Receiving_equest(title, author, publisher, genre, user_number) values('{0}', '{1}', '{2}', '{3}', {4});", Textbox1.Text, Textbox2.Text, Textbox3.Text, Textbox4.Text, login.User_Number); // 1 : 입고 요청한 user_number 로 등록되도록 변경 필요.
                mysql.NonQuery_INSERT(sql);
            }
            else if (button.Name == "취소")
            {
                this.Close();
            }
        }
Esempio n. 5
0
        // 버튼클릭
        private void btn_Click(Object o, EventArgs e)
        {
            //MessageBox.Show("동작확인 : btn_Click");

            Button button = (Button)o;



            if (button.Name == "대여버튼")
            {
                if (login_frm.Member_rank == 4)
                {
                    Login_ck = new Login_Check(this);
                    Login_ck.StartPosition = FormStartPosition.CenterParent;
                    Login_ck.ShowDialog();
                    this.Hide();
                    form.Login.Show();
                }
                else
                {
                    if (대여가능여부값.Text == "가능")
                    {
                        GetInsert();
                    }
                    else
                    {
                        MessageBox.Show("대여불가 상태입니다.");
                    }
                }
            }

            /// 입고요청 버튼 설정.
            if (button.Name == "입고버튼")
            {
                if (login_frm.Member_rank == 4)
                {
                    Login_ck = new Login_Check(this);
                    Login_ck.StartPosition = FormStartPosition.CenterParent;
                    Login_ck.ShowDialog();
                    this.Hide();
                    form.Login.Show();
                }
                else
                {
                    REQUEST_BOOK_FORM REQUEST_FORM = new REQUEST_BOOK_FORM();
                    REQUEST_FORM.StartPosition = FormStartPosition.CenterParent;
                    REQUEST_FORM.ShowDialog();
                }
            }

            /// 검색버튼 클릭 시 리스트 뷰 넣는 부분
            if (button.Name == "정보수정버튼") // admin 모드일 경우
            {
                // 라벨값 그대로 텍스트 박스로 옮기는  부분.
                텍스트박스_제목값.Text   = 제목값.Text;
                텍스트박스_저자값.Text   = 저자값.Text;
                텍스트박스_출판사값.Text  = 출판사값.Text;
                텍스트박스_장르값.Text   = 장르값.Text;
                텍스트박스_도서위치값.Text = 도서위치값.Text;
                간략소개상자.Text      = 간략소개상자.Text;

                // 정보수정 버튼 숨기기
                정보수정.Hide();
                수정취소.Show();
                수정완료.Show();

                // 라벨 값 숨기기
                제목값.Hide();
                저자값.Hide();
                출판사값.Hide();
                장르값.Hide();
                도서위치값.Hide();

                // 텍스트박스 보이기
                텍스트박스_제목값.Show();
                텍스트박스_저자값.Show();
                텍스트박스_출판사값.Show();
                텍스트박스_장르값.Show();
                텍스트박스_도서위치값.Show();

                간략소개상자.ReadOnly = false;
            }
            else if (button.Name == "수정취소버튼")
            {
                // 정보수정 버튼 보이기
                정보수정.Show();
                수정취소.Hide();
                수정완료.Hide();

                // 라벨 값 숨기기
                제목값.Show();
                저자값.Show();
                출판사값.Show();
                장르값.Show();
                도서위치값.Show();

                // 텍스트박스 보이기
                텍스트박스_제목값.Hide();
                텍스트박스_저자값.Hide();
                텍스트박스_출판사값.Hide();
                텍스트박스_장르값.Hide();
                텍스트박스_도서위치값.Hide();

                간략소개상자.ReadOnly = true;
            }
            else if (button.Name == "수정완료버튼")
            {
                // MessageBox.Show("수정완료");


                if (번호값.Text == "번호값" || 텍스트박스_제목값.Text == "" || 텍스트박스_저자값.Text == "" || 텍스트박스_출판사값.Text == "" || 텍스트박스_장르값.Text == "" || 텍스트박스_도서위치값.Text == "" || 간략소개상자.Text == "")
                {
                    MessageBox.Show("입력칸을 모두 채워주세요.");
                    return;
                }

                MySql  mysql  = new MySql();
                string sql    = string.Format("update book_info set title = '{1}', author = '{2}', publisher = '{3}', genre = '{4}', brief_introduction = '{5}', book_location = '{6}' where book_number = {0};", 번호값.Text, 텍스트박스_제목값.Text, 텍스트박스_저자값.Text, 텍스트박스_출판사값.Text, 텍스트박스_장르값.Text, 간략소개상자.Text, 텍스트박스_도서위치값.Text);
                bool   status = mysql.NonQuery_INSERT(sql);

                if (status)
                {
                    MessageBox.Show("수정이 완료 되었습니다.");
                }
                else
                {
                    MessageBox.Show("수정 중 오류가 발생했습니다.");
                }



                mysql = new MySql();
                ArrayList bookinfoSearch_arry = mysql.Select(string.Format("select * from book_info where book_number = {0}", 번호값.Text));
                foreach (Hashtable ht in bookinfoSearch_arry)
                {
                    제목값.Text           = ht["title"].ToString();
                    저자값.Text           = ht["author"].ToString();
                    출판사값.Text          = ht["publisher"].ToString();
                    장르값.Text           = ht["genre"].ToString();
                    도서위치값.Text         = ht["book_location"].ToString();
                    책이미지.ImageLocation = ht["image_location"].ToString();
                    간략소개상자.Text        = ht["brief_introduction"].ToString();
                }


                // 정보수정 버튼 보이기
                정보수정.Show();
                수정취소.Hide();
                수정완료.Hide();

                // 라벨 값 숨기기
                제목값.Show();
                저자값.Show();
                출판사값.Show();
                장르값.Show();
                도서위치값.Show();

                // 텍스트박스 보이기
                텍스트박스_제목값.Hide();
                텍스트박스_저자값.Hide();
                텍스트박스_출판사값.Hide();
                텍스트박스_장르값.Hide();
                텍스트박스_도서위치값.Hide();

                간략소개상자.ReadOnly = true;
            }
            else if (button.Name == "검색버튼") // admin / user 둘다 사용
            {
                if (search_category == "")
                {
                    MessageBox.Show("카테고리를 선택 해주세요.");
                    return;
                }


                책정보검색_리스트뷰.Items.Clear();

                MySql mysql = new MySql();
                //ArrayList bookinfoSearch_arry = mysql.Select(string.Format("select * from book_info where {0} LIKE '%{1}%'", search_category, 책정보검색상자.Text));
                ArrayList bookinfoSearch_arry = mysql.Select(string.Format("select * from book_info where {0} LIKE '%{1}%'", search_category, 책정보검색상자.Text));

                foreach (Hashtable ht in bookinfoSearch_arry)
                {
                    ListViewItem item = new ListViewItem("");
                    item.SubItems.Add(ht["book_number"].ToString());
                    item.SubItems.Add(ht["availability"].ToString());
                    item.SubItems.Add(ht["title"].ToString());
                    item.SubItems.Add(ht["author"].ToString());
                    item.SubItems.Add(ht["publisher"].ToString());
                    item.Font = new Font("Arial", 18, FontStyle.Italic);

                    책정보검색_리스트뷰.Items.Add(item);
                }

                Controls.Add(책정보검색_리스트뷰);
            }
        }
Esempio n. 6
0
        // 버튼클릭
        private void btn_Click(Object o, EventArgs e)
        {
            //MessageBox.Show("동작확인 : btn_Click");

            Button button = (Button)o;


            /// 입고요청 버튼 설정.
            if (button.Name == "이미지추가버튼")
            {
                // MessageBox.Show("이미지추가버튼");
                WebApi_Image_Select();
                //Image_Select();
            }
            else if (button.Name == "등록버튼")
            {
                //  MessageBox.Show("등록버튼");

                if (제목값.Text == "" || 저자값.Text == "" || 출판사값.Text == "" || 장르값.Text == "" || 도서위치값.Text == "" || 간략소개상자.Text == "" || 이미지Load경로 == "" || 본파일이름 == "")
                {
                    MessageBox.Show("빈칸 및 이미지 파일을 등록해주세요.");
                    return;
                }

                // MessageBox.Show("이미지Load경로 : " + 이미지Load경로);
                //  MessageBox.Show("본파일이름 : " + 본파일이름);

                MySql  mysql  = new MySql();
                string sql    = string.Format("insert into book_info(title, author, publisher, genre, book_location, brief_introduction, image_location, image_FileName) values('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}');", 제목값.Text, 저자값.Text, 출판사값.Text, 장르값.Text, 도서위치값.Text, 간략소개상자.Text, 이미지Load경로, 본파일이름);
                bool   status = mysql.NonQuery_INSERT(sql);

                if (status)
                {
                    MessageBox.Show("등록이 완료 되었습니다.");
                }
                else
                {
                    MessageBox.Show("등록 중 오류가 발생하였습니다.");
                }
            }

            if (button.Name == "요청리스트삭제")
            {
                if (request_number == 0)
                {
                    MessageBox.Show("삭제 할 리스트를 선택해주세요");
                    return;
                }

                MySql  mysql  = new MySql();
                string sql    = string.Format("delete from Receiving_equest where request_number = {0};", request_number);
                bool   status = mysql.NonQuery_INSERT(sql);

                if (status)
                {
                    // MessageBox.Show("등록이 완료 되었습니다.");
                    list_Refresh();
                }
                else
                {
                    MessageBox.Show("삭제 중 오류가 발생하였습니다.");
                }
            }
        }