private void btnEnter_Click(object sender, RoutedEventArgs e) { mTransit.NhanVien = Data.BONhanVien.Login(txtUserID.Text.Trim(), Utilities.SecurityKaraoke.GetMd5Hash(txtPassword.Text.Trim(), mTransit.HashMD5), mTransit); if (mTransit.NhanVien == null) { if (mTransit.Admin.TenDangNhap == txtUserID.Text.Trim() && mTransit.Admin.MatKhau == Utilities.SecurityKaraoke.GetMd5Hash(txtPassword.Text.Trim(), mTransit.HashMD5)) { mTransit.NhanVien = new Data.NHANVIEN(); mTransit.NhanVien.LoaiNhanVienID = mTransit.Admin.LoaiNhanVienID; mTransit.NhanVien.TenNhanVien = mTransit.Admin.TenNhanVien; mTransit.NhanVien.NhanVienID = 0; } else { lbStatus.Text = "Tên đăng nhập hoặc mật khẩu không đúng"; } } else { BONhanVien.ThemLichSuDangNhap(mTransit.NhanVien.NhanVienID); mTransit.LayDanhSachQuyen(); } if (mTransit.NhanVien != null) { MainWindow win = new MainWindow(mTransit); this.Hide(); win.ShowDialog(); } }
private void AddSwaggerCommand(object sender, EventArgs e) { var project = VsHelpers.GetActiveProject(_dte); //todo: figure out if we doing CS or TS based on project type - if possible //todo: if we on a folder node, path should be folder var uiOptions = new UIOptions { Overwrite = true }; uiOptions.Target = Path.Combine(Path.GetDirectoryName(project.FullName), "api.cs"); var window = new MainWindow(); window.SetUI(uiOptions); window.ShowDialog(); }