Example #1
0
        private void initform()
        {
            XtraGridSupportExt.TextLeftColumn(cot_xoa, "xoa_file");
            XtraGridSupportExt.TextLeftColumn(cot_luufile, "luu_file");
            XtraGridSupportExt.TextLeftColumn(cot_mofile, "mo_file");
            XtraGridSupportExt.TextLeftColumn(cot_suafile, "sua_file");
            toolTip1.BackColor = Color.LightYellow;
            layoutView1.OptionsCustomization.AllowSort = false;
            layoutView1.OptionsCustomization.AllowFilter = false;
            repositoryItemButtonEdit2.ButtonClick += new ButtonPressedEventHandler(repositoryItemButtonEdit2_ButtonClick);
            repositoryItemPictureEdit1.SizeMode = PictureSizeMode.Squeeze;
            DMLoaiTaiLieu.I.InitCtrl(LoaiTL, true, true);
            LoaiTL.ToolTip = string.Empty;
            lblNguoiCapNhat.Text = DMFWNhanVien.GetFullName(FrameworkParams.currentUser.employee_id);
            TxtTg_cap_nhat.Text = DABase.getDatabase().GetSystemCurrentDateTime().ToString(PLConst.FORMAT_DATETIME_STRING);

            if (IsAdd == true)
            {
                do_tl = DADocument.Instance.Load(-2);
                do_tl.ID = DABase.getDatabase().GetID(PLDBUtil.G_NGHIEP_VU);
                _ID = do_tl.ID;

                do_luu_tru_tt = DALuuTruTapTin.Instance.LoadAll(-2);
                TenTL.Enabled = true;
                btnSave.Visible = true;
                themtt = true;
                do_tl.DUYET = "1";
            }
            else
            {

                do_tl = DADocument.Instance.Load(_ID);
                do_luu_tru_tt = DADocument.Instance.load_DOTapTin(_ID);
                TenTL.Text = do_tl.TEN_TAI_LIEU;
                LoaiTL._setSelectedID(HelpNumber.ParseInt64(do_tl.LOAI_TAI_LIEU_ID));
                Phien_ban.Text = do_tl.PHIEN_BAN;
                Noidung.DocumentText = do_tl.MO_TA;
                load_TapTin(_ID);
                if (do_tl.ID == 0)
                {
                    PLMessageBox.ShowErrorMessage("Dữ liệu đã bị mất.....");
                    if (PLMessageBox.ShowConfirmMessage("Bạn có muốn thêm dữ liệu.") == DialogResult.No)
                        return;
                    else
                    {
                        do_tl = DADocument.Instance.Load(-2);
                        TenTL.Enabled = true;
                        btnSave.Visible = true;
                        IsAdd = true;
                        return;
                    }
                }

                if (IsAdd == false)
                {

                    TenTL.Enabled = true;
                    btnSave.Visible = true;
                    if (DADocument.check_exists_taptin_in_tailieu(_ID))
                    {
                        ///
                    }

                    themtt = true;

                }
            }
            Duyet.SetDuyet(do_tl);
        }
        private void InitData()
        {
            popupControlContainer1.Show();
            do_TL = DADocument.Instance.LoadAll(-2);
            gridDataSet = do_TL.DetailDataSet.Copy();

            gridDSCongviec.DataSource = gridDataSet.Tables[0];
        }
Example #3
0
 public static void setRowCellDefaultValue(DataRow row, DODocument doTailieu)
 {
     row.BeginEdit();
     //row["NGUOI_GUI"] = doTailieu.NGUOI_GUI;
     //row["NGAY_GUI"] = doTailieu.NGAY_GUI;
     row["NGUOI_CAP_NHAT"] = doTailieu.NGUOI_CAP_NHAT;
     row["NGAY_CAP_NHAT"] = doTailieu.NGAY_CAP_NHAT;
 }
        void frm_RefreshUpdate(DODocument doDocument)
        {
            DataRow row = gridViewDSCongviec.GetDataRow(gridViewDSCongviec.FocusedRowHandle);
            row["NAME"] = doDocument.NAME;
            row["PHIEN_BAN"] = doDocument.PHIEN_BAN;
            row["NGAY_CAP_NHAT"] = doDocument.NGAY_CAP_NHAT;
            row["NGUOI_CAP_NHAT"] = doDocument.NGUOI_CAP_NHAT;
            if (HelpNumber.ParseInt64(row["LOAI_TAI_LIEU_ID"]) != doDocument.LOAI_TAI_LIEU_ID)
            {
                TreeListNode node = treeListNhomTL.FindNodeByFieldValue("ID", doDocument.LOAI_TAI_LIEU_ID);
                int i = -1;
                if (node != null)
                {
                    node.Selected = true;
                    treeListNhomTL.FocusedNode = node;
                    DataTable view = gridDSCongviec.DataSource as DataTable;
                    DataRow[] arrRow = view.Select("1=1", "NAME ASC");
                    foreach (DataRow rowView in arrRow)
                    {
                        i++;
                        if (HelpNumber.ParseInt64(rowView["ID"]) == doDocument.ID)
                        {
                            gridViewDSCongviec.FocusedRowHandle = i;
                            gridViewDSCongviec.SelectRow(i);
                            break;
                        }
                    }

                }
            }
        }
