private void PrepareEditView() { APApprovalProcessEntity aPApprovalProcessEntity = CurrentAPApprovalProcessEntity; if (!aPApprovalProcessEntity.IsNew) { if (ddlAPTypeID.Items.Count > 0 && aPApprovalProcessEntity.APTypeID != null) { ddlAPTypeID.SelectedValue = aPApprovalProcessEntity.APTypeID.ToString(); } txtReferenceID.Text = aPApprovalProcessEntity.ReferenceID.ToString(); txtDescription.Text = aPApprovalProcessEntity.Description.ToString(); txtTitle.Text = aPApprovalProcessEntity.Title.ToString(); txtCreateDate.Text = aPApprovalProcessEntity.CreateDate.ToStringDefault(); if (ddlAPStatusID.Items.Count > 0 && aPApprovalProcessEntity.APStatusID != null) { ddlAPStatusID.SelectedValue = aPApprovalProcessEntity.APStatusID.ToString(); } btnSubmit.Text = "Update"; btnAddNew.Visible = true; } }
Int64 IAPApprovalProcessDataAccess.Add(APApprovalProcessEntity aPApprovalProcessEntity, DatabaseOperationType option, TransactionRequired reqTran) { try { long retValues = -99; switch (reqTran) { case TransactionRequired.No: { retValues = Add(aPApprovalProcessEntity, option); break; } case TransactionRequired.Yes: { retValues = AddTran(aPApprovalProcessEntity, option); break; } default: { retValues = -99; break; } } return(retValues); } catch (Exception ex) { throw ex; } }
protected void lvACCPostPayableStatementDetail_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListViewDataItem dataItem = (ListViewDataItem)e.Item; ACCPostPayableStatementDetail_DetailedEntity ent = (ACCPostPayableStatementDetail_DetailedEntity)dataItem.DataItem; HyperLink lnkShowApprovalStatus = (HyperLink)e.Item.FindControl("lnkShowApprovalStatus"); APApprovalProcessEntity aPApprovalProcessEntity = APRobot.GetApprovalProcessByTypeAndReference(MasterDataConstants.APType.PAYABLE_STATEMENT, ent.PostPayableStatementDetailID); if (aPApprovalProcessEntity.APApprovalProcessID > 0) { lnkShowApprovalStatus.NavigateUrl = UrlHelper.BuildSecureUrl( "~/AP/APView.aspx", string.Empty, APApprovalProcessEntity.FLD_NAME_APApprovalProcessID, aPApprovalProcessEntity.APApprovalProcessID.ToString() ).ToString(); lnkShowApprovalStatus.Target = "_blank"; } else { lnkShowApprovalStatus.NavigateUrl = String.Empty; lnkShowApprovalStatus.Enabled = false; } } }
protected void lvBDProcessAssignedResource_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListViewDataItem dataItem = (ListViewDataItem)e.Item; BDProcessAssignedResource_DetailedEntity ent = (BDProcessAssignedResource_DetailedEntity)dataItem.DataItem; HyperLink hypTitle = (HyperLink)e.Item.FindControl("hypTitle"); HyperLink lnkShowApprovalStatus = (HyperLink)e.Item.FindControl("lnkShowApprovalStatus"); APApprovalProcessEntity aPApprovalProcessEntity = APRobot.GetApprovalProcessByTypeAndReference(MasterDataConstants.APType.CONTACT_LIST, ent.ProcessAssignedResourceID); if (aPApprovalProcessEntity.APApprovalProcessID > 0) { lnkShowApprovalStatus.NavigateUrl = UrlHelper.BuildSecureUrl( "~/AP/APView.aspx", string.Empty, APApprovalProcessEntity.FLD_NAME_APApprovalProcessID, aPApprovalProcessEntity.APApprovalProcessID.ToString() ).ToString(); lnkShowApprovalStatus.Target = "_blank"; } else { lnkShowApprovalStatus.NavigateUrl = String.Empty; lnkShowApprovalStatus.Enabled = false; } hypTitle.NavigateUrl = UrlHelper.BuildSecureUrl("~/BD/BDProcessAssignedResourceMap.aspx", string.Empty, UrlConstants.OVERVIEW_PROCESS_ASSIGNED_RESOURCE_ID, ent.ProcessAssignedResourceID.ToString()).ToString(); hypTitle.Target = "_blank"; } }
protected void lvINVTransfer_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListViewDataItem dataItem = (ListViewDataItem)e.Item; INVTransfer_DetailedEntity ent = (INVTransfer_DetailedEntity)dataItem.DataItem; HyperLink hypTRFNo = (HyperLink)e.Item.FindControl("hypTRFNo"); HyperLink lnkShowApprovalStatus = (HyperLink)e.Item.FindControl("lnkShowApprovalStatus"); hypTRFNo.NavigateUrl = UrlHelper.BuildSecureUrl("~/INV/INVTransferItem.aspx", string.Empty, UrlConstants.OVERVIEW_TRANSFER_ID, ent.TransferID.ToString()).ToString(); APApprovalProcessEntity aPApprovalProcessEntity = APRobot.GetApprovalProcessByTypeAndReference(MasterDataConstants.APType.TRF, ent.TransferID); if (aPApprovalProcessEntity.APApprovalProcessID > 0) { lnkShowApprovalStatus.NavigateUrl = UrlHelper.BuildSecureUrl( "~/AP/APView.aspx", string.Empty, APApprovalProcessEntity.FLD_NAME_APApprovalProcessID, aPApprovalProcessEntity.APApprovalProcessID.ToString() ).ToString(); lnkShowApprovalStatus.Target = "_blank"; } else { lnkShowApprovalStatus.NavigateUrl = String.Empty; lnkShowApprovalStatus.Enabled = false; } hypTRFNo.Target = "_blank"; } }
protected void lvPRMMaterialReceive_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListViewDataItem dataItem = (ListViewDataItem)e.Item; PRMMaterialReceive_DetailedEntity ent = (PRMMaterialReceive_DetailedEntity)dataItem.DataItem; HyperLink hypEdit = (HyperLink)e.Item.FindControl("lnkBtnEdit"); HyperLink hypMRRNo = (HyperLink)e.Item.FindControl("hypMRRNo"); Button btnResetMaterialRecieveLV = (Button)e.Item.FindControl("btnResetMaterialRecieveLV"); HyperLink hypMateialReceiveReport = (HyperLink)e.Item.FindControl("hypMateialReceiveReport"); HyperLink lnkShowApprovalStatus = (HyperLink)e.Item.FindControl("lnkShowApprovalStatus"); hypMateialReceiveReport.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", "MaterialReceiveReport", UrlConstants.OVERVIEW_MATERIAL_RECEIVE_ID, ent.MaterialReceiveID.ToString()).ToString(); hypEdit.NavigateUrl = UrlHelper.BuildSecureUrl("~/PRM/PRMMaterialReceive.aspx", string.Empty, "do", "Edit", UrlConstants.OVERVIEW_MATERIAL_RECEIVE_ID, ent.MaterialReceiveID.ToString()).ToString(); hypMRRNo.NavigateUrl = UrlHelper.BuildSecureUrl("~/PRM/PRMMaterialReceiveItemMap.aspx", string.Empty, UrlConstants.OVERVIEW_MATERIAL_RECEIVE_ID, ent.MaterialReceiveID.ToString()).ToString(); hypMateialReceiveReport.Target = "_blank"; hypEdit.Target = "_blank"; hypMRRNo.Target = "_blank"; APApprovalProcessEntity aPApprovalProcessEntity = APRobot.GetApprovalProcessByTypeAndReference(MasterDataConstants.APType.MRR, ent.MaterialReceiveID); if (aPApprovalProcessEntity.APApprovalProcessID > 0) { lnkShowApprovalStatus.NavigateUrl = UrlHelper.BuildSecureUrl( "~/AP/APView.aspx", string.Empty, APApprovalProcessEntity.FLD_NAME_APApprovalProcessID, aPApprovalProcessEntity.APApprovalProcessID.ToString() ).ToString(); lnkShowApprovalStatus.Target = "_blank"; } else { lnkShowApprovalStatus.NavigateUrl = String.Empty; lnkShowApprovalStatus.Enabled = false; } if (ent.MaterialReceiveApprovalStatusID == MasterDataConstants.MDMaterialReceiveApprovalStatus.APPROVED || ent.MaterialReceiveApprovalStatusID == MasterDataConstants.MDMaterialReceiveApprovalStatus.CANCELED) { btnResetMaterialRecieveLV.Visible = true; } else { btnResetMaterialRecieveLV.Visible = false; } String fe = SqlExpressionBuilder.PrepareFilterExpression(CMBillMaterialReceiveMeasurementBookMapEntity.FLD_NAME_MaterialReceiveID, ent.MaterialReceiveID.ToString(), SQLMatchType.Equal); IList <CMBillMaterialReceiveMeasurementBookMapEntity> lst = FCCCMBillMaterialReceiveMeasurementBookMap.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression); if (lst != null && lst.Count > 0) { btnResetMaterialRecieveLV.Visible = false; } } }
private Int64 UpdateTran(APApprovalProcessEntity aPApprovalProcessEntity, String filterExpression, DatabaseOperationType option) { long returnCode = -99; const string SP = "dbo.APApprovalProcess_SET"; Database db = DatabaseFactory.CreateDatabase(); using (DbCommand cmd = db.GetStoredProcCommand(SP)) { AddOptionParameter(cmd, option, db); AddOutputParameter(cmd, db); AddFilterExpressionParameter(cmd, filterExpression, db); db.AddInParameter(cmd, "@APApprovalProcessID", DbType.Int64, aPApprovalProcessEntity.APApprovalProcessID); db.AddInParameter(cmd, "@APTypeID", DbType.Int64, aPApprovalProcessEntity.APTypeID); db.AddInParameter(cmd, "@ReferenceID", DbType.Int64, aPApprovalProcessEntity.ReferenceID); db.AddInParameter(cmd, "@Description", DbType.String, aPApprovalProcessEntity.Description); db.AddInParameter(cmd, "@Title", DbType.String, aPApprovalProcessEntity.Title); db.AddInParameter(cmd, "@CreateDate", DbType.DateTime, aPApprovalProcessEntity.CreateDate); db.AddInParameter(cmd, "@APStatusID", DbType.Int64, aPApprovalProcessEntity.APStatusID); DbConnection connection = db.CreateConnection(); connection.Open(); DbTransaction transaction = connection.BeginTransaction(); try { using (IDataReader reader = db.ExecuteReader(cmd, transaction)) { returnCode = GetReturnCodeFromParameter(cmd); } if (returnCode > 0) { transaction.Commit(); } else { throw new ArgumentException("Error Code." + returnCode.ToString()); } } catch (Exception ex) { transaction.Rollback(); throw ex; } finally { transaction.Dispose(); connection.Close(); connection = null; } } return(returnCode); }
private void SaveAPApprovalProcessEntity() { if (IsValid) { try { APApprovalProcessEntity aPApprovalProcessEntity = BuildAPApprovalProcessEntity(); Int64 result = -1; if (aPApprovalProcessEntity.IsNew) { result = FCCAPApprovalProcess.GetFacadeCreate().Add(aPApprovalProcessEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(APApprovalProcessEntity.FLD_NAME_APApprovalProcessID, aPApprovalProcessEntity.APApprovalProcessID.ToString(), SQLMatchType.Equal); result = FCCAPApprovalProcess.GetFacadeCreate().Update(aPApprovalProcessEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _APApprovalProcessID = 0; _APApprovalProcessEntity = new APApprovalProcessEntity(); PrepareInitialView(); BindAPApprovalProcessList(); if (aPApprovalProcessEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "A PApproval Process Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "A PApproval Process Information has been updated successfully.", false); } } else { if (aPApprovalProcessEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add A PApproval Process Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update A PApproval Process Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvCRMAgreement_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListViewDataItem dataItem = (ListViewDataItem)e.Item; CRMAgreement_DetailedEntity ent = (CRMAgreement_DetailedEntity)dataItem.DataItem; HyperLink lnkShowApprovalStatus = (HyperLink)e.Item.FindControl("lnkShowApprovalStatus"); HyperLink hypAgreementVariableMap = (HyperLink)e.Item.FindControl("hypAgreementVariableMap"); HyperLink hypAgreementReport = (HyperLink)e.Item.FindControl("hypAgreementReport"); hypAgreementVariableMap.NavigateUrl = UrlHelper.BuildSecureUrl( "~/CRM/CRMAgreementVariableMap.aspx", string.Empty, UrlConstants.OVERVIEW_AGREEMENT_ID, ent.AgreementID.ToString() ).ToString(); hypAgreementVariableMap.Target = "_blank"; if (ent.AgreementTypeID == MasterDataConstants.CRMMDAgreementType.SPECS) { HyperLink hypAgreementSpec = (HyperLink)e.Item.FindControl("hypAgreementSpec"); hypAgreementSpec.NavigateUrl = UrlHelper.BuildSecureUrl("~/CRM/CRMAgreementSpecs.aspx", String.Empty, UrlConstants.OVERVIEW_AGREEMENT_ID, ent.AgreementID.ToString()).ToString(); hypAgreementSpec.Target = "_blank"; hypAgreementSpec.Visible = true; } hypAgreementReport.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.AGREEMENT_REPORT, UrlConstants.OVERVIEW_AGREEMENT_ID, ent.AgreementID.ToString()).ToString(); hypAgreementReport.Target = "_blank"; APApprovalProcessEntity aPApprovalProcessEntity = APRobot.GetApprovalProcessByTypeAndReference(MasterDataConstants.APType.AGREEMENT, ent.AgreementID); if (aPApprovalProcessEntity.APApprovalProcessID > 0) { lnkShowApprovalStatus.NavigateUrl = UrlHelper.BuildSecureUrl( "~/AP/APView.aspx", string.Empty, APApprovalProcessEntity.FLD_NAME_APApprovalProcessID, aPApprovalProcessEntity.APApprovalProcessID.ToString() ).ToString(); lnkShowApprovalStatus.Target = "_blank"; } else { lnkShowApprovalStatus.NavigateUrl = String.Empty; lnkShowApprovalStatus.Enabled = false; } } }
private void EnableDisableApprovalProcessCheck() { APApprovalProcessEntity aPApprovalProcessEntity = APRobot.GetApprovalProcessByTypeAndReference(MasterDataConstants.APType.BILL, CMBillID); if (aPApprovalProcessEntity.APApprovalProcessID > 0) { btnInitiateApprovalProcess.Enabled = false; } else { btnInitiateApprovalProcess.Enabled = true; } }
private void EnableDisableApprovalProcessCheck() { APApprovalProcessEntity aPApprovalProcessEntity = APRobot.GetApprovalProcessByTypeAndReference(MasterDataConstants.APType.BANK_DEPOSIT, _bankAccountDepositID); if (aPApprovalProcessEntity.APApprovalProcessID > 0) { btnInitiateApprovalProcess.Enabled = false; } else { btnInitiateApprovalProcess.Enabled = true; } }
protected void lvAPApprovalProcess_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 APApprovalProcessID; Int64.TryParse(e.CommandArgument.ToString(), out APApprovalProcessID); if (APApprovalProcessID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _APApprovalProcessID = APApprovalProcessID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(APApprovalProcessEntity.FLD_NAME_APApprovalProcessID, APApprovalProcessID.ToString(), SQLMatchType.Equal); APApprovalProcessEntity aPApprovalProcessEntity = new APApprovalProcessEntity(); result = FCCAPApprovalProcess.GetFacadeCreate().Delete(aPApprovalProcessEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _APApprovalProcessID = 0; _APApprovalProcessEntity = new APApprovalProcessEntity(); PrepareInitialView(); BindAPApprovalProcessList(); MiscUtil.ShowMessage(lblMessage, "A PApproval Process has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete A PApproval Process.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
private void EnableDisableApprovalProcessCheck() { SetPayableStatementDetailID(); APApprovalProcessEntity aPApprovalProcessEntity = APRobot.GetApprovalProcessByTypeAndReference(MasterDataConstants.APType.PAYABLE_STATEMENT, _PostPayableStatementDetailID); if (aPApprovalProcessEntity.APApprovalProcessID > 0) { btnInitiateApprovalProcess.Enabled = false; } else { btnInitiateApprovalProcess.Enabled = true; } }
protected void btnPnlCancelWO_Click(object sender, EventArgs e) { PRMWorkOrderEntity pRMWorkOrderEntity = FCCPRMWorkOrder.GetFacadeCreate().GetByID(PRMWorkOrderID); pRMWorkOrderEntity.WorkOrderStatusID = MasterDataConstants.WorkOrderStatus.CANCELED; pRMWorkOrderEntity.Remarks = txtWOCancelRemarks.Text.Trim().ToString(); Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(PRMWorkOrderEntity.FLD_NAME_WorkOrderID, PRMWorkOrderID.ToString(), SQLMatchType.Equal); result = FCCPRMWorkOrder.GetFacadeCreate().Update(pRMWorkOrderEntity, fe, DatabaseOperationType.Update, TransactionRequired.No); if (result > 0) { #region AP Update APApprovalProcessEntity aPApprovalProcessEntity = FCCAPApprovalProcess.GetFacadeCreate().GetByID(APApprovalProcessID); if (aPApprovalProcessEntity != null && aPApprovalProcessEntity.APApprovalProcessID > 0) { aPApprovalProcessEntity.APStatusID = MasterDataConstants.APStatus.CANCELED; Int64 resultOne = -1; String fe_one = SqlExpressionBuilder.PrepareFilterExpression(APApprovalProcessEntity.FLD_NAME_APApprovalProcessID, APApprovalProcessID.ToString(), SQLMatchType.Equal); resultOne = FCCAPApprovalProcess.GetFacadeCreate().Update(aPApprovalProcessEntity, fe_one, DatabaseOperationType.Update, TransactionRequired.No); if (resultOne > 0) { APMemberFeedbackEntity aPMemberFeedbackEntity = FCCAPMemberFeedback.GetFacadeCreate().GetByID(APMemberFeedbackID); if (aPMemberFeedbackEntity != null && aPMemberFeedbackEntity.APMemberFeedbackID > 0) { aPMemberFeedbackEntity.APFeedbackID = MasterDataConstants.APFeedback.CANCELED; Int64 resultC = -1; String fe_memberfeedback = SqlExpressionBuilder.PrepareFilterExpression(APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, APMemberFeedbackID.ToString(), SQLMatchType.Equal); resultC = FCCAPMemberFeedback.GetFacadeCreate().Update(aPMemberFeedbackEntity, fe_memberfeedback, DatabaseOperationType.Update, TransactionRequired.No); RedirectPageToPendingList(); } } } #endregion } }
private void EnableDisableApprovalProcessCheck() { APApprovalProcessEntity aPApprovalProcessEntity = APRobot.GetApprovalProcessByTypeAndReference(MasterDataConstants.APType.TRF, INVTransferID); if (aPApprovalProcessEntity.APApprovalProcessID > 0) { btnInitiateApprovalProcess.Enabled = false; btnSubmit.Enabled = false; txtItemName.Enabled = false; } else { btnInitiateApprovalProcess.Enabled = true; btnSubmit.Enabled = true; txtItemName.Enabled = true; } }
private Int64 Update(APApprovalProcessEntity aPApprovalProcessEntity, String filterExpression, DatabaseOperationType option) { long returnCode = -99; const string SP = "dbo.APApprovalProcess_SET"; using (DbCommand cmd = Database.GetStoredProcCommand(SP)) { AddOptionParameter(cmd, option); AddOutputParameter(cmd); AddFilterExpressionParameter(cmd, filterExpression); Database.AddInParameter(cmd, "@APApprovalProcessID", DbType.Int64, aPApprovalProcessEntity.APApprovalProcessID); Database.AddInParameter(cmd, "@APTypeID", DbType.Int64, aPApprovalProcessEntity.APTypeID); Database.AddInParameter(cmd, "@ReferenceID", DbType.Int64, aPApprovalProcessEntity.ReferenceID); Database.AddInParameter(cmd, "@Description", DbType.String, aPApprovalProcessEntity.Description); Database.AddInParameter(cmd, "@Title", DbType.String, aPApprovalProcessEntity.Title); Database.AddInParameter(cmd, "@CreateDate", DbType.DateTime, aPApprovalProcessEntity.CreateDate); Database.AddInParameter(cmd, "@APStatusID", DbType.Int64, aPApprovalProcessEntity.APStatusID); using (IDataReader reader = Database.ExecuteReader(cmd)) { returnCode = GetReturnCodeFromParameter(cmd); switch (returnCode) { case SqlConstants.DB_STATUS_CODE_DATAALREADYEXIST: { throw new ArgumentException("APApprovalProcessEntity already exists. Please specify another APApprovalProcessEntity."); } case SqlConstants.DB_STATUS_CODE_DATAUPDATEDFROMOTHERSESSION: { throw new ArgumentException("APApprovalProcessEntity data already updated from different session."); } case SqlConstants.DB_STATUS_CODE_FAIL_OPERATION: { throw new ArgumentException("APApprovalProcessEntity already exists. Please specify another APApprovalProcessEntity."); } } } } return(returnCode); }
private APApprovalProcessEntity BuildAPApprovalProcessEntity() { APApprovalProcessEntity aPApprovalProcessEntity = CurrentAPApprovalProcessEntity; if (ddlAPTypeID.Items.Count > 0) { if (ddlAPTypeID.SelectedValue == "0") { } else { aPApprovalProcessEntity.APTypeID = Int64.Parse(ddlAPTypeID.SelectedValue); } } if (!txtReferenceID.Text.Trim().IsNullOrEmpty()) { aPApprovalProcessEntity.ReferenceID = Int64.Parse(txtReferenceID.Text.Trim()); } else { aPApprovalProcessEntity.ReferenceID = null; } aPApprovalProcessEntity.Description = txtDescription.Text.Trim(); aPApprovalProcessEntity.Title = txtTitle.Text.Trim(); if (txtCreateDate.Text.Trim().IsNotNullOrEmpty()) { aPApprovalProcessEntity.CreateDate = MiscUtil.ParseToDateTime(txtCreateDate.Text); } if (ddlAPStatusID.Items.Count > 0) { if (ddlAPStatusID.SelectedValue == "0") { } else { aPApprovalProcessEntity.APStatusID = Int64.Parse(ddlAPStatusID.SelectedValue); } } return(aPApprovalProcessEntity); }
protected void lvAPMemberFeedback_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListViewDataItem dataItem = (ListViewDataItem)e.Item; APMemberFeedbackEntity ent = (APMemberFeedbackEntity)dataItem.DataItem; APApprovalProcessEntity aPApprovalProcessEntity = APRobot.GetApprovalProcessByID(ent.APApprovalProcessID); HyperLink lnkViewDetails = (HyperLink)e.Item.FindControl("lnkViewDetails"); HiddenField hydAPApprovalProcessID = (HiddenField)e.Item.FindControl("hydAPApprovalProcessID"); Label lblTitle = (Label)e.Item.FindControl("lblTitle"); if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.REQUISITION) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/REQ/REQRequisitionDetailsWithApproval.aspx", string.Empty, UrlConstants.REQUISITION_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString() ).ToString(); } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.WORK_ORDER) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/PRM/PRMWorkOrderViewWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_WORKORDER_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString() ).ToString(); } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.CUSTOM) { lnkViewDetails.NavigateUrl = "#"; } lnkViewDetails.Target = "_blank"; } }
protected void lvPRMMaterialReceive_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListViewDataItem dataItem = (ListViewDataItem)e.Item; PRMMaterialReceive_DetailedEntity ent = (PRMMaterialReceive_DetailedEntity)dataItem.DataItem; HyperLink hypMRRNo = (HyperLink)e.Item.FindControl("hypMRRNo"); hypMRRNo.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", "MaterialReceiveReport", UrlConstants.OVERVIEW_MATERIAL_RECEIVE_ID, ent.MaterialReceiveID.ToString()).ToString(); hypMRRNo.NavigateUrl = UrlHelper.BuildSecureUrl("~/PRM/PRMMaterialReceiveItemMap.aspx", string.Empty, UrlConstants.OVERVIEW_MATERIAL_RECEIVE_ID, ent.MaterialReceiveID.ToString()).ToString(); hypMRRNo.Target = "_blank"; HyperLink lnkShowApprovalStatus = (HyperLink)e.Item.FindControl("lnkShowApprovalStatus"); APApprovalProcessEntity aPApprovalProcessEntity = APRobot.GetApprovalProcessByTypeAndReference(MasterDataConstants.APType.MRR, ent.MaterialReceiveID); if (aPApprovalProcessEntity.APApprovalProcessID > 0) { lnkShowApprovalStatus.NavigateUrl = UrlHelper.BuildSecureUrl( "~/AP/APView.aspx", string.Empty, APApprovalProcessEntity.FLD_NAME_APApprovalProcessID, aPApprovalProcessEntity.APApprovalProcessID.ToString() ).ToString(); lnkShowApprovalStatus.Target = "_blank"; } else { lnkShowApprovalStatus.NavigateUrl = String.Empty; lnkShowApprovalStatus.Enabled = false; } } }
Int64 IAPApprovalProcessFacade.Delete(APApprovalProcessEntity aPApprovalProcessEntity, String filterExpression, DatabaseOperationType option, TransactionRequired reqTran) { return(DataAccessFactory.CreateAPApprovalProcessDataAccess().Delete(aPApprovalProcessEntity, filterExpression, option, reqTran)); }
protected void lvCMBill_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListViewDataItem dataItem = (ListViewDataItem)e.Item; CMBill_DetailedEntity ent = (CMBill_DetailedEntity)dataItem.DataItem; HyperLink hypReport = (HyperLink)e.Item.FindControl("hypReport"); HyperLink lnkShowApprovalStatus = (HyperLink)e.Item.FindControl("lnkShowApprovalStatus"); HyperLink hypWorkOrderNo = (HyperLink)e.Item.FindControl("hypWorkOrderNo"); Panel pnlRequisitonNoLV = (Panel)e.Item.FindControl("pnlRequisitonNoLV"); Panel pnlMRRNoLV = (Panel)e.Item.FindControl("pnlMRRNoLV"); hypWorkOrderNo.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.WORK_ORDER_REPORT, UrlConstants.OVERVIEW_WORKORDER_ID, ent.WorkOrderID.ToString()).ToString(); APApprovalProcessEntity aPApprovalProcessEntity = APRobot.GetApprovalProcessByTypeAndReference(MasterDataConstants.APType.BILL, ent.BillID); if (aPApprovalProcessEntity.APApprovalProcessID > 0) { lnkShowApprovalStatus.NavigateUrl = UrlHelper.BuildSecureUrl( "~/AP/APView.aspx", string.Empty, APApprovalProcessEntity.FLD_NAME_APApprovalProcessID, aPApprovalProcessEntity.APApprovalProcessID.ToString() ).ToString(); lnkShowApprovalStatus.Target = "_blank"; } else { lnkShowApprovalStatus.NavigateUrl = String.Empty; lnkShowApprovalStatus.Enabled = false; } String fe_mrr = SqlExpressionBuilder.PrepareFilterExpression(PRMMaterialReceiveEntity.FLD_NAME_WorkOrderID, ent.WorkOrderID.ToString(), SQLMatchType.Equal); IList <PRMMaterialReceiveEntity> lstPRMMaterialReceive = FCCPRMMaterialReceive.GetFacadeCreate().GetIL(null, null, String.Empty, fe_mrr, DatabaseOperationType.LoadWithFilterExpression); if (lstPRMMaterialReceive != null && lstPRMMaterialReceive.Count > 0) { //btnResetWorkOrderLV.Visible = false; foreach (PRMMaterialReceiveEntity pRMMaterialReceiveEntity in lstPRMMaterialReceive) { HyperLink hypMaterialReceive = new HyperLink(); hypMaterialReceive.Text = pRMMaterialReceiveEntity.MRRNo; hypMaterialReceive.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", "MaterialReceiveReport", UrlConstants.OVERVIEW_MATERIAL_RECEIVE_ID, pRMMaterialReceiveEntity.MaterialReceiveID.ToString()).ToString(); hypMaterialReceive.Target = "_blank"; hypMaterialReceive.CssClass = "CommonButtonLink"; pnlMRRNoLV.Controls.Add(hypMaterialReceive); pnlMRRNoLV.Controls.Add(new LiteralControl("<br/>")); } } String fe_req = SqlExpressionBuilder.PrepareFilterExpression("PRMWorkOrderItemMap." + PRMWorkOrderItemMapEntity.FLD_NAME_WorkOrderID, ent.WorkOrderID.ToString(), SQLMatchType.Equal); IList <PRMWorkOrderItemMap_DetailedEntity> lstPRMWorkOrderItemMap = FCCPRMWorkOrderItemMap_Detailed.GetFacadeCreate().GetIL(10000, 1, String.Empty, fe_req); if (lstPRMWorkOrderItemMap != null && lstPRMWorkOrderItemMap.Count > 0) { List <PRMWorkOrderItemMap_DetailedEntity> distinct = lstPRMWorkOrderItemMap .GroupBy(car => car.WorkOrderID) .Select(g => g.First()) .ToList(); foreach (PRMWorkOrderItemMap_DetailedEntity pRMWorkOrderItemMapEntity in distinct) { HyperLink hypRequisitionNo = new HyperLink(); hypRequisitionNo.Text = pRMWorkOrderItemMapEntity.RequisitionNo.ToString(); hypRequisitionNo.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.REQUISITION_REPORT, UrlConstants.REQUISITION_ID, pRMWorkOrderItemMapEntity.RequisitionID.ToString()).ToString(); hypRequisitionNo.Target = "_blank"; hypRequisitionNo.CssClass = "CommonButtonLink"; pnlRequisitonNoLV.Controls.Add(hypRequisitionNo); pnlRequisitonNoLV.Controls.Add(new LiteralControl("<br/>")); } } hypReport.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.BILL_REPORT, UrlConstants.OVERVIEW_CM_BILL_ID, ent.BillID.ToString()).ToString(); hypReport.Target = "_blank"; hypWorkOrderNo.Target = "_blank"; } }
protected void lvAPMemberFeedback_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListViewDataItem dataItem = (ListViewDataItem)e.Item; APMemberFeedback_DetailedEntity ent = (APMemberFeedback_DetailedEntity)dataItem.DataItem; APApprovalProcessEntity aPApprovalProcessEntity = APRobot.GetApprovalProcessByID(ent.APApprovalProcessID); HyperLink lnkViewDetails = (HyperLink)e.Item.FindControl("lnkViewDetails"); HyperLink lnkShowApprovalStatus = (HyperLink)e.Item.FindControl("lnkShowApprovalStatus"); Label lblTitle = (Label)e.Item.FindControl("lblTitle"); Label lblAPType = (Label)e.Item.FindControl("lblAPType"); Label lblItemDetail = (Label)e.Item.FindControl("lblItemDetail"); lblTitle.Text = aPApprovalProcessEntity.Title; if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.REQUISITION) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/REQ/REQRequisitionDetailsWithApproval.aspx", string.Empty, UrlConstants.REQUISITION_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); String feReqItem = SqlExpressionBuilder.PrepareFilterExpression("REQRequisitionItem." + REQRequisitionItemEntity.FLD_NAME_RequisitionID, aPApprovalProcessEntity.ReferenceID.ToString(), SQLMatchType.Equal); IList <REQRequisitionItem_DetailedEntity> lst = FCCREQRequisitionItem_Detailed.GetFacadeCreate().GetIL(100000, 1, String.Empty, feReqItem); lblAPType.Text = "Requisition"; if (lst != null && lst.Count > 0) { lblItemDetail.Text = "Items ("; foreach (REQRequisitionItem_DetailedEntity entREQRequisitionItem_DetailedEntity in lst) { lblItemDetail.Text += entREQRequisitionItem_DetailedEntity.MDItemItemName + ", "; } lblItemDetail.Text += ")"; } } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.WORK_ORDER) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/PRM/PRMWorkOrderViewWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_WORKORDER_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "Work Order"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.BILL) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/CM/CMBillDetailsWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_CM_BILL_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "Bill"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.PAYABLE_STATEMENT) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/ACC/ACCPostPayableStatementDetailWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_POST_PAYABLE_STATEMENT_DETAIL_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "Payable Statement"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.TRF) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/INV/INVTransferItemDetailsWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_TRANSFER_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "TRF"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.BANK_DEPOSIT) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/AC/ACBankAccountDepositDetailsWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_BANK_ACCOUNT_DEPOSIT_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "BANK DEPOSIT"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.BANK_PAYMENT) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/AC/ACBankAccountPaymentDetailsWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_BANK_ACCOUNT_PAYMENT_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "BANK PAYMENT"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.TEMPORARY_JOURNAL) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/AC/ACJournalDetailsWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_TEMPORARY_JOURNAL_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "JOURNAL ENTRY"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.BANK_ACCOUNT_TRANSFER) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/AC/ACBankAccountTransferDetailsWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_BANK_ACCOUNT_TRANSFER_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "BANK ACCOUNT TRANSFER"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.MRR) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/PRM/PRMMaterialReceiveDetailsWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_MATERIAL_RECEIVE_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "MATERIAL RECEIVE"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.AGREEMENT) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/CRM/CRMAgreementDetailsWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_AGREEMENT_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "AGREEMENT"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.CONTACT_LIST) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl("~/BD/BDProcessAssignedResourceDetailsWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_PROCESS_ASSIGNED_RESOURCE_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "CONTACT_LIST"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.LOAN_APPLICATION) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl("~/HR/HREmployeeLoanApplicationDetailsWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_LOAN_APPLICATION_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "LOAN_APPLICATION"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.LEAVE_APPLICATION) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl("~/HR/HREmployeeLeaveApplicationWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_LEAVE_APPLICATION_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "LEAVE_APPLICATION"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.CUSTOM) { lnkViewDetails.NavigateUrl = "#"; lblAPType.Text = "Custom"; } lnkShowApprovalStatus.NavigateUrl = UrlHelper.BuildSecureUrl( "~/AP/APView.aspx", string.Empty, APApprovalProcessEntity.FLD_NAME_APApprovalProcessID, aPApprovalProcessEntity.APApprovalProcessID.ToString() ).ToString(); //lnkViewDetails.Target = "_blank"; lnkShowApprovalStatus.Target = "_blank"; } }
Int64 IAPApprovalProcessFacade.Add(APApprovalProcessEntity aPApprovalProcessEntity, DatabaseOperationType option, TransactionRequired reqTran) { return(DataAccessFactory.CreateAPApprovalProcessDataAccess().Add(aPApprovalProcessEntity, option, reqTran)); }
protected void btnForward_Click(object sender, EventArgs e) { if (chbxAutoForwardTo.Checked) { APApprovalProcessEntity aPApprovalProcessEntity = APRobot.GetApprovalProcessByTypeAndReference(MasterDataConstants.APType.BILL, CMBillID); IList <APMemberFeedbackEntity> feedbackList = APRobot.GetAllMemberFeedbacks(aPApprovalProcessEntity.APApprovalProcessID); IList <APMemberFeedbackEntity> ordered_list = feedbackList.OrderBy(x => x.SequenceNo).ToList(); APPanelForwardMemberEntity aPPanelForwardMemberEntity = APRobot.GetAPPanelForwardMemberByID(Int64.Parse(ddlForwardTo.SelectedValue)); var existsInfo = (from s in ordered_list where s.EmployeeID.ToString() == aPPanelForwardMemberEntity.EmployeeID.ToString() select s); if (existsInfo != null && existsInfo.Count() > 0) { MiscUtil.ShowMessage(lblMessage, "Member Already Exists in the Approval Panel", true); return; } APMemberFeedbackEntity currentEmployeeInfo = (from r in ordered_list where r.EmployeeID.ToString() == MiscUtil.GetCurrentEmployeeByMemberID(CurrentMember).ToString() select r).FirstOrDefault(); if (currentEmployeeInfo != null) { ordered_list = (from m in ordered_list where m.SequenceNo > currentEmployeeInfo.SequenceNo select m).ToList(); APMemberFeedbackEntity aPMemberFeedbackEntity = new APMemberFeedbackEntity(); aPMemberFeedbackEntity.APApprovalProcessID = aPApprovalProcessEntity.APApprovalProcessID; aPMemberFeedbackEntity.DepartmentID = aPPanelForwardMemberEntity.DepartmentID; aPMemberFeedbackEntity.EmployeeID = aPPanelForwardMemberEntity.EmployeeID; aPMemberFeedbackEntity.SequenceNo = currentEmployeeInfo.SequenceNo + 1; aPMemberFeedbackEntity.APFeedbackID = MasterDataConstants.APFeedback.NOT_YET_REQUESTED; aPMemberFeedbackEntity.FeedbackRequestDate = DateTime.Now; aPMemberFeedbackEntity.FeedbackLastResponseDate = null; aPMemberFeedbackEntity.FeedbackSubmitDate = null; aPMemberFeedbackEntity.IsProxyEmployeeEnabled = false; aPMemberFeedbackEntity.ProxyEmployeeID = null; Int64 aPMemberFeedbackID = FCCAPMemberFeedback.GetFacadeCreate().Add(aPMemberFeedbackEntity, DatabaseOperationType.Add, TransactionRequired.No); foreach (APMemberFeedbackEntity ent in ordered_list) { String fe = SqlExpressionBuilder.PrepareFilterExpression(APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), SQLMatchType.Equal); ent.SequenceNo += 1; FCCAPMemberFeedback.GetFacadeCreate().Update(ent, fe, DatabaseOperationType.Update, TransactionRequired.No); } APRobot.UpdateApprovalProcessFeedback(APMemberFeedbackID, MasterDataConstants.APFeedback.APPROVED, MasterDataConstants.APType.BILL, CMBillID); String remarks = txtRemarks.Text.Trim(); if (remarks.IsNullOrEmpty()) { remarks = "Approved"; } remarks = AddProxyMemberInfo(remarks); APRobot.AddAPMemberFeedbackRemarks(APMemberFeedbackID, remarks); EnableDisableApprovalButtons(); MiscUtil.ShowMessage(lblMessage, "You have Approved Successfully", UIConstants.MessageType.GREEN); PrepareInitialView(); BindList(); RedirectPageToPendingList(); } } //Previous Code else { if (ddlRejectTo.Items.Count > 0) { APRobot.UpdateMemberFeedbackFeedback(APMemberFeedbackID, MasterDataConstants.APFeedback.FORWARDED); APRobot.UpdateMemberFeedbackLastResponseDate(APMemberFeedbackID, DateTime.Now); String remarks = txtRemarks.Text.Trim(); if (remarks.IsNullOrEmpty()) { remarks = "Forwarded"; } remarks = AddProxyMemberInfo(remarks); Int64 aPMemberFeedbackRemarksID = APRobot.AddAPMemberFeedbackRemarks(APMemberFeedbackID, remarks); Int64 aPPanelForwardMemberID = Int64.Parse(ddlForwardTo.SelectedValue); APPanelForwardMemberEntity aPPanelForwardMemberEntity = APRobot.GetAPPanelForwardMemberByID(aPPanelForwardMemberID); APForwardInfoEntity aPForwardInfoEntity = new APForwardInfoEntity(); aPForwardInfoEntity.APMemberFeedbackID = APMemberFeedbackID; aPForwardInfoEntity.APApprovalProcessID = APApprovalProcessID; aPForwardInfoEntity.APMemberFeedbackRemarksID = aPMemberFeedbackRemarksID; aPForwardInfoEntity.DepartmentID = aPPanelForwardMemberEntity.DepartmentID; aPForwardInfoEntity.EmployeeID = aPPanelForwardMemberEntity.EmployeeID; aPForwardInfoEntity.CommentRequestDate = DateTime.Now; aPForwardInfoEntity.CommentSubmitDate = null; aPForwardInfoEntity.APMemberComment = txtForwardRemarks.Text.Trim(); aPForwardInfoEntity.APForwardMemberComment = String.Empty; FCCAPForwardInfo.GetFacadeCreate().Add(aPForwardInfoEntity, DatabaseOperationType.Add, TransactionRequired.No); MiscUtil.ShowMessage(lblMessage, "You have forwarded the thread successfully", UIConstants.MessageType.GREEN); PrepareInitialView(); BindList(); #region Forwarded Mail String MailBody = String.Empty; String Subject = String.Empty; StringBuilder sb = new StringBuilder(); sb.Append("Dear Sir,"); sb.Append("<br/>"); sb.Append("This is a auto generated mail from the ERP."); sb.Append("<br/>"); sb.Append("A Bill Request is Forwarded Request is waiting for your approval"); sb.Append("<br/>"); sb.Append("<br/>"); sb.Append("-"); sb.Append("<br/>"); sb.Append("Thanks"); sb.Append("<br/>"); sb.Append("ERP System"); MailBody = sb.ToString(); Subject = "ERP, Bill, Forwarded"; MailBody = @"Please note that a Bill is Forwarded.-Thanks ERP System"; HREmployeeEntity _hREmployeeEntity = FCCHREmployee.GetFacadeCreate().GetByID(aPForwardInfoEntity.EmployeeID); if (_hREmployeeEntity != null) { String[] sendToMail = new String[] { _hREmployeeEntity.PrimaryEmail }; MiscUtil.SendMail(sendToMail, Subject, MailBody); } #endregion //RedirectPageToForwardList(); } else { MiscUtil.ShowMessage(lblMessage, "Failed to forward", UIConstants.MessageType.RED); } } }
protected void btnAddNew_Click(object sender, EventArgs e) { _APApprovalProcessID = 0; _APApprovalProcessEntity = new APApprovalProcessEntity(); PrepareInitialView(); }
protected void lvAPMemberFeedback_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListViewDataItem dataItem = (ListViewDataItem)e.Item; APForwardInfo_DetailedEntity ent = (APForwardInfo_DetailedEntity)dataItem.DataItem; APApprovalProcessEntity aPApprovalProcessEntity = APRobot.GetApprovalProcessByID(ent.APApprovalProcessID); HyperLink lnkViewDetails = (HyperLink)e.Item.FindControl("lnkViewDetails"); HyperLink lnkShowApprovalStatus = (HyperLink)e.Item.FindControl("lnkShowApprovalStatus"); Label lblTitle = (Label)e.Item.FindControl("lblTitle"); Label lblAPFeedbackName = (Label)e.Item.FindControl("lblAPFeedbackName"); #region This code should be changed String aPFeedbackName = String.Empty; switch (aPApprovalProcessEntity.APStatusID) { case MasterDataConstants.APStatus.CANCELED: aPFeedbackName = "Canceled"; break; case MasterDataConstants.APStatus.COMPLETED: aPFeedbackName = "Complete"; break; case MasterDataConstants.APStatus.IN_PROCESS: aPFeedbackName = "In Process"; break; case MasterDataConstants.APStatus.NEW: aPFeedbackName = "New"; break; case MasterDataConstants.APStatus.ON_HOLD: aPFeedbackName = "On Hold"; break; default: break; } #endregion lblTitle.Text = aPApprovalProcessEntity.Title; lblAPFeedbackName.Text = aPFeedbackName; Label lblAPType = (Label)e.Item.FindControl("lblAPType"); if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.REQUISITION) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/REQ/REQRequisitionDetailsWithApproval.aspx", string.Empty, UrlConstants.REQUISITION_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString(), APForwardInfoEntity.FLD_NAME_APForwardInfoID, ent.APForwardInfoID.ToString() ).ToString(); lblAPType.Text = "Requisition"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.WORK_ORDER) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/PRM/PRMWorkOrderViewWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_WORKORDER_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString(), APForwardInfoEntity.FLD_NAME_APForwardInfoID, ent.APForwardInfoID.ToString() ).ToString(); lblAPType.Text = "Work Order"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.BILL) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/CM/CMBillDetailsWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_CM_BILL_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "Bill"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.PAYABLE_STATEMENT) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/ACC/ACCPostPayableStatementDetailWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_POST_PAYABLE_STATEMENT_DETAIL_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "Payable Statement"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.TRF) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/INV/INVTransferItemDetailsWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_TRANSFER_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "TRF"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.BANK_DEPOSIT) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/AC/ACBankAccountDepositDetailsWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_BANK_ACCOUNT_DEPOSIT_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "BANK DEPOSIT"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.BANK_PAYMENT) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/AC/ACBankAccountPaymentDetailsWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_BANK_ACCOUNT_PAYMENT_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "BANK PAYMENT"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.TEMPORARY_JOURNAL) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/AC/ACJournalDetailsWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_TEMPORARY_JOURNAL_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "JOURNAL ENTRY"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.BANK_ACCOUNT_TRANSFER) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/AC/ACBankAccountTransferDetailsWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_BANK_ACCOUNT_TRANSFER_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "BANK ACCOUNT TRANSFER"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.MRR) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/PRM/PRMMaterialReceiveDetailsWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_MATERIAL_RECEIVE_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "MATERIAL RECEIVE"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.AGREEMENT) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl( "~/CRM/CRMAgreementDetailsWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_AGREEMENT_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "AGREEMENT"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.CONTACT_LIST) { lnkViewDetails.NavigateUrl = UrlHelper.BuildSecureUrl("~/BD/BDProcessAssignedResourceDetailsWithApproval.aspx", string.Empty, UrlConstants.OVERVIEW_PROCESS_ASSIGNED_RESOURCE_ID, aPApprovalProcessEntity.ReferenceID.ToString(), APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), APMemberFeedbackEntity.FLD_NAME_APApprovalProcessID, ent.APApprovalProcessID.ToString() ).ToString(); lblAPType.Text = "CONTACT_LIST"; } else if (aPApprovalProcessEntity.APTypeID == MasterDataConstants.APType.CUSTOM) { lnkViewDetails.NavigateUrl = "#"; lblAPType.Text = "Custom"; } lnkShowApprovalStatus.NavigateUrl = UrlHelper.BuildSecureUrl( "~/AP/APView.aspx", string.Empty, APApprovalProcessEntity.FLD_NAME_APApprovalProcessID, aPApprovalProcessEntity.APApprovalProcessID.ToString() ).ToString(); lnkViewDetails.Target = "_blank"; lnkShowApprovalStatus.Target = "_blank"; } }
protected void lvREQRequisition_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListViewDataItem dataItem = (ListViewDataItem)e.Item; REQRequisition_DetailedEntity ent = (REQRequisition_DetailedEntity)dataItem.DataItem; HyperLink hypRequisition = (HyperLink)e.Item.FindControl("hypRequisition"); HyperLink hypEdit = (HyperLink)e.Item.FindControl("lnkBtnEdit"); HyperLink hypRequisitionReport = (HyperLink)e.Item.FindControl("hypRequisitionReport"); HyperLink hypCRMAdRequisitionReport = (HyperLink)e.Item.FindControl("hypCRMAdRequisitionReport"); HyperLink hypRequisitionDetail = (HyperLink)e.Item.FindControl("hypRequisitionDetail"); HyperLink lnkShowApprovalStatus = (HyperLink)e.Item.FindControl("lnkShowApprovalStatus"); Label lblRequisitionItem = (Label)e.Item.FindControl("lblRequisitionItem"); Label lblWorkOrderCreated = (Label)e.Item.FindControl("lblWorkOrderCreated"); if (ent.RequisitionStatusID == MasterDataConstants.RequisitionStatus.MIGRATE_TO_TRF) { String fe_TRF = SqlExpressionBuilder.PrepareFilterExpression(INVTransferEntity.FLD_NAME_RequisitionID, ent.RequisitionID.ToString(), SQLMatchType.Equal); IList <INVTransferEntity> iNVTransferEntityList = FCCINVTransfer.GetFacadeCreate().GetIL(null, null, String.Empty, fe_TRF, DatabaseOperationType.LoadWithFilterExpression); if (iNVTransferEntityList != null && iNVTransferEntityList.Count > 0) { Panel pnlTRFNoLV = (Panel)e.Item.FindControl("pnlTRFNoLV"); foreach (INVTransferEntity invTransferEntity in iNVTransferEntityList) { HyperLink hypTRFNoLV = new HyperLink(); hypTRFNoLV.Text = iNVTransferEntityList[0].TRFNo; hypTRFNoLV.NavigateUrl = UrlHelper.BuildSecureUrl("~/INV/INVTransferItem.aspx", string.Empty, UrlConstants.OVERVIEW_TRANSFER_ID, invTransferEntity.TransferID.ToString()).ToString(); hypTRFNoLV.Target = "_blank"; hypTRFNoLV.CssClass = "CommonButtonLink"; pnlTRFNoLV.Controls.Add(hypTRFNoLV); pnlTRFNoLV.Controls.Add(new LiteralControl("<br/>")); } } } Boolean IsAdvertisementRequisition = false; String feReqItem = SqlExpressionBuilder.PrepareFilterExpression("REQRequisitionItem." + REQRequisitionItemEntity.FLD_NAME_RequisitionID, ent.RequisitionID.ToString(), SQLMatchType.Equal); IList <REQRequisitionItem_DetailedEntity> lst = FCCREQRequisitionItem_Detailed.GetFacadeCreate().GetIL(100000, 1, String.Empty, feReqItem); if (lst != null && lst.Count > 0) { foreach (REQRequisitionItem_DetailedEntity entREQRequisitionItem_DetailedEntity in lst) { lblRequisitionItem.Text += entREQRequisitionItem_DetailedEntity.MDItemItemName + ", "; if (entREQRequisitionItem_DetailedEntity.ItemCategoryID == MasterDataConstants.ItemDefaults.DEFAULT_ADVERTIESMENT_ITEM_CATEGORY) { IsAdvertisementRequisition = true; } } lblRequisitionItem.Text = lblRequisitionItem.Text.Substring(0, lblRequisitionItem.Text.Length - 2); } IList <PRMWorkOrderNoByRequisition_CustomEntity> lstWONO = FCCPRMWorkOrderNoByRequisition_Custom.GetFacadeCreate().GetIL(Int64.Parse(ent.RequisitionID.ToString())); if (lstWONO != null && lstWONO.Count > 0) { lblWorkOrderCreated.Text = lstWONO[0].WorkOrderNo.ToString(); } String fe_req = SqlExpressionBuilder.PrepareFilterExpression("PRMWorkOrderItemMap." + PRMWorkOrderItemMapEntity.FLD_NAME_RequisitionID, ent.RequisitionID.ToString(), SQLMatchType.Equal); IList <PRMWorkOrderItemMap_DetailedEntity> lstPRMWorkOrderItemMap = FCCPRMWorkOrderItemMap_Detailed.GetFacadeCreate().GetIL(10000, 1, String.Empty, fe_req); if (lstPRMWorkOrderItemMap != null && lstPRMWorkOrderItemMap.Count > 0) { Panel pnlWorkOrderLV = (Panel)e.Item.FindControl("pnlWorkOrderLV"); List <PRMWorkOrderItemMap_DetailedEntity> distinct = lstPRMWorkOrderItemMap .GroupBy(car => car.WorkOrderID) .Select(g => g.First()) .ToList(); foreach (PRMWorkOrderItemMap_DetailedEntity pRMWorkOrderItemMapEntity in distinct) { HyperLink hypWorkOrder = new HyperLink(); hypWorkOrder.Text = pRMWorkOrderItemMapEntity.WorkOrderNo.ToString(); hypWorkOrder.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.WORK_ORDER_REPORT, UrlConstants.OVERVIEW_WORKORDER_ID, pRMWorkOrderItemMapEntity.WorkOrderID.ToString()).ToString(); hypWorkOrder.Target = "_blank"; hypWorkOrder.CssClass = "CommonButtonLink"; pnlWorkOrderLV.Controls.Add(hypWorkOrder); pnlWorkOrderLV.Controls.Add(new LiteralControl("<br/>")); String fe_mrr = SqlExpressionBuilder.PrepareFilterExpression(PRMMaterialReceiveEntity.FLD_NAME_WorkOrderID, pRMWorkOrderItemMapEntity.WorkOrderID.ToString(), SQLMatchType.Equal); IList <PRMMaterialReceiveEntity> lstPRMMaterialReceive = FCCPRMMaterialReceive.GetFacadeCreate().GetIL(null, null, String.Empty, fe_mrr, DatabaseOperationType.LoadWithFilterExpression); if (lstPRMMaterialReceive != null && lstPRMMaterialReceive.Count > 0) { Panel pnlMRRLV = (Panel)e.Item.FindControl("pnlMRRLV"); foreach (PRMMaterialReceiveEntity pRMMaterialReceiveEntity in lstPRMMaterialReceive) { HyperLink hypMaterialReceive = new HyperLink(); hypMaterialReceive.Text = pRMMaterialReceiveEntity.MRRNo; hypMaterialReceive.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", "MaterialReceiveReport", UrlConstants.OVERVIEW_MATERIAL_RECEIVE_ID, pRMMaterialReceiveEntity.MaterialReceiveID.ToString()).ToString(); hypMaterialReceive.Target = "_blank"; hypMaterialReceive.CssClass = "CommonButtonLink"; pnlMRRLV.Controls.Add(hypMaterialReceive); pnlMRRLV.Controls.Add(new LiteralControl("<br/>")); } } } } if (ent.RequisitionStatusID == MasterDataConstants.RequisitionStatus.APPROVED || ent.RequisitionStatusID == MasterDataConstants.RequisitionStatus.MIGRATE_TO_TRF) { hypEdit.Visible = false; } String NavigationUrl = String.Empty; NavigationUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", "RequisitionReport", UrlConstants.REQUISITION_ID, ent.RequisitionID.ToString()).ToString(); if (IsAdvertisementRequisition) { NavigationUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.CRM_AD_REQUISITION_REPORT, UrlConstants.REQUISITION_ID, ent.RequisitionID.ToString()).ToString(); } hypRequisitionReport.NavigateUrl = NavigationUrl; hypRequisitionReport.Target = "_blank"; hypEdit.NavigateUrl = UrlHelper.BuildSecureUrl("~/REQ/REQRequisition.aspx", string.Empty, "do", "Edit", UrlConstants.REQUISITION_ID, ent.RequisitionID.ToString()).ToString(); if (this.OverviewProjectID > 0) { hypRequisition.NavigateUrl = UrlHelper.BuildSecureUrl("~/BD/BDProjectRequisitionItem.aspx", string.Empty, UrlConstants.OVERVIEW_PROJECT_ID, this.OverviewProjectID.ToString(), REQRequisitionEntity.FLD_NAME_RequisitionID, ent.RequisitionID.ToString(), REQRequisitionEntity.FLD_NAME_RequisitionNo, ent.RequisitionNo.ToString()).ToString(); } else { hypRequisition.NavigateUrl = UrlHelper.BuildSecureUrl("~/REQ/REQRequisitionItem.aspx", string.Empty, UrlConstants.OVERVIEW_PROJECT_ID, this.OverviewProjectID.ToString(), REQRequisitionEntity.FLD_NAME_RequisitionID, ent.RequisitionID.ToString(), REQRequisitionEntity.FLD_NAME_RequisitionNo, ent.RequisitionNo.ToString()).ToString(); hypRequisitionDetail.NavigateUrl = UrlHelper.BuildSecureUrl("~/Site/REQRequisitionItemView.aspx", string.Empty, UrlConstants.OVERVIEW_PROJECT_ID, this.OverviewProjectID.ToString(), REQRequisitionEntity.FLD_NAME_RequisitionID, ent.RequisitionID.ToString(), REQRequisitionEntity.FLD_NAME_RequisitionNo, ent.RequisitionNo.ToString()).ToString(); } APApprovalProcessEntity aPApprovalProcessEntity = APRobot.GetApprovalProcessByTypeAndReference(MasterDataConstants.APType.REQUISITION, ent.RequisitionID); if (aPApprovalProcessEntity.APApprovalProcessID > 0) { lnkShowApprovalStatus.NavigateUrl = UrlHelper.BuildSecureUrl( "~/AP/APView.aspx", string.Empty, APApprovalProcessEntity.FLD_NAME_APApprovalProcessID, aPApprovalProcessEntity.APApprovalProcessID.ToString() ).ToString(); lnkShowApprovalStatus.Target = "_blank"; } else { lnkShowApprovalStatus.NavigateUrl = String.Empty; lnkShowApprovalStatus.Enabled = false; } hypEdit.Target = "_blank"; hypRequisitionReport.Target = "_blank"; hypRequisitionDetail.Target = "_blank"; } }
protected void lvACTemporaryJournalMaster_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListViewDataItem dataItem = (ListViewDataItem)e.Item; ACTemporaryJournalMaster_DetailedEntity ent = (ACTemporaryJournalMaster_DetailedEntity)dataItem.DataItem; HyperLink hypCreateDate = (HyperLink)e.Item.FindControl("hypCreateDate"); HyperLink lnkShowApprovalStatus = (HyperLink)e.Item.FindControl("lnkShowApprovalStatus"); HyperLink hypJournalReport = (HyperLink)e.Item.FindControl("hypJournalReport"); hypJournalReport.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.MANUAL_JOURNAL_REPORT, UrlConstants.OVERVIEW_TEMPORARY_JOURNAL_MASTER_ID, ent.TemporaryJournalMasterID.ToString()).ToString(); APApprovalProcessEntity aPApprovalProcessEntity = APRobot.GetApprovalProcessByTypeAndReference(MasterDataConstants.APType.TEMPORARY_JOURNAL, ent.TemporaryJournalMasterID); if (aPApprovalProcessEntity.APApprovalProcessID > 0) { lnkShowApprovalStatus.NavigateUrl = UrlHelper.BuildSecureUrl( "~/AP/APView.aspx", string.Empty, APApprovalProcessEntity.FLD_NAME_APApprovalProcessID, aPApprovalProcessEntity.APApprovalProcessID.ToString() ).ToString(); lnkShowApprovalStatus.Target = "_blank"; } else { lnkShowApprovalStatus.NavigateUrl = String.Empty; lnkShowApprovalStatus.Enabled = false; } Label lblDetailLV = (Label)e.Item.FindControl("lblDetailLV"); String feItem = SqlExpressionBuilder.PrepareFilterExpression("ACTemporaryJournal." + ACTemporaryJournalEntity.FLD_NAME_TemporaryJournalMasterID, ent.TemporaryJournalMasterID.ToString(), SQLMatchType.Equal); IList <ACTemporaryJournal_DetailedEntity> lst = FCCACTemporaryJournal_Detailed.GetFacadeCreate().GetIL(10000, 1, String.Empty, feItem); if (lst != null && lst.Count > 0) { foreach (ACTemporaryJournal_DetailedEntity aCTemporaryJournal_DetailedEntity in lst) { lblDetailLV.Text += aCTemporaryJournal_DetailedEntity.ACAccountAccountName + ", "; Panel pnlOtherInfo = (Panel)e.Item.FindControl("pnlOtherInfo"); if (aCTemporaryJournal_DetailedEntity.RequisitionID > 0) { HyperLink hypRequisitionLV = new HyperLink(); String st = "Requisition :"; hypRequisitionLV.Text = "<font color=\"black\"><b>" + st + "</font></b>" + aCTemporaryJournal_DetailedEntity.RequisitionNo; hypRequisitionLV.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.REQUISITION_REPORT, UrlConstants.REQUISITION_ID, aCTemporaryJournal_DetailedEntity.RequisitionID.ToString()).ToString(); hypRequisitionLV.Target = "_blank"; hypRequisitionLV.CssClass = "CommonButtonLink"; pnlOtherInfo.Controls.Add(hypRequisitionLV); pnlOtherInfo.Controls.Add(new LiteralControl("<br/>")); } if (aCTemporaryJournal_DetailedEntity.WorkOrderID > 0) { HyperLink hypWorkOrderLV = new HyperLink(); String st = "Work Order :"; hypWorkOrderLV.Text = "<font color=\"black\"><b>" + st + "</font></b>" + aCTemporaryJournal_DetailedEntity.WorkOrderNo; hypWorkOrderLV.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.WORK_ORDER_REPORT, UrlConstants.OVERVIEW_WORKORDER_ID, aCTemporaryJournal_DetailedEntity.WorkOrderID.ToString()).ToString(); hypWorkOrderLV.Target = "_blank"; hypWorkOrderLV.CssClass = "CommonButtonLink"; pnlOtherInfo.Controls.Add(hypWorkOrderLV); pnlOtherInfo.Controls.Add(new LiteralControl("<br/>")); } if (aCTemporaryJournal_DetailedEntity.BillID > 0) { HyperLink hypBillLV = new HyperLink(); String st = "Bill :"; hypBillLV.Text = "<font color=\"black\"><b>" + st + "</font></b>" + aCTemporaryJournal_DetailedEntity.BillNo; hypBillLV.NavigateUrl = String.Empty; hypBillLV.Target = "_blank"; hypBillLV.CssClass = "CommonButtonLink"; pnlOtherInfo.Controls.Add(hypBillLV); pnlOtherInfo.Controls.Add(new LiteralControl("<br/>")); } } lblDetailLV.Text = lblDetailLV.Text.Substring(0, lblDetailLV.Text.Length - 2); } hypCreateDate.NavigateUrl = UrlHelper.BuildSecureUrl("~/AC/ACTemporaryJournal.aspx", string.Empty, UrlConstants.OVERVIEW_TEMPORARY_JOURNAL_MASTER_ID, ent.TemporaryJournalMasterID.ToString()).ToString(); hypCreateDate.Target = "_blank"; hypJournalReport.Target = "_blank"; } }