public void Copy(long wfid) { SS.Standard.WorkFlow.DTO.Document doc = WorkFlowQueryProvider.WorkFlowQuery.GetDocumentByWorkFlowID(wfid); if (doc.DocumentType.DocumentTypeID.Equals(DocumentTypeID.CADocument)) { Response.Redirect(String.Format("~/Forms/SCG.eAccounting/Programs/CAForm.aspx?cp=1&docId={0}", doc.DocumentID)); } }
/// <summary> /// Initializes a new instance of the DocumentAttachment class /// </summary> /// <param name="attachFileName">Initial <see cref="DocumentAttachment.AttachFileName" /> value</param> /// <param name="attachFilePath">Initial <see cref="DocumentAttachment.AttachFilePath" /> value</param> /// <param name="active">Initial <see cref="DocumentAttachment.Active" /> value</param> /// <param name="creBy">Initial <see cref="DocumentAttachment.CreBy" /> value</param> /// <param name="creDate">Initial <see cref="DocumentAttachment.CreDate" /> value</param> /// <param name="updBy">Initial <see cref="DocumentAttachment.UpdBy" /> value</param> /// <param name="updDate">Initial <see cref="DocumentAttachment.UpdDate" /> value</param> /// <param name="updPgm">Initial <see cref="DocumentAttachment.UpdPgm" /> value</param> /// <param name="rowVersion">Initial <see cref="DocumentAttachment.RowVersion" /> value</param> /// <param name="document">Initial <see cref="DocumentAttachment.Document" /> value</param> public DocumentAttachment(string attachFileName, string attachFilePath, bool active, long creBy, DateTime creDate, long updBy, DateTime updDate, string updPgm, byte[] rowVersion, SS.Standard.WorkFlow.DTO.Document document) { this.attachFileName = attachFileName; this.attachFilePath = attachFilePath; this.active = active; this.creBy = creBy; this.creDate = creDate; this.updBy = updBy; this.updDate = updDate; this.updPgm = updPgm; this.rowVersion = rowVersion; this.document = document; }
/// <summary> /// Initializes a new instance of the WorkFlow class /// </summary> /// <param name="description">Initial <see cref="WorkFlow.Description" /> value</param> /// <param name="active">Initial <see cref="WorkFlow.Active" /> value</param> /// <param name="creBy">Initial <see cref="WorkFlow.CreBy" /> value</param> /// <param name="creDate">Initial <see cref="WorkFlow.CreDate" /> value</param> /// <param name="updBy">Initial <see cref="WorkFlow.UpdBy" /> value</param> /// <param name="updDate">Initial <see cref="WorkFlow.UpdDate" /> value</param> /// <param name="updPgm">Initial <see cref="WorkFlow.UpdPgm" /> value</param> /// <param name="rowVersion">Initial <see cref="WorkFlow.RowVersion" /> value</param> /// <param name="document">Initial <see cref="WorkFlow.Document" /> value</param> /// <param name="workFlowType">Initial <see cref="WorkFlow.WorkFlowType" /> value</param> /// <param name="currentState">Initial <see cref="WorkFlow.CurrentState" /> value</param> public WorkFlow(string description, bool active, long creBy, DateTime creDate, long updBy, DateTime updDate, string updPgm, byte[] rowVersion, SS.Standard.WorkFlow.DTO.Document document, SS.Standard.WorkFlow.DTO.WorkFlowType workFlowType, SS.Standard.WorkFlow.DTO.WorkFlowState currentState) { this.description = description; this.active = active; this.creBy = creBy; this.creDate = creDate; this.updBy = updBy; this.updDate = updDate; this.updPgm = updPgm; this.rowVersion = rowVersion; this.document = document; this.workFlowType = workFlowType; this.currentState = currentState; }
/// <summary> /// Initializes a new instance of the DocumentInitiator class /// </summary> /// <param name="initiatorid">Initial <see cref="DocumentInitiator.Initiatorid" /> value</param> /// <param name="seq">Initial <see cref="DocumentInitiator.Seq" /> value</param> /// <param name="type">Initial <see cref="DocumentInitiator.Type" /> value</param> /// <param name="active">Initial <see cref="DocumentInitiator.Active" /> value</param> /// <param name="creBy">Initial <see cref="DocumentInitiator.CreBy" /> value</param> /// <param name="creDate">Initial <see cref="DocumentInitiator.CreDate" /> value</param> /// <param name="updBy">Initial <see cref="DocumentInitiator.UpdBy" /> value</param> /// <param name="updDate">Initial <see cref="DocumentInitiator.UpdDate" /> value</param> /// <param name="updPgm">Initial <see cref="DocumentInitiator.UpdPgm" /> value</param> /// <param name="rowVersion">Initial <see cref="DocumentInitiator.RowVersion" /> value</param> /// <param name="document">Initial <see cref="DocumentInitiator.Document" /> value</param> /// <param name="user">Initial <see cref="DocumentInitiator.User" /> value</param> public DocumentInitiator(long initiatorid, short seq, string type, bool active, long creBy, DateTime creDate, long updBy, DateTime updDate, string updPgm, byte[] rowVersion, SS.Standard.WorkFlow.DTO.Document document, SS.Standard.WorkFlow.DTO.SuUser user) { this.initiatorid = initiatorid; this.seq = seq; this.type = type; this.active = active; this.creBy = creBy; this.creDate = creDate; this.updBy = updBy; this.updDate = updDate; this.updPgm = updPgm; this.rowVersion = rowVersion; this.document = document; this.user = user; }
public void Initialize(Guid txID, long documentID, string initFlag) { this.TransactionId = txID; this.DocumentID = documentID; this.InitialFlag = initFlag; int messageCode = 0; string message = string.Empty; bool boolVerify = false; bool boolVerifyAndApproveVerify = false; bool boolApprove = false; bool boolApproveDocument = false; bool showWarningChangeAmount = false; long workFlowID = long.Parse(Request.QueryString["wfid"] == null ? "0" : Request.QueryString["wfid"].Trim()); if (workFlowID > 0) { SS.Standard.WorkFlow.DTO.WorkFlow workflow = SS.Standard.WorkFlow.Query.WorkFlowQueryProvider.WorkFlowQuery.FindByIdentity(workFlowID); SS.Standard.WorkFlow.DTO.Document document = SS.Standard.WorkFlow.Query.WorkFlowQueryProvider.WorkFlowQuery.GetDocumentByWorkFlowID(workFlowID); if (document.DocumentType.DocumentTypeID == 1) //AdvanceDomesticDocument { boolVerify = AdvanceWorkFlowService.CanVerifyWaitVerify(workFlowID); boolVerifyAndApproveVerify = AdvanceWorkFlowService.CanVerifyAndApproveVerifyWaitVerify(workFlowID); boolApprove = AdvanceWorkFlowService.CanApproveWaitApproveVerify(workFlowID); boolApproveDocument = AdvanceWorkFlowService.CanApproveWaitApprove(workFlowID); } else if (document.DocumentType.DocumentTypeID == 5) //AdvanceForeignDocument { boolVerify = AdvanceForeignWorkFlowService.CanVerifyWaitVerify(workFlowID); boolVerifyAndApproveVerify = AdvanceForeignWorkFlowService.CanVerifyAndApproveVerifyWaitVerify(workFlowID); boolApprove = AdvanceForeignWorkFlowService.CanApproveWaitApproveVerify(workFlowID); boolApproveDocument = AdvanceForeignWorkFlowService.CanApproveWaitApprove(workFlowID); } else if (document.DocumentType.DocumentTypeID == 3 || document.DocumentType.DocumentTypeID == 7) //ExpenseDomesticDocument, ExpenseForeignDocument { boolVerify = ExpenseWorkFlowService.CanVerifyWaitVerify(workFlowID); boolVerifyAndApproveVerify = ExpenseWorkFlowService.CanVerifyAndApproveVerifyWaitVerify(workFlowID); boolApprove = ExpenseWorkFlowService.CanApproveWaitApproveVerify(workFlowID); boolApproveDocument = ExpenseWorkFlowService.CanApproveWaitApprove(workFlowID); if (workflow != null) { showWarningChangeAmount = workflow.CurrentState.Ordinal >= 6 && boolApprove; } } } isSeeHistory = ScgeAccountingQueryProvider.AvAdvanceDocumentQuery.isSeeHistoryReject(this.DocumentID); ctlSeeHistory.Visible = isSeeHistory; #region Warning message Requester and Approver is the same person if ((boolVerify || boolVerifyAndApproveVerify || boolApprove) && ((UserAccount.IsApproveVerifyDocument || UserAccount.IsVerifyDocument) || (UserAccount.IsApproveVerifyPayment || UserAccount.IsVerifyPayment))) { isSeeMessage = ScgeAccountingQueryProvider.AvAdvanceDocumentQuery.isSeeMessage(this.DocumentID); if (isSeeMessage) { ctlSeeMessage.Visible = isSeeMessage; messageCode = ScgeAccountingQueryProvider.AvAdvanceDocumentQuery.isMessage(this.DocumentID); if (UserAccount.CurrentLanguageID == 1) { if (messageCode == 1) { message = "และผู้เบิกค่าใช้จ่าย"; } else if (messageCode == 2) { message = "และผู้รับเงิน"; } else if (messageCode == 3) { message = ", ผู้เบิกค่าใช้จ่าย และผู้รับเงิน"; } } else if (UserAccount.CurrentLanguageID == 2) { if (messageCode == 1) { message = "and Requester"; } else if (messageCode == 2) { message = "and Receiver"; } else if (messageCode == 3) { message = ", Requester and Receiver"; } } this.ctlSeeMessage.Text = string.Format(this.GetProgramMessage("$SeeMessage$"), message); } } else { ctlSeeMessage.Visible = false; } #endregion ctlWarning.Visible = false; SCG.eAccounting.DTO.SCGDocument doc = ScgeAccountingQueryProvider.SCGDocumentQuery.FindByIdentity(DocumentID); if ((boolVerify || boolVerifyAndApproveVerify || boolApprove || boolApproveDocument) && ((UserAccount.UserID == doc.ApproverID.Userid || UserAccount.IsApproveVerifyDocument || UserAccount.IsVerifyDocument) || (UserAccount.IsApproveVerifyPayment || UserAccount.IsVerifyPayment))) { if (doc.RequesterID.Userid != doc.ReceiverID.Userid) { ctlWarning.Visible = true; ctlWarning.Text = this.GetMessage("RequesterAndReceiverShouldBeTheSamePerson"); } } ctlWarningChangeAmount.Visible = false; if (ParameterServices.EnableShowWarningMsgAmountHasBeenCorrected) { if (showWarningChangeAmount && UserAccount.IsApproveVerifyDocument) { FnExpenseDocument expenseDocument = ScgeAccountingQueryProvider.FnExpenseDocumentQuery.GetExpenseDocumentByDocumentID(doc.DocumentID); if (expenseDocument.AmountApproved != null && expenseDocument.TotalExpense != expenseDocument.AmountApproved) { ctlWarningChangeAmount.Visible = true; ctlWarningChangeAmount.Text = this.GetMessage("AmountHasBeenCorrected"); } } } }