Beispiel #1
0
 /// <summary>
 /// Xem chi tiết
 /// </summary>
 private void Xem()
 {
     if (tlbView.IsEnabled == false)
     {
         return;
     }
     Cursor = Cursors.Wait;
     if (dgrVongVayDS.SelectedItems.Count == 1)
     {
         DataRow     dr          = ((DataRowView)dgrVongVayDS.SelectedItems[0]).Row;
         ucVongVayCT usercontrol = new ucVongVayCT();
         usercontrol.OnSavingComleted += new EventHandler(usercontrol_OnSavingComleted);
         usercontrol.IdVongVay         = Convert.ToInt32(dr["ID"]);
         usercontrol.BSuaDuLieu        = false;
         LoadDuLieuCT dlgLoadDuLieuCT = new LoadDuLieuCT(usercontrol.LoadDuLieu);
         dlgLoadDuLieuCT();
         Window window = new Window();
         string tittle = DatabaseConstant.layNgonNguTieuDeForm(this.Function);
         window.Title   = tittle;
         window.Content = usercontrol;
         window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
         window.ShowDialog();
     }
     else
     {
         LMessage.ShowMessage("M.DungChung.KhongDuocChonNhieu", LMessage.MessageBoxType.Warning);
     }
     Cursor = Cursors.Arrow;
 }
 /// <summary>
 /// Sửa dữ liệu
 /// </summary>
 private void Xem()
 {
     if (tlbView.IsEnabled == false)
     {
         return;
     }
     if (grdDangKySanPhamDS.SelectedItems.Count == 1)
     {
         DataRow           dr          = ((DataRowView)grdDangKySanPhamDS.SelectedItems[0]).Row;
         ucDangKySanPhamCT ucSanPhamCT = new ucDangKySanPhamCT();
         ucSanPhamCT.IdSanPham         = Convert.ToInt32(dr["ID"]);
         ucSanPhamCT.OnSavingComleted += new EventHandler(ucSanPhamCT_OnSavingComleted);
         LoadDuLieuCT loadDuLieu = new LoadDuLieuCT(ucSanPhamCT.LoadDuLieuCT);
         loadDuLieu(false);
         Window frm = new Window();
         frm.Title = DatabaseConstant.layNgonNguTieuDeForm(this.function);
         frm.WindowStartupLocation = WindowStartupLocation.CenterScreen;
         frm.Content = ucSanPhamCT;
         frm.ShowDialog();
     }
     else
     {
         LMessage.ShowMessage("M.DungChung.KhongDuocChonNhieu", LMessage.MessageBoxType.Warning);
     }
 }
 private void Xem()
 {
     if (!tlbView.IsEnabled)
     {
         return;
     }
     Cursor = Cursors.Wait;
     if (raddgrSanPham.SelectedItems.Count == 1)
     {
         DataRowView dr        = (DataRowView)raddgrSanPham.SelectedItems[0];
         ucSanPhamTD ucSanPham = new ucSanPhamTD();
         ucSanPham.IdSanPham         = Convert.ToInt32(dr["ID"]);
         ucSanPham.OnSavingComleted += new EventHandler(objHDTDThoaThuan_OnSavingCompleted);
         LoadDuLieuCT loadDuLieu = new LoadDuLieuCT(ucSanPham.LoadDuLieuCT);
         loadDuLieu(false);
         string tittle = DatabaseConstant.layNgonNguTieuDeForm(this.Function);
         Window window = new Window();
         window.Title = tittle;
         window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
         window.Content = ucSanPham;
         window.ShowDialog();
     }
     else if (raddgrSanPham.SelectedItems.Count > 1)
     {
         LMessage.ShowMessage("M.DungChung.KhongDuocChonNhieu", LMessage.MessageBoxType.Warning);
     }
     Cursor = Cursors.Arrow;
 }
        /// <summary>
        /// Sửa dữ liệu
        /// </summary>
        private void onModify(int id, string loaiDoiTuong)
        {
            ucRegistrationCT ct = new ucRegistrationCT();

            ct.ID           = id;
            ct.LOAIDOITUONG = loaiDoiTuong;

            LoadDuLieuCT dlgLoadDuLieuCT = new LoadDuLieuCT(ct.beforeModifyFromList);

            dlgLoadDuLieuCT();

            Window window = new Window();

            window.Title   = DatabaseConstant.layNgonNguTieuDeForm(DatabaseConstant.Function.SYS_JOB_SUBSCRIBE);
            window.Content = ct;
            window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            window.Height     = 200;
            window.Width      = 500;
            window.ResizeMode = ResizeMode.NoResize;
            window.ShowDialog();
            BuildGridDoiTuong();
            loadWidthColumnDoiTuong();
        }