Exemplo n.º 1
0
        public IList <ACBankAccountPaymentItem_DetailedEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression, String filterExpression)
        {
            IList <ACBankAccountPaymentItem_DetailedEntity> aCBankAccountPaymentItem_DetailedEntityList = new List <ACBankAccountPaymentItem_DetailedEntity>();

            try
            {
                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = "BankAccountPaymentItemID";
                }

                Int32 currentPage = Convert.ToInt32(startRowIndex / pageSize) + 1;
                //startRowIndex = Convert.ToInt32(  startRowIndex / pageSize) + 1;

                if (pageSize == -1)
                {
                    pageSize = 1000000000;
                }

                aCBankAccountPaymentItem_DetailedEntityList = FCCACBankAccountPaymentItem_Detailed.GetFacadeCreate().GetIL(pageSize, currentPage, sortExpression, filterExpression);

                if (aCBankAccountPaymentItem_DetailedEntityList != null && aCBankAccountPaymentItem_DetailedEntityList.Count > 0)
                {
                    totalRowCount = aCBankAccountPaymentItem_DetailedEntityList[0].TotalRowCount;
                }
            }
            catch (Exception ex)
            {
            }

            return(aCBankAccountPaymentItem_DetailedEntityList ?? new List <ACBankAccountPaymentItem_DetailedEntity>());
        }
Exemplo n.º 2
0
        protected void lvACBankAccountPayment_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                ListViewDataItem dataItem = (ListViewDataItem)e.Item;

                ACBankAccountPayment_DetailedEntity ent = (ACBankAccountPayment_DetailedEntity)dataItem.DataItem;

                HyperLink hypReference          = (HyperLink)e.Item.FindControl("hypReference");
                HyperLink lnkShowApprovalStatus = (HyperLink)e.Item.FindControl("lnkShowApprovalStatus");
                Label     lblDetailLV           = (Label)e.Item.FindControl("lblDetailLV");

                HyperLink hypPaymentReport = (HyperLink)e.Item.FindControl("hypPaymentReport");
                hypPaymentReport.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.BANK_ACCOUNT_PAYMENT_REPORT, UrlConstants.OVERVIEW_BANK_ACCOUNT_PAYMENT_ID, ent.BankAccountPaymentID.ToString()).ToString();

                APApprovalProcessEntity aPApprovalProcessEntity = APRobot.GetApprovalProcessByTypeAndReference(MasterDataConstants.APType.BANK_PAYMENT, ent.BankAccountPaymentID);

                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 feItem = SqlExpressionBuilder.PrepareFilterExpression("ACBankAccountPaymentItem." + ACBankAccountPaymentItemEntity.FLD_NAME_BankAccountPaymentID, ent.BankAccountPaymentID.ToString(), SQLMatchType.Equal);
                IList <ACBankAccountPaymentItem_DetailedEntity> lst = FCCACBankAccountPaymentItem_Detailed.GetFacadeCreate().GetIL(10000, 1, String.Empty, feItem);

                if (lst != null && lst.Count > 0)
                {
                    foreach (ACBankAccountPaymentItem_DetailedEntity aCBankAccountPaymentItemEntity in lst)
                    {
                        lblDetailLV.Text += aCBankAccountPaymentItemEntity.AccountName + ", ";

                        Panel pnlOtherInfo = (Panel)e.Item.FindControl("pnlOtherInfo");

                        if (aCBankAccountPaymentItemEntity.RequisitionID > 0)
                        {
                            HyperLink hypRequisitionLV = new HyperLink();
                            String    st = "Requisition :";
                            hypRequisitionLV.Text        = "<font color=\"black\"><b>" + st + "</font></b>" + aCBankAccountPaymentItemEntity.RequisitionNo;
                            hypRequisitionLV.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.REQUISITION_REPORT, UrlConstants.REQUISITION_ID, aCBankAccountPaymentItemEntity.RequisitionID.ToString()).ToString();
                            hypRequisitionLV.Target      = "_blank";
                            hypRequisitionLV.CssClass    = "CommonButtonLink";
                            pnlOtherInfo.Controls.Add(hypRequisitionLV);
                            pnlOtherInfo.Controls.Add(new LiteralControl("<br/>"));
                        }

                        if (aCBankAccountPaymentItemEntity.WorkOrderID > 0)
                        {
                            HyperLink hypWorkOrderLV = new HyperLink();
                            String    st             = "Work Order :";
                            hypWorkOrderLV.Text        = "<font color=\"black\"><b>" + st + "</font></b>" + aCBankAccountPaymentItemEntity.WorkOrderNo;
                            hypWorkOrderLV.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.WORK_ORDER_REPORT, UrlConstants.OVERVIEW_WORKORDER_ID, aCBankAccountPaymentItemEntity.WorkOrderID.ToString()).ToString();
                            hypWorkOrderLV.Target      = "_blank";
                            hypWorkOrderLV.CssClass    = "CommonButtonLink";
                            pnlOtherInfo.Controls.Add(hypWorkOrderLV);
                            pnlOtherInfo.Controls.Add(new LiteralControl("<br/>"));
                        }

                        if (aCBankAccountPaymentItemEntity.BillID > 0)
                        {
                            HyperLink hypBillLV = new HyperLink();
                            String    st        = "Bill :";
                            hypBillLV.Text        = "<font color=\"black\"><b>" + st + "</font></b>" + aCBankAccountPaymentItemEntity.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);
                }

                hypReference.NavigateUrl = UrlHelper.BuildSecureUrl("~/AC/ACBankAccountPaymentItem.aspx", string.Empty, UrlConstants.OVERVIEW_BANK_ACCOUNT_PAYMENT_ID, ent.BankAccountPaymentID.ToString()).ToString();

                hypReference.Target     = "_blank";
                hypPaymentReport.Target = "_blank";
            }
        }