コード例 #1
0
        protected void Advance_OnObjectLookUpCalling(object sender, ObjectLookUpCallingEventArgs e)
        {
            UserControls.LOV.AV.AdvanceLookup advanceLookUp = sender as UserControls.LOV.AV.AdvanceLookup;
            ExpenseDataSet expenseDS = (ExpenseDataSet)TransactionService.GetDS(this.TransactionId);

            ExpenseDataSet.FnExpenseDocumentRow row = expenseDS.FnExpenseDocument.FindByExpenseID(this.ExpDocumentID);

            if (!row.IsMainCurrencyIDNull())
            {
                this.MainCurrencyID = row.MainCurrencyID;
            }

            if (!row.IsPBIDNull())
            {
                this.PBID = row.PBID;
            }

            this.IsRepOffice = row.IsIsRepOfficeNull() ? false : row.IsRepOffice;

            advanceLookUp.CompanyID   = CompanyID;   // UIHelper.ParseLong(((LOV.SCG.DB.CompanyField)this.Parent.Parent.Parent.Parent.FindControl("ctlCompanyField")).CompanyID);
            advanceLookUp.RequesterID = RequesterID; // UIHelper.ParseLong(((ActorData)this.Parent.Parent.Parent.Parent.FindControl("ctlRequesterData")).UserID);
            advanceLookUp.AdvanceType = FnExpenseDocumentService.GetExpenseType(this.ExpDocumentID, this.TransactionId);
            advanceLookUp.IsRelateWithRemittanceButNotInExpense = true;
            advanceLookUp.PBID           = this.PBID;
            advanceLookUp.MainCurrencyID = this.MainCurrencyID;
            advanceLookUp.IsRepOffice    = this.IsRepOffice;
            if (!string.IsNullOrEmpty(Request.Params["wfid"]) && UIHelper.ParseInt(Request.Params["wfid"]) > 0)
            {
                long workFlowID = UIHelper.ParseLong(Request.Params["wfid"]);

                SS.Standard.WorkFlow.DTO.WorkFlow wf = WorkFlowQueryProvider.WorkFlowQuery.FindByIdentity(workFlowID);
                if (wf != null && wf.CurrentState != null && wf.CurrentState.Name != null && wf.CurrentState.Name.Equals(WorkFlowStateFlag.Draft))
                {
                    advanceLookUp.CurrentUserID = UserAccount.UserID;
                }
            }
            else
            {
                advanceLookUp.CurrentUserID = UserAccount.UserID;
            }
        }