private void label3_Click(object sender, EventArgs e) { login_frm.Member_rank = 4; login_frm.User_Number = 0; user1.Dispose(); BOOK_INFO_FORM login_user1 = new BOOK_INFO_FORM(this); //user1.FormBorderStyle = FormBorderStyle.None; login_user1.TopLevel = false; login_user1.TopMost = true; login_user1.MdiParent = this; login_user1.Dock = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림. panel1.Controls.Add(login_user1); user1 = login_user1; user1.Show(); user2.Hide(); user3.Hide(); user4.Hide(); root2.Hide(); root3.Hide(); root4.Hide(); btn.Show(); btn1.Hide(); btn2.Hide(); btn3.Hide(); btn5.Hide(); btn6.Hide(); btn7.Hide(); MessageBox.Show("로그아웃"); lb_Logout.Hide(); lb_Login.Show(); lb_Signup.Show(); }
private void Form1_Load(object sender, EventArgs e) { this.FormBorderStyle = FormBorderStyle.FixedSingle; //======================================================================================================= user1 = new BOOK_INFO_FORM(this); login_frm = new LOGIN_FORM(this); Login = new LOGIN_FORM(this); Signup = new SIGNUP_FORM(this); //======================================================================================================= ClientSize = new Size(sX, sY); // 폼 사이즈 지정. this.IsMdiContainer = true; // MDI 설정. //좌표 체크시 추가 //Point_Print(); // 컨트롤 객체생성. COMMON_Create_Ctl comm_create_ctl = new COMMON_Create_Ctl(); // 생성할 패널 정보 객체 생성. PANELclass pn1 = new PANELclass(this, "panel1", "panel_main", 1500, 780, 0, 145); panel1 = comm_create_ctl.panel(pn1); // ex) 판넬만들기 : create_ctl.CTL명(CTL값); Controls.Add(panel1); // 원하는 컨트롤에 추가함. BTNclass bt1 = new BTNclass(this, "유저1", "도서정보", 285, 145, 0, 0, btn1_Click); BTNclass bt2 = new BTNclass(this, "유저2", "대여목록", 285, 145, 285, 0, btn2_Click); BTNclass bt3 = new BTNclass(this, "유저3", "나의정보", 285, 145, 570, 0, btn3_Click); BTNclass bt4 = new BTNclass(this, "유저4", "위치정보", 285, 145, 855, 0, btn4_Click); BTNclass bt6 = new BTNclass(this, "관리2", "회원정보", 285, 145, 285, 0, btn6_Click); BTNclass bt7 = new BTNclass(this, "관리3", "도서관리", 285, 145, 570, 0, btn7_Click); BTNclass bt8 = new BTNclass(this, "관리4", "연체관리", 285, 145, 855, 0, btn8_Click); btn = comm_create_ctl.btn(bt1); ButtonConfig(btn, "book_info"); btn1 = comm_create_ctl.btn(bt2); ButtonConfig(btn1, "rental_list"); btn2 = comm_create_ctl.btn(bt3); ButtonConfig(btn2, "my_information"); btn3 = comm_create_ctl.btn(bt4); ButtonConfig(btn3, "book_location"); btn5 = comm_create_ctl.btn(bt6); ButtonConfig(btn5, "user_management"); btn6 = comm_create_ctl.btn(bt7); ButtonConfig(btn6, "book_management"); btn7 = comm_create_ctl.btn(bt8); ButtonConfig(btn7, "overdue_management"); Controls.Add(btn); Controls.Add(btn1); Controls.Add(btn2); Controls.Add(btn3); Controls.Add(btn5); Controls.Add(btn6); Controls.Add(btn7); //MessageBox.Show("login_frm.Member_rank : " + login_frm.Member_rank); if (login_frm.Member_rank == 4) // 비회원 { user1.Show(); btn1.Hide(); btn2.Hide(); btn3.Hide(); btn5.Hide(); btn6.Hide(); btn7.Hide(); } //else if (member_rank == 0) //관리자 //{ // btn.Hide(); // btn1.Hide(); // btn2.Hide(); // btn3.Hide(); //} //else if(member_rank == 1) //유저 //{ // user1.Show(); // btn4.Hide(); // btn5.Hide(); // btn6.Hide(); // btn7.Hide(); //} //라벨 ============================================================================================================================================== ArrayList lbarray = new ArrayList(); lbarray.Add(new LBclass(this, "Login", "Login /", 15, 90, 30, 1500 - 190, 10, label_Click)); lbarray.Add(new LBclass(this, "Signup", "Signup", 15, 90, 30, 1500 - 100, 10, label2_Click)); lbarray.Add(new LBclass(this, "Logout", "Logout", 15, 90, 30, 1500 - 100, 10, label3_Click)); for (int i = 0; i < lbarray.Count; i++) { Label lb = comm_create_ctl.lb((LBclass)lbarray[i]); lb.Visible = true; lb.Cursor = Cursors.Hand; lb.Parent = pictureBox; lb.BackColor = Color.FromArgb(201, 253, 223); lb.BringToFront(); lb.ForeColor = Color.FromArgb(39, 174, 97); if (lb.Name == "Login") { lb.Font = new Font("견명조", 15F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(129))); lb_Login = lb; } else if (lb.Name == "Signup") { lb.Font = new Font("견명조", 15F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(129))); lb_Signup = lb; } else if (lb.Name == "Logout") { lb.Font = new Font("견명조", 15F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(129))); lb_Logout = lb; } Controls.Add(lb); } lb_Logout.Hide(); //===================================================================================================================================================== Logo_Load();//로고 이미지 // Set the Parent Form of the Child window. //Child1.TopLevel = false; //Child1.TopMost = true; //Child1.MdiParent = this; //Child1.Dock = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림. //panel1.Controls.Add(Child1); //Child2.Show(); //Child1.Show(); //Child1.Dispose(); //Set the Parent Form of the Child window. user1.TopLevel = false; user1.TopMost = true; user1.MdiParent = this; user1.Dock = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림. panel1.Controls.Add(user1); user2.TopLevel = false; user2.TopMost = true; user2.MdiParent = this; user2.Dock = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림. panel1.Controls.Add(user2); user3.TopLevel = false; user3.TopMost = true; user3.MdiParent = this; user3.Dock = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림. panel1.Controls.Add(user3); user4.TopLevel = false; user4.TopMost = true; user4.MdiParent = this; user4.Dock = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림. panel1.Controls.Add(user4); Login.TopLevel = false; Login.TopMost = true; Login.MdiParent = this; Login.Dock = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림. panel1.Controls.Add(Login); Signup.TopLevel = false; Signup.TopMost = true; Signup.MdiParent = this; Signup.Dock = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림. panel1.Controls.Add(Signup); root2.TopLevel = false; root2.TopMost = true; root2.MdiParent = this; root2.Dock = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림. panel1.Controls.Add(root2); root3.TopLevel = false; root3.TopMost = true; root3.MdiParent = this; root3.Dock = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림. panel1.Controls.Add(root3); root4.TopLevel = false; root4.TopMost = true; root4.MdiParent = this; root4.Dock = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림. panel1.Controls.Add(root4); }
int sX = 490, sY = 240; // 폼 사이즈 지정. public Login_Check(BOOK_INFO_FORM form) { InitializeComponent(); this.form = form; Load += Login_Check_Load; }
private void btn1_Click(object sender, EventArgs e) { if (Tb2.Text == PW_Select(Tb1.Text)) { MessageBox.Show("로그인 성공"); form.lb_Logout.Show(); MySql my = new MySql(); string sql = string.Format("select user_number, member_rank from signup where id = '{0}' && passwod = '{1}';", Tb1.Text, Tb2.Text); MySqlDataReader sdr = my.Reader(sql); while (sdr.Read()) { user_Number = Convert.ToInt32(sdr.GetValue(0).ToString()); member_rank = Convert.ToInt32(sdr.GetValue(1).ToString()); //MessageBox.Show(sdr.GetValue(1).ToString()); } this.Hide(); if (member_rank == 1) { form.user1.Show(); form.btn1.Show(); form.btn2.Show(); form.btn3.Show(); form.btn.Show(); form.Login.Hide(); form.Signup.Hide(); } if (member_rank == 0) { form.user1.Hide(); form.user1.Dispose(); BOOK_INFO_FORM login_user1 = new BOOK_INFO_FORM(form); //user1.FormBorderStyle = FormBorderStyle.None; login_user1.TopLevel = false; login_user1.TopMost = true; login_user1.MdiParent = form; login_user1.Dock = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림. form.panel1.Controls.Add(login_user1); form.user1 = login_user1; form.user1.Show(); form.btn5.Show(); form.btn6.Show(); form.btn7.Show(); form.btn.Show(); form.Login.Hide(); form.Signup.Hide(); } if (member_rank == 4) { form.lb_Login.Show(); form.lb_Signup.Show(); } else { form.lb_Login.Hide(); form.lb_Signup.Hide(); } } else { MessageBox.Show("아이디 또는 비밀번호가 틀립니다."); } }
private void btn1_Click(object sender, EventArgs e) { if (Tb2.Text == PW_Select(Tb1.Text)) { // MessageBox.Show("로그인 성공"); form.lb_Logout.Show(); Hashtable user_info = User_Number_Member_Rank_Chk_API(Tb1.Text, Tb2.Text); user_Number = Convert.ToInt32(user_info["user_Number"].ToString()); member_rank = Convert.ToInt32(user_info["member_rank"].ToString()); //MessageBox.Show("user_Number : " + user_Number.ToString() + " member_rank : " + member_rank.ToString()); this.Hide(); if (member_rank == 1) { form.user1.Show(); form.btn1.Show(); form.btn2.Show(); form.btn3.Show(); form.btn.Show(); form.Login.Hide(); form.Signup.Hide(); } if (member_rank == 0) { form.user1.Hide(); form.user1.Dispose(); BOOK_INFO_FORM login_user1 = new BOOK_INFO_FORM(form); //user1.FormBorderStyle = FormBorderStyle.None; login_user1.TopLevel = false; login_user1.TopMost = true; login_user1.MdiParent = form; login_user1.Dock = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림. form.panel1.Controls.Add(login_user1); form.user1 = login_user1; form.user1.Show(); form.btn5.Show(); form.btn6.Show(); form.btn7.Show(); form.btn.Show(); form.Login.Hide(); form.Signup.Hide(); } if (member_rank == 4) { form.lb_Login.Show(); form.lb_Signup.Show(); } else { form.lb_Login.Hide(); form.lb_Signup.Hide(); } } else { fail fail = new fail("아이디 또는 비밀번호가 틀립니다."); fail.ShowDialog(); } }