コード例 #1
0
        public void BindControl(bool refreshHeader)
        {
            this.refreshHeaderGrid = refreshHeader;
            if (InitialFlag.Equals(FlagEnum.ViewFlag))
            {
                ctlAddAdvance.Enabled = false;
                ctlTANoLookup.Visible = false;
                ctlDeleteTA.Visible   = false;
            }
            else
            {
                ctlAddAdvance.Enabled = true;
                ctlTANoLookup.Visible = true;
                ctlDeleteTA.Visible   = true;
            }

            if (this.DocumentType.Equals(ZoneType.Domestic))
            {
                this.IsDomestic = true;
                ctlRemittanceGridview.Visible = false;
                ctlTALookup.TravelBy          = TravellBy.Domestic;
                ctlControlPanel.Visible       = false;
            }
            else
            {
                this.IsDomestic = false;
                ctlRemittanceGridview.Visible = true;
                ctlTALookup.TravelBy          = TravellBy.Foreign;
                ctlControlPanel.Visible       = true;
            }

            ExpenseDataSet expenseDS = (ExpenseDataSet)TransactionService.GetDS(this.TransactionId);

            ExpenseDataSet.FnExpenseDocumentRow row = expenseDS.FnExpenseDocument.FindByExpenseID(this.ExpDocumentID);
            if (!row.IsTADocumentIDNull())
            {
                ctlTANoLookup.Enabled = false;
                TADocument ta = ScgeAccountingQueryProvider.TADocumentQuery.FindByIdentity(row.TADocumentID);
                SS.Standard.WorkFlow.DTO.WorkFlow wf = SS.Standard.WorkFlow.Query.WorkFlowQueryProvider.WorkFlowQuery.GetWorkFlowByDocumentID(ta.DocumentID.DocumentID);
                ctlAddAdvance.Enabled         = false;
                ctlTANoLabel.Visible          = false;
                ctlTALinkButton.Text          = ta.DocumentID.DocumentNo;
                ctlTALinkButton.OnClientClick = "window.open('../Programs/DocumentView.aspx?wfid=" + wf.WorkFlowID.ToString() + "')";
                ctlBusinessChk.Checked        = !(row.IsIsBusinessPurposeNull() || row.IsBusinessPurpose == false);
                ctlTrainingChk.Checked        = !(row.IsIsTrainningPurposeNull() || row.IsTrainningPurpose == false);
                ctlOtherChk.Checked           = !(row.IsIsOtherPurposeNull() || row.IsOtherPurpose == false);
                ctlOther.Text   = row.IsOtherPurposeDescriptionNull() ? String.Empty : row.OtherPurposeDescription;
                ctlCountry.Text = row.IsCountryNull() ? String.Empty : row.Country;

                if (!row.IsFromDateNull())
                {
                    ctlFromDateCal.Value = row.FromDate;
                }
                if (!row.IsToDateNull())
                {
                    ctlToDateCal.Value = row.ToDate;
                }

                ctlPersonLevel.Text            = row.IsPersonalLevelNull() ? String.Empty : row.PersonalLevel;
                ctlExchangeRateForPerdiem.Text = row.IsExchangeRateForUSDAdvanceNull() ? String.Empty : row.ExchangeRateForUSDAdvance.ToString();
            }
            else
            {
                ResetTADataZone();
                if (expenseDS.FnExpenseAdvance.Rows.Count > 0)
                {
                    ctlTANoLookup.Enabled = false;
                    ctlDeleteTA.Enabled   = false;
                }
            }

            BindAdvanceGridView();
            BindRemittanceGridview();
            ctlUpdatePanelExpenseGeneral.Update();
        }