コード例 #1
0
        private void InitForm()
        {
            AppCtrl.InitTreeChonNhanVien_Choice1(NhanVien, true);
            DMCMucDoUuTien.I.InitCtrl(cboMuc_uu_tien, true, true);
            DATapTinInAn.InitCtrl(PLTinhtrang);
            lblThoiGianGui.Text = HelpDB.getDatabase().GetSystemCurrentDateTime().ToString(PLConst.FORMAT_DATETIME_STRING);
            if (IsAdd == true)
            {
                do_InAn = DAHoTroInAn.Instance.Load(-2);
                do_InAn.ID = HelpDB.getDatabase().GetID("G_NGHIEP_VU");
                _ID = do_InAn.ID;
                lblNguoiGui.Text = DACongViec.getNameNV(FrameworkParams.currentUser.employee_id);
                do_luu_tru_tt = DALuuTruTapTin.Instance.LoadAll(-2);
                btnLuu.Visible = true;
                btnThemTT.Visible = true;
                PLTinhtrang._setSelectedID(1);
            }
            else
            {
                do_InAn = DAHoTroInAn.Instance.Load(_ID);
                do_luu_tru_tt = DADocument.Instance.load_DOTapTin(_ID);
                NhanVien._setSelectedID(HelpNumber.ParseInt64(do_InAn.NGUOI_NHAN_ID));
                cboMuc_uu_tien._setSelectedID(HelpNumber.ParseInt64(do_InAn.MUC_DO_UU_TIEN_ID));
                lblNguoiGui.Text = DACongViec.getNameNV(do_InAn.NGUOI_GUI_ID);
                PLTinhtrang._setSelectedID(do_InAn.TINH_TRANG_IN_ID);
                memoMucDich.Text = do_InAn.MUC_DICH;
                if (do_InAn.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_InAn = DAHoTroInAn.Instance.Load(-2);
                        btnLuu.Visible = true;
                        IsAdd = true;
                        return;
                    }
                }
                if (IsAdd == false)
                {
                    btnLuu.Visible = true;
                    btnThemTT.Visible = true;
                }
                else
                {
                    cot_suafile.LayoutViewField.Visibility = cot_xoa.LayoutViewField.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                    btnThemTT.Visible = false;
                    lblThoiGianGui.Text = do_InAn.THOI_GIAN_CAP_NHAT.ToString();

                }
                LoadTapTin(_ID);
            }
        }
コード例 #2
0
 void frm_RefreshFrbug(DOHoTroInAn doHoTroIn)
 {
     DataRow dr = gridViewMaster.GetDataRow(gridViewMaster.FocusedRowHandle);
     dr["NGUOI_GUI_ID"] = doHoTroIn.NGUOI_GUI_ID;
     dr["NGUOI_NHAN_ID"] = doHoTroIn.NGUOI_NHAN_ID;
     dr["THOI_GIAN_CAP_NHAT"] = doHoTroIn.THOI_GIAN_CAP_NHAT;
     dr["TINH_TRANG_IN_ID"] = doHoTroIn.TINH_TRANG_IN_ID;
     dr["MUC_DICH"] = doHoTroIn.MUC_DICH;
     dr["MUC_DO_UU_TIEN_ID"] = doHoTroIn.MUC_DO_UU_TIEN_ID;
 }