Beispiel #1
0
        private void Change()
        {
            HRM_CONTRACT hRMCONTRACT         = new HRM_CONTRACT();
            object       focusedRowCellValue = this.gbList.GetFocusedRowCellValue("ContractCode");

            if (focusedRowCellValue != null)
            {
                base.SetWaitDialogCaption("Đang kiểm tra dữ liệu....");
                if (!(hRMCONTRACT.Get(focusedRowCellValue.ToString()) != "OK"))
                {
                    this.DoHide();
                    xfmContractAdd _xfmContractAdd = new xfmContractAdd(Actions.Update, hRMCONTRACT);
                    _xfmContractAdd.Updated += new xfmContractAdd.UpdatedEventHander(this.frm_Updated);
                    _xfmContractAdd.Added   += new xfmContractAdd.AddedEventHander(this.frm_Added);
                    _xfmContractAdd.ShowDialog();
                }
                else
                {
                    this.DoHide();
                    XtraMessageBox.Show("Dữ liệu không tồn tại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
        }
Beispiel #2
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            rptListContract _rptListContract;
            rptContract     _rptContract;
            xfmReport       _xfmReport = new xfmReport("Hợp Đồng Lao Động");

            if (this.m_Value == 1)
            {
                _rptListContract = new rptListContract(this.m_Level, this.m_Code, "0");
                _xfmReport.SetTitle("Danh Sách Tất Cả HĐLĐ Của Nhân Viên");
                _xfmReport.ShowPrintPreview(_rptListContract);
            }
            else if (this.m_Value == 2)
            {
                _rptListContract = new rptListContract(this.m_Level, this.m_Code, "1");
                _xfmReport.SetTitle("Danh Sách Nhân Viên Sắp Hết Hạn HĐLĐ");
                _xfmReport.ShowPrintPreview(_rptListContract);
            }
            else if (this.m_Value == 3)
            {
                _rptListContract = new rptListContract(this.m_Level, this.m_Code, "2");
                _xfmReport.SetTitle("Danh Sách Nhân Viên Đã Hết Hạn HĐLĐ");
                _xfmReport.ShowPrintPreview(_rptListContract);
            }
            else if (!(this.m_Value == 5 ? false : this.m_Value != 0))
            {
                _xfmReport.SetTitle("Hợp Đồng Lao Động");
                HRM_CONTRACT hRMCONTRACT = new HRM_CONTRACT();
                hRMCONTRACT.Get(this.m_ContractCode);
                clsContractOption _clsContractOption = new clsContractOption();

                // HD Xác định thoi hạn

                if (hRMCONTRACT.ContractType == 0)
                {
                    if (!(_clsContractOption.FilePath0 == ""))
                    {
                        _rptContract = new rptContract(this.m_ContractCode, this.m_EmployeeCode, _clsContractOption.FilePath0);
                        _xfmReport.ShowPrintPreview(_rptContract);
                    }
                    else
                    {
                        _xfmReport.ShowPrintPreview(new rptContract0(this.m_ContractCode, this.m_EmployeeCode));
                    }
                }

                // khong xác dinh thoi han
                else if (hRMCONTRACT.ContractType == 1)
                {
                    if (!(_clsContractOption.FilePath1 == ""))
                    {
                        _rptContract = new rptContract(this.m_ContractCode, this.m_EmployeeCode, _clsContractOption.FilePath1);
                        _xfmReport.ShowPrintPreview(_rptContract);
                    }
                    else
                    {
                        _xfmReport.ShowPrintPreview(new rptContract1(this.m_ContractCode, this.m_EmployeeCode));
                    }
                }
                else if (hRMCONTRACT.ContractType == 2)
                {
                    if (!(_clsContractOption.FilePath2 == ""))
                    {
                        _rptContract = new rptContract(this.m_ContractCode, this.m_EmployeeCode, _clsContractOption.FilePath2);
                        _xfmReport.ShowPrintPreview(_rptContract);
                    }
                    else
                    {
                        _xfmReport.ShowPrintPreview(new rptContract2(this.m_ContractCode, this.m_EmployeeCode));
                    }
                }
                else if (hRMCONTRACT.ContractType == 3)
                {
                    if (!(_clsContractOption.FilePath3 == ""))
                    {
                        _rptContract = new rptContract(this.m_ContractCode, this.m_EmployeeCode, _clsContractOption.FilePath3);
                        _xfmReport.ShowPrintPreview(_rptContract);
                    }
                    else
                    {
                        _xfmReport.ShowPrintPreview(new rptContract3(this.m_ContractCode, this.m_EmployeeCode));
                    }
                }
            }
            else if (this.m_Value == 6)
            {
                _rptListContract = new rptListContract(this.m_Level, this.m_Code, "6");
                _xfmReport.SetTitle("Danh Sách HĐLĐ Đang Quản Lý");
                _xfmReport.ShowPrintPreview(_rptListContract);
            }
        }