public IList <PRMMaterialReceiveEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <PRMMaterialReceiveEntity> pRMMaterialReceiveEntityList = new List <PRMMaterialReceiveEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = PRMMaterialReceiveEntity.FLD_NAME_MaterialReceiveID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; pRMMaterialReceiveEntityList = FCCPRMMaterialReceive.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (pRMMaterialReceiveEntityList != null && pRMMaterialReceiveEntityList.Count > 0) { totalRowCount = pRMMaterialReceiveEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(pRMMaterialReceiveEntityList ?? new List <PRMMaterialReceiveEntity>()); }
private void SavePRMMaterialReceiveEntity() { if (IsValid) { try { PRMMaterialReceiveEntity pRMMaterialReceiveEntity = BuildPRMMaterialReceiveEntity(); Int64 result = -1; if (pRMMaterialReceiveEntity.IsNew) { result = FCCPRMMaterialReceive.GetFacadeCreate().Add(pRMMaterialReceiveEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(PRMMaterialReceiveEntity.FLD_NAME_MaterialReceiveID, pRMMaterialReceiveEntity.MaterialReceiveID.ToString(), SQLMatchType.Equal); result = FCCPRMMaterialReceive.GetFacadeCreate().Update(pRMMaterialReceiveEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { // BuildPRMMaterialReceiveItemEntity(result, pRMMaterialReceiveEntity); _MaterialReceiveID = 0; _PRMMaterialReceiveEntity = new PRMMaterialReceiveEntity(); PrepareInitialView(); if (pRMMaterialReceiveEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Material Receive Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Material Receive Information has been updated successfully.", false); } } else { if (pRMMaterialReceiveEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Material Receive Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Material Receive Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
private INVStoreIssueNoteEntity BuildINVStoreIssueNoteEntity() { PRMMaterialReceiveEntity pRMMaterialReceiveEntity = FCCPRMMaterialReceive.GetFacadeCreate().GetByID(Int64.Parse(ddlMaterialReceiveID.SelectedValue)); INVStoreIssueNoteEntity iNVStoreIssueNoteEntity = new INVStoreIssueNoteEntity(); iNVStoreIssueNoteEntity.ProjectID = pRMMaterialReceiveEntity.ProjectID; iNVStoreIssueNoteEntity.SRFNo = "Adjustment"; iNVStoreIssueNoteEntity.RequestedByEmployeeID = 168;//Need to change here; will come from mrr created employee ID iNVStoreIssueNoteEntity.RequestDate = System.DateTime.Now; iNVStoreIssueNoteEntity.Remarks = "MRR Adjustment Entry"; iNVStoreIssueNoteEntity.StoreIssueNoteApprovalStatusID = MasterDataConstants.INVStoreIssueNoteApprovalStatus.ISSUED; iNVStoreIssueNoteEntity.IsRemoved = false; return(iNVStoreIssueNoteEntity); }
public IList <PRMMaterialReceiveEntity> GetData() { IList <PRMMaterialReceiveEntity> pRMMaterialReceiveEntityList = new List <PRMMaterialReceiveEntity>(); try { pRMMaterialReceiveEntityList = FCCPRMMaterialReceive.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (pRMMaterialReceiveEntityList != null && pRMMaterialReceiveEntityList.Count > 0) { totalRowCount = pRMMaterialReceiveEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(pRMMaterialReceiveEntityList ?? new List <PRMMaterialReceiveEntity>()); }
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"; } }
private void SavePRMMaterialReceiveEntity() { if (IsValid) { try { PRMMaterialReceiveEntity pRMMaterialReceiveEntity = BuildPRMMaterialReceiveEntity(); #region Requisition String RequisitionNo = String.Empty; if (txtRequisition.Text.IsNotNullOrEmpty()) { RequisitionNo = "BL-" + txtRequisition.Text.ToString(); } Int64 resultRequisition = -1; Int64 resultRequisitionItem = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(REQRequisitionEntity.FLD_NAME_RequisitionNo, RequisitionNo, SQLMatchType.Equal); IList <REQRequisitionEntity> lstRequisition = FCCREQRequisition.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression); REQRequisitionItemEntity rEQRequisitionItemEntity = null; if (lstRequisition != null && lstRequisition.Count > 0) { rEQRequisitionItemEntity = BuildREQRequisitionItemEntity(lstRequisition[0].RequisitionID); pRMMaterialReceiveEntity.RequisitionID = lstRequisition[0].RequisitionID; } else { REQRequisitionEntity rEQRequisitionEntity = BuildREQRequisitionEntity(); resultRequisition = FCCREQRequisition.GetFacadeCreate().Add(rEQRequisitionEntity, DatabaseOperationType.Add, TransactionRequired.No); pRMMaterialReceiveEntity.RequisitionID = resultRequisition; if (resultRequisition > 0) { rEQRequisitionItemEntity = BuildREQRequisitionItemEntity(resultRequisition); } } if (rEQRequisitionItemEntity != null) { resultRequisitionItem = FCCREQRequisitionItem.GetFacadeCreate().Add(rEQRequisitionItemEntity, DatabaseOperationType.Add, TransactionRequired.No); } #endregion #region MRR Int64 resultOne = -1; if (pRMMaterialReceiveEntity.IsNew) { resultOne = FCCPRMMaterialReceive.GetFacadeCreate().Add(pRMMaterialReceiveEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(PRMMaterialReceiveEntity.FLD_NAME_MaterialReceiveID, pRMMaterialReceiveEntity.MaterialReceiveID.ToString(), SQLMatchType.Equal); resultOne = FCCPRMMaterialReceive.GetFacadeCreate().Update(pRMMaterialReceiveEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } #endregion if (resultOne > 0 && resultRequisitionItem > 0) { #region Material Receive Item Map Int64 resultTwo = -1; PRMMaterialReceiveItemMapEntity pRMMaterialReceiveItemMapEntity = BuildPRMMaterialReceiveItemMapEntity(resultOne, resultRequisitionItem); resultTwo = FCCPRMMaterialReceiveItemMap.GetFacadeCreate().Add(pRMMaterialReceiveItemMapEntity, DatabaseOperationType.Add, TransactionRequired.No); #endregion try { #region Inventory Int64 _employeeID = MiscUtil.GetCurrentEmployeeByMemberID(CurrentMember); Int64 _projectID = Int64.Parse(ddlProjectID.SelectedValue); INVStoreEntity storeEntity = INVManager.GetDefaultStore(_projectID); Int64 storeID = storeEntity.StoreID; INVStoreUnitEntity storeUnitEntity = INVManager.GetDefaultStoreUnit(storeID); Int64 storeUnitID = storeUnitEntity.StoreUnitID; String fe_requisitionItem = SqlExpressionBuilder.PrepareFilterExpression("REQRequisitionItem." + REQRequisitionItemEntity.FLD_NAME_RequisitionItemID, resultRequisitionItem.ToString(), SQLMatchType.Equal); IList <REQRequisitionItem_DetailedEntity> lst = FCCREQRequisitionItem_Detailed.GetFacadeCreate().GetIL(10000, 1, String.Empty, fe_requisitionItem); Int64 _itemID = 0; Decimal _rate = 0; Int64 brandID = MasterDataConstants.ItemDefaults.DEFAULT_BRAD; Int64 regionID = MasterDataConstants.ItemDefaults.DEFAULT_REGION; Int64 countryID = MasterDataConstants.ItemDefaults.DEFAULT_COUNTRY; if (lst != null && lst.Count > 0) { _itemID = lst[0].ItemID; brandID = (Int64)lst[0].BrandID; regionID = (Int64)lst[0].RegionID; countryID = (Int64)lst[0].CountryID; _rate = lst[0].Rate; } Boolean invResult = INVManager.AddItemsToStoreUnit(_itemID, brandID, regionID, countryID, "", Int64.Parse(txtReceiveQty.Text.ToString()), MiscUtil.GetLocalIP(), _employeeID, _rate, txtRequisition.Text, ddlWorkOrderID.SelectedItem.Text, resultOne.ToString(), "", Int64.Parse(ddlProjectID.SelectedValue), storeID, storeUnitID); #endregion } catch (Exception ex) { } _MaterialReceiveID = resultOne; PrepareInitialViewSave(); btnAddNew.Visible = true; if (pRMMaterialReceiveEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Material Receive Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Material Receive Information has been updated successfully.", false); } } else { if (pRMMaterialReceiveEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Material Receive Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Material Receive Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
private void SavePRMMaterialReceiveEntity() { if (IsValid) { try { PRMMaterialReceiveEntity pRMMaterialReceiveEntity = BuildPRMMaterialReceiveEntity(); Int64 result = -1; if (pRMMaterialReceiveEntity.IsNew) { result = FCCPRMMaterialReceive.GetFacadeCreate().Add(pRMMaterialReceiveEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(PRMMaterialReceiveEntity.FLD_NAME_MaterialReceiveID, pRMMaterialReceiveEntity.MaterialReceiveID.ToString(), SQLMatchType.Equal); result = FCCPRMMaterialReceive.GetFacadeCreate().Update(pRMMaterialReceiveEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { BuildPRMMaterialReceiveItemEntity(result, pRMMaterialReceiveEntity); #region Approval Process Boolean apResult = APRobot.CreateApprovalProcessForNewMRR(result, Int64.Parse(ddlAPPanelID.SelectedValue)); if (apResult == true) { MiscUtil.ShowMessage(lblMessage, "Approval Process Submited successfully.", UIConstants.MessageType.GREEN); } else { MiscUtil.ShowMessage(lblMessage, "Failed to Submit Approval Process.", UIConstants.MessageType.RED); } #endregion _MaterialReceiveID = 0; _PRMMaterialReceiveEntity = new PRMMaterialReceiveEntity(); PrepareInitialView(); if (pRMMaterialReceiveEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Material Receive Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Material Receive Information has been updated successfully.", false); } } else { if (pRMMaterialReceiveEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Material Receive Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Material Receive Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvPRMMaterialReceive_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 MaterialReceiveID; Int64.TryParse(e.CommandArgument.ToString(), out MaterialReceiveID); if (MaterialReceiveID > 0) { if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(PRMMaterialReceiveEntity.FLD_NAME_MaterialReceiveID, MaterialReceiveID.ToString(), SQLMatchType.Equal); PRMMaterialReceiveEntity pRMMaterialReceiveEntity = new PRMMaterialReceiveEntity(); result = FCCPRMMaterialReceive.GetFacadeCreate().Delete(pRMMaterialReceiveEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _MaterialReceiveID = 0; _PRMMaterialReceiveEntity = new PRMMaterialReceiveEntity(); PrepareInitialView(); BindPRMMaterialReceiveList(); MiscUtil.ShowMessage(lblMessage, "Material Receive has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Material Receive.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } else if (string.Equals(e.CommandName, "ResetAP")) { try { #region Approval Process Boolean apResult = APRobot.ResetApprovalProcessForMRR(MaterialReceiveID); if (apResult == true) { MiscUtil.ShowMessage(lblMessage, "Approval Process has been reset successfully.", UIConstants.MessageType.GREEN); } else { MiscUtil.ShowMessage(lblMessage, "Failed to reset approval process.", UIConstants.MessageType.RED); } BindList(); #endregion } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
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"; } }