protected void btnCancel_Click(object sender, EventArgs e)
 {
     _BankAccountPaymentID = 0;
     CurrentACBankAccountPaymentItemEntity = new ACBankAccountPaymentItem_DetailedEntity();
     txtMemoDetail.Text = String.Empty;
     txtAmount.Text     = String.Empty;
     pnlUpdate.Visible  = false;
     pnlAdd.Visible     = true;
 }
Ejemplo n.º 2
0
        protected void lvACBankAccountPaymentItem_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                ListViewDataItem dataItem = (ListViewDataItem)e.Item;

                ACBankAccountPaymentItem_DetailedEntity ent = (ACBankAccountPaymentItem_DetailedEntity)dataItem.DataItem;

                HyperLink hypRequisitionLV = (HyperLink)e.Item.FindControl("hypRequisitionLV");
                HyperLink hypWorkOrderLV   = (HyperLink)e.Item.FindControl("hypWorkOrderLV");

                hypRequisitionLV.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.REQUISITION_REPORT, UrlConstants.REQUISITION_ID, ent.RequisitionID.ToString()).ToString();
                hypRequisitionLV.Target      = "_blank";
                hypWorkOrderLV.NavigateUrl   = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.WORK_ORDER_REPORT, UrlConstants.OVERVIEW_WORKORDER_ID, ent.WorkOrderID.ToString()).ToString();
                hypWorkOrderLV.Target        = "_blank";
            }
        }
        private void PrepareEditViewPaymentItem()
        {
            ACBankAccountPaymentItem_DetailedEntity aCBankAccountPaymentItemEntity = CurrentACBankAccountPaymentItemEntity;

            if (!aCBankAccountPaymentItemEntity.IsNew)
            {
                if (aCBankAccountPaymentItemEntity.AccountID > 0)
                {
                    txtItemName.Text = aCBankAccountPaymentItemEntity.AccountName.ToString();
                    hdEmpID.Value    = aCBankAccountPaymentItemEntity.AccountID.ToString();
                }

                if (ddlItemID.Items.Count > 0 && aCBankAccountPaymentItemEntity.ItemID != null)
                {
                    ddlItemID.SelectedValue = aCBankAccountPaymentItemEntity.ItemID.ToString();
                }
                else if (aCBankAccountPaymentItemEntity.ItemID == null)
                {
                    ddlItemID.SelectedValue = "0";
                }

                if (ddlProjectID.Items.Count > 0 && aCBankAccountPaymentItemEntity.ProjectID != null)
                {
                    ddlProjectID.SelectedValue = aCBankAccountPaymentItemEntity.ProjectID.ToString();
                }
                else if (aCBankAccountPaymentItemEntity.ProjectID == null)
                {
                    ddlProjectID.SelectedValue = "0";
                }

                BuildProjectWiseDropdownInfo();

                if (ddlRequisitionID.Items.Count > 0 && aCBankAccountPaymentItemEntity.RequisitionID != null)
                {
                    ddlRequisitionID.SelectedValue = aCBankAccountPaymentItemEntity.RequisitionID.ToString();
                }
                else if (aCBankAccountPaymentItemEntity.RequisitionID == null)
                {
                    ddlRequisitionID.SelectedValue = "0";
                }

                BuildRequisitionWiseInfo();

                if (ddlWorkOrderID.Items.Count > 0 && aCBankAccountPaymentItemEntity.WorkOrderID != null)
                {
                    ddlWorkOrderID.SelectedValue = aCBankAccountPaymentItemEntity.WorkOrderID.ToString();
                }
                else if (aCBankAccountPaymentItemEntity.WorkOrderID == null)
                {
                    ddlWorkOrderID.SelectedValue = "0";
                }

                BuildWorkorderWiseInfo();

                if (ddlBillID.Items.Count > 0 && aCBankAccountPaymentItemEntity.BillID != null)
                {
                    ddlBillID.SelectedValue = aCBankAccountPaymentItemEntity.BillID.ToString();
                }
                else if (aCBankAccountPaymentItemEntity.BillID == null)
                {
                    ddlBillID.SelectedValue = "0";
                }

                if (ddlProjectFloorID.Items.Count > 0 && aCBankAccountPaymentItemEntity.ProjectFloorID != null)
                {
                    ddlProjectFloorID.SelectedValue = aCBankAccountPaymentItemEntity.ProjectFloorID.ToString();
                }
                else if (aCBankAccountPaymentItemEntity.ProjectFloorID == null)
                {
                    ddlProjectFloorID.SelectedValue = "0";
                }

                BuildFloorWiseInfo();

                if (ddlProjectFloorUnitID.Items.Count > 0 && aCBankAccountPaymentItemEntity.ProjectFloorUnitID != null)
                {
                    ddlProjectFloorUnitID.SelectedValue = aCBankAccountPaymentItemEntity.ProjectFloorUnitID.ToString();
                }
                else if (aCBankAccountPaymentItemEntity.ProjectFloorUnitID == null)
                {
                    ddlProjectFloorUnitID.SelectedValue = "0";
                }

                txtAmount.Text     = aCBankAccountPaymentItemEntity.Amount.ToString();
                txtMemoDetail.Text = aCBankAccountPaymentItemEntity.Memo.ToString();
            }
        }