コード例 #1
0
        public void Luu(DatabaseConstant.Action action)
        {
            if (grDanhSach.SelectedItems.Count == 1 || action == DatabaseConstant.Action.THEM || action == DatabaseConstant.Action.SUA)
            {
                try
                {
                    int id = 0;
                    if (grDanhSach.SelectedItems.Count > 0)
                    {
                        id = Convert.ToInt32(((DataRow)grDanhSach.SelectedItems.First())[0]);
                    }

                    string loaiDoiTuong = ((RadTreeViewItem)tvwTree.SelectedItem).Tag.ToString();

                    ucRegistrationCT ct     = new ucRegistrationCT();
                    Window           window = new Window();
                    window.Title   = DatabaseConstant.layNgonNguTieuDeForm(DatabaseConstant.Function.SYS_JOB_SUBSCRIBE);
                    window.Content = ct;
                    window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                    window.ShowDialog();
                    BuildGridDoiTuong();
                    loadWidthColumnDoiTuong();
                }
                catch (System.Exception ex)
                {
                    CommonFunction.ThongBaoLoi(ex);
                    LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                }
                Mouse.OverrideCursor = Cursors.Arrow;
            }
            else
            {
                LMessage.ShowMessage("M.DungChung.KhongDuocChonNhieu", LMessage.MessageBoxType.Warning);
            }
        }
コード例 #2
0
        /// <summary>
        /// Xem dữ liệu
        /// </summary>
        private void onView(int id, string loaiDoiTuong)
        {
            ucRegistrationCT ct     = new ucRegistrationCT();
            Window           window = new Window();

            window.Title   = DatabaseConstant.layNgonNguTieuDeForm(DatabaseConstant.Function.SYS_JOB_SUBSCRIBE);
            window.Content = ct;
            window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            window.ShowDialog();
            BuildGridDoiTuong();
            loadWidthColumnDoiTuong();
        }
コード例 #3
0
        /// <summary>
        /// Thêm mới dữ liệu
        /// </summary>
        private void onAddNew()
        {
            string           loaiDoiTuong = ((RadTreeViewItem)tvwTree.SelectedItem).Tag.ToString();
            ucRegistrationCT ct           = new ucRegistrationCT();

            ct.ID           = 0;
            ct.LOAIDOITUONG = loaiDoiTuong;
            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();
        }
コード例 #4
0
        /// <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();
        }