Beispiel #1
0
        private void DETAIL_BOOK_FORM_Load(object sender, EventArgs e)
        {
            //FormBorderStyle = FormBorderStyle.None; 폼 상단 표시줄 제거

            this.BackColor = Color.FromArgb(149, 165, 165);

            ClientSize = new Size(sX, sY);  // 폼 사이즈 지정.

            /// 좌표 체크시 추가 ///
            //Point_Print();

            COMMON_Create_Ctl create_ctl = new COMMON_Create_Ctl();

            // BTNclass bt1 = new BTNclass(this, "버튼Name", "버튼Text", 가로사이즈, 세로사이즈, 가로포인트, 세로포인트, 버튼클릭이벤트);
            BTNclass bt1 = new BTNclass(this, "Home", "button1", 100, 100, 10, 10, btn_Click);
            // LBclass lb1 = new LBclass(this, "라벨Name", "라벨Text", 라벨Font사이즈, 가로사이즈, 세로사이즈, 가로포인트, 세로포인트, 라벨클릭이벤트);
            LBclass lb1 = new LBclass(this, "label1", "label_name~", 24, 100, 100, 10, 10, label_Click);
            // PANELclass pn1 = new PANELclass(this, "패널Name", "패널Text", 가로사이즈, 세로사이즈, 가로포인트, 세로포인트, 패널마우스이동이벤트);
            PANELclass pn1 = new PANELclass(this, "panel1", "panel_txt~", 200, 200, 100, 100);
            // TABCTLclass tabctl = new TABCTLclass(this, "탭컨트롤Name", "탭컨트롤Text", 가로사이즈, 세로사이즈, 가로포인트, 세로포인트, 탭높이, 탭컨트롤마우스이동이벤트);
            TABCTLclass tabctl = new TABCTLclass(this, "tabctl1", "tabctl1~", 450, 160, 7, 313, 30, tabctl_MouseMove);
            // TABPAGEclass tabpg1 = new TABPAGEclass(this, "탭페이지Name", "탭페이지Text", 가로사이즈, 세로사이즈, 가로포인트, 세로포인트, 탭페이지마우스이동이벤트);
            TABPAGEclass tabpg1 = new TABPAGEclass(this, "tabpage1", "tapage1~", 100, 100, 0, 0, tabpage_MouseMove);
            // CHKBOXclass bhkbox1 = new CHKBOXclass(this, "체크박스Name", 체크박스Text", 가로사이즈, 세로사이즈, 가로포인트, 세로포인트, 체크박스클릭이벤트);
            CHKBOXclass chkbox1 = new CHKBOXclass(this, "chkbox1", "chkbox1~", 100, 100, 20, 20, chkbox_Click);
            // LISTVIEWclass listview1 = new LISTVIEWclass(this, "리스트뷰Name", 가로사이즈, 세로사이즈, 가로포인트, 세로포인트, 리스트뷰더블클릭이벤트, 컬럼갯수, "컬럼1번Name", 컬럼1간격, "컬럼2번Name", 컬럼2간격, "컬럼3번Name", 컬럼3간격, ~ 동일방식 10개 컬럼까지 가능);
            LISTVIEWclass listview1 = new LISTVIEWclass(this, "ListView1", 500, 500, 10, 10, listview_mousedoubleclick, listview_mousedoubleclick, 3, "col1", 100, "col2", 100, "col3", 100);
            // COMBOBOXclass combobox1 = new COMBOBOXclass(this, "콤보박스Name", 가로사이즈, 세로사이즈, 가로포인트, 세로포인트, 콤보박스클릭이벤트, 리스트추가갯수, "test1", "test2", "test3", "test4", "test5");
            COMBOBOXclass combobox1 = new COMBOBOXclass(this, "ComboBox1", 100, 100, 721, 12, ComboBox_SelectedIndexChanged, 5, "test1", "test2", "test3", "test4", "test5");

            ////// 고정 라벨
            ArrayList labelArr = new ArrayList();

            labelArr.Add(new LBclass(this, "도서상세정보", "도서 상세 정보", 26, 300, 40, 30, 30, label_Click));
            labelArr.Add(new LBclass(this, "도서명", "도서명", 15, 80, 40, 30, 110, label_Click));
            labelArr.Add(new LBclass(this, "보유정보", "보유정보", 12, 100, 40, 30, 160, label_Click));
            labelArr.Add(new LBclass(this, "", ":", 12, 30, 40, 140, 108, label_Click));
            labelArr.Add(new LBclass(this, "", ":", 12, 30, 40, 140, 158, label_Click));


            for (int i = 0; i < labelArr.Count; i++)
            {
                Label 라벨 = comm.lb((LBclass)labelArr[i]);

                라벨.Font = new Font("신명조", 15, FontStyle.Bold);

                if (라벨.Name == "도서상세정보")
                {
                    라벨.Font = new Font("신명조", 24, FontStyle.Bold);
                }
                else if (라벨.Name == "도서명")
                {
                }
                else if (라벨.Name == "보유정보")
                {
                }



                Controls.Add(라벨);
            }


            /// 변경되는 라벨
            ArrayList Value_labelArr = new ArrayList();

            Value_labelArr.Add(new LBclass(this, "도서명파라미터", "도서명파라미터", 10, 280, 40, 172, 112, label_Click));
            Value_labelArr.Add(new LBclass(this, "보유권수파라미터", "보유권수파라미터", 10, 250, 40, 172, 162, label_Click));

            for (int i = 0; i < Value_labelArr.Count; i++)
            {
                Label 변경라벨 = comm.lb((LBclass)Value_labelArr[i]);

                변경라벨.Font = new Font("신명조", 12, FontStyle.Bold);

                if (변경라벨.Name == "도서명파라미터")
                {
                    도서이름라벨 = 변경라벨;
                }
                else if (변경라벨.Name == "보유권수파라미터")
                {
                    보유권수총갯수라벨 = 변경라벨;
                }



                Controls.Add(변경라벨);
            }



            /// 도서상세정보 리스트
            LISTVIEWclass 도서상세정보_리스트뷰값 = new LISTVIEWclass(this, "도서상세정보_ListVIew", 324, 140, 38, 210, listView_MouseClick, listview_mousedoubleclick, 4, "", 0, "책번호", 100, "책위치", 110, "대여", 110);

            도서상세정보_리스트뷰 = comm.listView(도서상세정보_리스트뷰값);


            도서상세정보_리스트뷰.Font = new Font("Arial", 14, FontStyle.Bold);

            도서상세정보_리스트뷰.OwnerDraw         = true;
            도서상세정보_리스트뷰.DrawColumnHeader += new DrawListViewColumnHeaderEventHandler(lv_DrawColumnHeader);

            도서상세정보_리스트뷰.BackColor    = Color.FromArgb(149, 165, 165);
            도서상세정보_리스트뷰.DrawSubItem += new DrawListViewSubItemEventHandler(lv_DrawSubItem);


            MySql  mysql = new MySql();
            string sql   = string.Format("select title, count(*) COUNT from book_info where title = '{0}';", book_name);
            //MessageBox.Show(sql);
            ArrayList bookinfoSearch_arry1 = mysql.Select(sql);

            foreach (Hashtable ht in bookinfoSearch_arry1)
            {
                도서이름라벨.Text    = ht["title"].ToString();
                보유권수총갯수라벨.Text = "총 " + ht["COUNT"].ToString() + "권";
            }
            mysql.ConnectionClose();

            mysql = new MySql();
            sql   = string.Format("select * from book_info where title = '{0}';", book_name);
            ArrayList bookinfoSearch_arry2 = mysql.Select(sql);

            foreach (Hashtable ht in bookinfoSearch_arry2)
            {
                ListViewItem item = new ListViewItem("");
                item.SubItems.Add(ht["book_number"].ToString());
                item.SubItems.Add(ht["book_location"].ToString());
                item.SubItems.Add(ht["availability"].ToString());
                도서상세정보_리스트뷰.Items.Add(item);

                for (int i = 0; i < item.SubItems.Count; i++)
                {
                    item.SubItems[i].Font = new Font("Arial", 12, FontStyle.Bold | FontStyle.Italic);
                }
            }

            Controls.Add(도서상세정보_리스트뷰);


            /// 닫기 버튼
            BTNclass 버튼닫기값 = new BTNclass(this, "닫기버튼", "닫기", 80, 40, 397, 312, btn_Click);
            Button   버튼닫기  = comm.btn(버튼닫기값);

            버튼닫기.BackColor = Color.FromArgb(50, 178, 223);
            버튼닫기.Font      = new Font(버튼닫기.Font.Name, 12, FontStyle.Bold);
            버튼닫기.FlatStyle = FlatStyle.Flat;
            버튼닫기.ForeColor = Color.White;
            버튼닫기.Region    = Region.FromHrgn(COMMON_Create_Ctl.CreateRoundRectRgn(2, 2, 버튼닫기.Width, 버튼닫기.Height, 10, 10));
            Controls.Add(버튼닫기);
        }
