public frmKhachhang(frmDashboard frm) { InitializeComponent(); this.frmDB = frm; ctr_navbar1.txt_title.Text = "Quản lí khách hàng"; ctr_menu1.btn_menu_2.Enabled = false; // button menu clicked ctr_menu1.btn_menu_1.Click += new EventHandler(btnMenu1_click); ctr_menu1.btn_menu_3.Click += new EventHandler(btnMenu3_click); ctr_menu1.btn_menu_4.Click += new EventHandler(btnMenu4_click); ctr_menu1.btn_menu_5.Click += new EventHandler(btnMenu5_click); ctr_menu1.btn_menu_info.Click += new EventHandler(btnMenuInfo_click); // button navbar clicked ctr_navbar1.btn_close.Click += new EventHandler(btnClose_click); ctr_navbar1.btn_toggle_menu.Click += new EventHandler(btnToggleMenu_click); // move form ctr_navbar1.MouseMove += new MouseEventHandler(ctr_navbar1_MouseMove); ctr_navbar1.MouseDown += new MouseEventHandler(ctr_navbar1_MouseDown); //load gridview loadGridKhachHangByTenKH(); dgrv_kh.Click += new EventHandler(loadData); //divide GenericPrincipal principal = Thread.CurrentPrincipal as GenericPrincipal; if (principal.IsInRole("client ") || principal.IsInRole("guest ")) { //tbnxoa.Enabled = false; //btnxoa.Enabled = false; //btnxoa.e btnxoa.Enabled = false; } }
private void btnLogin_Click(object sender, EventArgs e) { User user = new User() { UserName = txtUserName.Text, HashPassword = User.MD5Hash(txtPassword.Text) }; if (user.Authenticate()) { string role = ""; foreach (var row in user.Roles) { role += row.RoleName + " "; } GenericIdentity genericIdentity = new GenericIdentity("Ứng Dụng Quản Lý Vé Xe"); GenericPrincipal genericPrincipal = new GenericPrincipal(genericIdentity, new string[] { role }); Thread.CurrentPrincipal = genericPrincipal; frmDashboard frm = new frmDashboard(); frm.Show(); //MessageBox.Show("Đăng nhập thành công.\n" + // "UserID là "+user.UserName); } else { MessageBox.Show("Đăng nhập thất bại.\n"); } }
public frmTuyenXe(frmDashboard frm) { InitializeComponent(); frmDB = frm; // button menu clicked ctr_menu1.btn_menu_4.Enabled = false; ctr_menu1.btn_menu_1.Click += new EventHandler(btnMenu1_click); ctr_menu1.btn_menu_2.Click += new EventHandler(btnMenu2_click); ctr_menu1.btn_menu_3.Click += new EventHandler(btnMenu3_click); ctr_menu1.btn_menu_5.Click += new EventHandler(btnMenu5_click); ctr_menu1.btn_menu_info.Click += new EventHandler(btnMenuInfo_click); // button navbar clicked ctr_navbar1.btn_close.Click += new EventHandler(btnClose_click); ctr_navbar1.btn_toggle_menu.Click += new EventHandler(btnToggleMenu_click); // move form ctr_navbar1.MouseMove += new MouseEventHandler(ctr_navbar1_MouseMove); ctr_navbar1.MouseDown += new MouseEventHandler(ctr_navbar1_MouseDown); }
public frmVeBan(frmDashboard frm) { InitializeComponent(); frmDB = frm; ctr_navbar_title.txt_title.Text = "Danh Sách Vé Bán"; //set position title and btn close ctr_navbar_title.txt_title.Location = new Point(panel_navbar_title.Width / 2 - 80, panel_navbar_title.Height / 2 - 12); ctr_navbar_title.btn_close.Location = new Point(panel_navbar_title.Width - 30, panel_navbar_title.Height / 2 - 12); // move form ctr_navbar_title.MouseMove += new MouseEventHandler(ctr_navbar1_MouseMove); ctr_navbar_title.MouseDown += new MouseEventHandler(ctr_navbar1_MouseDown); // button navbar clicked ctr_navbar_title.btn_close.Click += new EventHandler(btnClose_click); //load GridView vé bán loadGridViewVeBan(); }
public frmDatVe(frmDashboard frm) { InitializeComponent(); frmDB = frm; ctr_menu.btn_menu_1.Enabled = false; ctr.txt_title.Text = "Đặt Vé"; this._khachHang = new DTO_KhachHang(); // button menu clicked ctr_menu.btn_menu_2.Click += new EventHandler(btnMenu2_click); ctr_menu.btn_menu_3.Click += new EventHandler(btnMenu3_click); ctr_menu.btn_menu_4.Click += new EventHandler(btnMenu4_click); ctr_menu.btn_menu_5.Click += new EventHandler(btnMenu5_click); ctr_menu.btn_menu_info.Click += new EventHandler(btnMenuInfo_click); // button navbar clicked ctr.btn_close.Click += new EventHandler(btnClose_click); ctr.btn_toggle_menu.Click += new EventHandler(btnToggleMenu_click); // move form ctr.MouseMove += new MouseEventHandler(ctr_navbar1_MouseMove); ctr.MouseDown += new MouseEventHandler(ctr_navbar1_MouseDown); }