Example #5
0
        private void initform()
        {
            #region cardView tài liệu
            XtraGridSupportExt.TextLeftColumn(lvTieuDe, "TIEU_DE");
            XtraGridSupportExt.TextLeftColumn(lvFile_dinh_kem, "TEN_FILE");
            XtraGridSupportExt.TextLeftColumn(lvNguoiCapNhat, "TEN_NGUOI_CN");
            XtraGridSupportExt.TextLeftColumn(lvNgayCapNhat, "NGAY_CAP_NHAT");
            HelpGridColumn.CotMemoExEdit(lvGhi_chu, "GHI_CHU");
            HelpGridColumn.CotTextLeft(lvSize, "SIZE");
            XtraGridSupportExt.TextLeftColumn(cotID, "ID");
            XtraGridSupportExt.TextLeftColumn(cot_xoa, "xoa_file");
            XtraGridSupportExt.TextLeftColumn(cot_luufile, "luu_file");
            XtraGridSupportExt.TextLeftColumn(cot_mofile, "mo_file");
            XtraGridSupportExt.TextLeftColumn(cot_suafile, "sua_file");
            toolTip1.BackColor = Color.LightYellow;
            layoutView1.Appearance.CardCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            layoutView1.OptionsCustomization.AllowSort = false;
            layoutView1.OptionsCustomization.AllowFilter = false;
            lvSize.OptionsColumn.AllowEdit = false;
            lvSize.OptionsColumn.AllowFocus = false;
            lvGhi_chu.OptionsColumn.ReadOnly = true;
            layoutView1.OptionsBehavior.AllowSwitchViewModes = true;
            layoutView1.OptionsBehavior.AllowExpandCollapse = true;
            layoutView1.OptionsView.ShowCardCaption = true;
            layoutView1.OptionsHeaderPanel.EnableCustomizeButton = false;
            #endregion
            repositoryItemButtonEdit2.ButtonClick += new ButtonPressedEventHandler(repositoryItemButtonEdit2_ButtonClick);
            repositoryItemPictureEdit1.SizeMode = PictureSizeMode.Squeeze;
            DADocument.InitCtrl(LoaiTL, true);

            lblNguoiCapNhat.Text = DMFWNhanVien.GetFullName(FrameworkParams.currentUser.employee_id);
            TxtTg_cap_nhat.Text = HelpDB.getDatabase().GetSystemCurrentDateTime().ToString(PLConst.FORMAT_DATETIME_STRING);
            if (IsAdd == true)
            {
                do_tl = DADocument.Instance.Load(-2);
                do_tl.ID = HelpDB.getDatabase().GetID(PLConst.G_NGHIEP_VU);
                _ID = do_tl.ID;
                do_luu_tru_tt = DALuuTruTapTin.Instance.LoadAll(-2);
                TenTL.Enabled = true;
                btnSave.Visible = true;
                xtraTabControl1.TabPages[1].PageEnabled = false;
            }
            else
            {
                if (IsAdd == false)
                {
                    if (TaiLieuPermission.I._checkPermissionRes(_ID, PermissionOfResource.RES_PERMISSION_TYPE.UPDATE) == false)
                    {
                        HelpMsgBox.ShowNotificationMessage("Bạn không có quyền sửa tài liệu này!");
                        HelpXtraForm.CloseFormNoConfirm(this);
                        return;
                    }
                }
                do_tl = DADocument.Instance.Load(_ID);
                do_luu_tru_tt = DADocument.Instance.load_DOTapTin(_ID);
                TenTL.Text = do_tl.NAME;
                LoaiTL._setSelectedID(HelpNumber.ParseInt64(do_tl.LOAI_TAI_LIEU_ID));
                Phien_ban.Text = do_tl.PHIEN_BAN;
                Noidung.DocumentText = do_tl.MO_TA;
                Load_TapTin(_ID);

                if (do_tl.ID == 0)
                {
                    HelpMsgBox.ShowErrorMessage("Dữ liệu đã bị mất.....");
                    if (HelpMsgBox.ShowConfirmMessage("Bạn có muốn thêm dữ liệu.") == DialogResult.No)
                        return;
                    else
                    {
                        do_tl = DADocument.Instance.Load(-2);
                        TenTL.Enabled = true;
                        btnSave.Visible = true;
                        IsAdd = true;
                        return;
                    }
                }
                if (IsAdd == false)
                {
                    TenTL.Enabled = true;
                    btnSave.Visible = true;
                    themtt = true;
                }
                else
                {
                    cot_suafile.LayoutViewField.Visibility = cot_xoa.LayoutViewField.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                }
            }
        }