Beispiel #2
0
        private void DETAIL_BOOK_FORM_Load(object sender, EventArgs e)
        {
            webapiUrl = comm.WebapiUrl;

            //FormBorderStyle = FormBorderStyle.None; 폼 상단 표시줄 제거

            this.BackColor = Color.FromArgb(149, 165, 165);

            ClientSize = new Size(sX, sY);  // 폼 사이즈 지정.

            /// 좌표 체크시 추가 ///
            //Point_Print();

            COMMON_Create_Ctl create_ctl = new COMMON_Create_Ctl();

            ////// 고정 라벨
            ArrayList labelArr = new ArrayList();

            labelArr.Add(new LBclass(this, "도서상세정보", "도서 상세 정보", 26, 300, 40, 30, 30, label_Click));
            labelArr.Add(new LBclass(this, "도서명", "도서명", 15, 80, 40, 30, 110, label_Click));
            labelArr.Add(new LBclass(this, "보유정보", "보유정보", 12, 100, 40, 30, 160, label_Click));
            labelArr.Add(new LBclass(this, "", ":", 12, 30, 40, 140, 108, label_Click));
            labelArr.Add(new LBclass(this, "", ":", 12, 30, 40, 140, 158, label_Click));


            for (int i = 0; i < labelArr.Count; i++)
            {
                Label 라벨 = comm.lb((LBclass)labelArr[i]);

                라벨.Font = new Font("신명조", 15, FontStyle.Bold);

                if (라벨.Name == "도서상세정보")
                {
                    라벨.Font = new Font("신명조", 24, FontStyle.Bold);
                }
                else if (라벨.Name == "도서명")
                {
                }
                else if (라벨.Name == "보유정보")
                {
                }



                Controls.Add(라벨);
            }


            /// 변경되는 라벨
            ArrayList Value_labelArr = new ArrayList();

            Value_labelArr.Add(new LBclass(this, "도서명파라미터", "도서명파라미터", 10, 280, 40, 172, 112, label_Click));
            Value_labelArr.Add(new LBclass(this, "보유권수파라미터", "보유권수파라미터", 10, 250, 40, 172, 162, label_Click));

            for (int i = 0; i < Value_labelArr.Count; i++)
            {
                Label 변경라벨 = comm.lb((LBclass)Value_labelArr[i]);

                변경라벨.Font = new Font("신명조", 12, FontStyle.Bold);

                if (변경라벨.Name == "도서명파라미터")
                {
                    도서이름라벨 = 변경라벨;
                }
                else if (변경라벨.Name == "보유권수파라미터")
                {
                    보유권수총갯수라벨 = 변경라벨;
                }



                Controls.Add(변경라벨);
            }



            /// 도서상세정보 리스트
            LISTVIEWclass 도서상세정보_리스트뷰값 = new LISTVIEWclass(this, "도서상세정보_ListVIew", 324, 140, 38, 210, listView_MouseClick, listview_mousedoubleclick, 4, "", 0, "책번호", 100, "책위치", 110, "대여", 110);

            도서상세정보_리스트뷰 = comm.listView(도서상세정보_리스트뷰값);


            도서상세정보_리스트뷰.Font = new Font("Arial", 14, FontStyle.Bold);

            도서상세정보_리스트뷰.OwnerDraw         = true;
            도서상세정보_리스트뷰.DrawColumnHeader += new DrawListViewColumnHeaderEventHandler(lv_DrawColumnHeader);

            도서상세정보_리스트뷰.BackColor    = Color.FromArgb(149, 165, 165);
            도서상세정보_리스트뷰.DrawSubItem += new DrawListViewSubItemEventHandler(lv_DrawSubItem);


            MySql mysql = new MySql();

            //MessageBox.Show(sql);
            ArrayList bookinfoSearch_arry1 = book_count_api(book_name);

            foreach (Hashtable ht in bookinfoSearch_arry1)
            {
                도서이름라벨.Text    = ht["title"].ToString();
                보유권수총갯수라벨.Text = "총 " + ht["COUNT"].ToString() + "권";
            }
            mysql.ConnectionClose();

            mysql = new MySql();

            ArrayList bookinfoSearch_arry2 = detail_book_info(book_name);

            foreach (Hashtable ht in bookinfoSearch_arry2)
            {
                ListViewItem item = new ListViewItem("");
                item.SubItems.Add(ht["book_number"].ToString());
                item.SubItems.Add(ht["book_location"].ToString());
                item.SubItems.Add(ht["availability"].ToString());
                도서상세정보_리스트뷰.Items.Add(item);

                for (int i = 0; i < item.SubItems.Count; i++)
                {
                    item.SubItems[i].Font = new Font("Arial", 12, FontStyle.Bold | FontStyle.Italic);
                }
            }

            Controls.Add(도서상세정보_리스트뷰);


            /// 닫기 버튼
            BTNclass 버튼닫기값 = new BTNclass(this, "닫기버튼", "닫기", 80, 40, 397, 312, btn_Click);
            Button   버튼닫기  = comm.btn(버튼닫기값);

            버튼닫기.BackColor = Color.FromArgb(50, 178, 223);
            버튼닫기.Font      = new Font(버튼닫기.Font.Name, 12, FontStyle.Bold);
            버튼닫기.FlatStyle = FlatStyle.Flat;
            버튼닫기.ForeColor = Color.White;
            버튼닫기.Region    = Region.FromHrgn(COMMON_Create_Ctl.CreateRoundRectRgn(2, 2, 버튼닫기.Width, 버튼닫기.Height, 10, 10));
            Controls.Add(버튼닫기);
        }