public IList <PRMBOQFloorDetail_DetailedEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression, String filterExpression)
        {
            IList <PRMBOQFloorDetail_DetailedEntity> pRMBOQFloorDetail_DetailedEntityList = new List <PRMBOQFloorDetail_DetailedEntity>();

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

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

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

                pRMBOQFloorDetail_DetailedEntityList = FCCPRMBOQFloorDetail_Detailed.GetFacadeCreate().GetIL(pageSize, currentPage, sortExpression, filterExpression);

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

            return(pRMBOQFloorDetail_DetailedEntityList ?? new List <PRMBOQFloorDetail_DetailedEntity>());
        }
        protected void lvPRMMaterialReceive_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 WorkOrderItemMapID;

            Int64.TryParse(e.CommandArgument.ToString(), out WorkOrderItemMapID);

            if (WorkOrderItemMapID > 0)
            {
                if (e.CommandName == "FloorWiseRateAndQty")
                {
                    CurrentWorkOrderItemIDPopup = WorkOrderItemMapID;

                    Label lblItemLV               = (Label)e.Item.FindControl("lblItemLV");
                    Label lblRequisitionIDLV      = (Label)e.Item.FindControl("lblRequisitionIDLV");
                    Label lblRequisitionItemIDLV  = (Label)e.Item.FindControl("lblRequisitionItemIDLV");
                    Label lblWorkOrderItemMapIDLV = (Label)e.Item.FindControl("lblWorkOrderItemMapIDLV");

                    Label lblProjectIDLV   = (Label)e.Item.FindControl("lblProjectIDLV");
                    Label lblWorkOrderIDLV = (Label)e.Item.FindControl("lblWorkOrderIDLV");

                    Int64 itemID;
                    Int64.TryParse(lblItemLV.Text.Trim(), out itemID);

                    String fe_floor = SqlExpressionBuilder.PrepareFilterExpression(BDProjectFloorEntity.FLD_NAME_ProjectID, lblProjectIDLV.Text.ToString(), SQLMatchType.Equal);
                    IList <BDProjectFloorEntity> lstBDProjectFloor = FCCBDProjectFloor.GetFacadeCreate().GetIL(null, null, String.Empty, fe_floor, DatabaseOperationType.LoadWithFilterExpression);

                    if (lstBDProjectFloor != null && lstBDProjectFloor.Count > 0)
                    {
                        String fe = SqlExpressionBuilder.PrepareFilterExpression(PRMPreBOQEntity.FLD_NAME_ProjectID, lblProjectIDLV.Text.ToString(), SQLMatchType.Equal);
                        IList <PRMPreBOQEntity> preBOQList = FCCPRMPreBOQ.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

                        if (preBOQList != null && preBOQList.Count > 0)
                        {
                            Int64 preBOQID = preBOQList[0].PreBOQID;

                            switch (preBOQList[0].IsLocked)
                            {
                            case true:

                                #region GET Item From BOQ

                                String fe_boq = SqlExpressionBuilder.PrepareFilterExpression(PRMBOQEntity.FLD_NAME_PreBOQID, preBOQID.ToString(), SQLMatchType.Equal);
                                IList <PRMBOQEntity> lstPRMBOQ = FCCPRMBOQ.GetFacadeCreate().GetIL(null, null, String.Empty, fe_boq, DatabaseOperationType.LoadWithFilterExpression);

                                if (lstPRMBOQ != null && lstPRMBOQ.Count > 0)
                                {
                                    String fe_BOQDetail1 = SqlExpressionBuilder.PrepareFilterExpression(PRMBOQDetailEntity.FLD_NAME_BOQID, lstPRMBOQ[0].BOQID.ToString(), SQLMatchType.Equal);
                                    String fe_BOQDetail2 = SqlExpressionBuilder.PrepareFilterExpression(PRMBOQDetailEntity.FLD_NAME_ItemID, itemID.ToString(), SQLMatchType.Equal);

                                    String fe_BOQDetail = SqlExpressionBuilder.PrepareFilterExpression(fe_BOQDetail1, SQLJoinType.AND, fe_BOQDetail2);

                                    IList <PRMBOQDetailEntity> lstPRMBOQDetail = FCCPRMBOQDetail.GetFacadeCreate().GetIL(null, null, String.Empty, fe_BOQDetail, DatabaseOperationType.LoadWithFilterExpression);

                                    if (lstPRMBOQDetail != null && lstPRMBOQDetail.Count > 0)
                                    {
                                        String fe_floorDetail = SqlExpressionBuilder.PrepareFilterExpression("PRMBOQFloorDetail." + PRMBOQFloorDetailEntity.FLD_NAME_BOQDetailID, lstPRMBOQDetail[0].BOQDetailID.ToString(), SQLMatchType.Equal);
                                        IList <PRMBOQFloorDetail_DetailedEntity> lstPRMPreBOQFloorDetail = FCCPRMBOQFloorDetail_Detailed.GetFacadeCreate().GetIL(100000, 1, String.Empty, fe_floorDetail);

                                        lvREQRequisitionItemFloorDetail.DataSource = lstPRMPreBOQFloorDetail;
                                        lvREQRequisitionItemFloorDetail.DataBind();
                                    }
                                }

                                #endregion

                                break;

                            case false:

                                #region Get Item From Pre-BOQ

                                String fe_preBOQDetail1 = SqlExpressionBuilder.PrepareFilterExpression(PRMPreBOQDetailEntity.FLD_NAME_PreBOQID, preBOQID.ToString(), SQLMatchType.Equal);
                                String fe_preBOQDetail2 = SqlExpressionBuilder.PrepareFilterExpression(PRMPreBOQDetailEntity.FLD_NAME_ItemID, itemID.ToString(), SQLMatchType.Equal);

                                String fe_preBOQDetail = SqlExpressionBuilder.PrepareFilterExpression(fe_preBOQDetail1, SQLJoinType.AND, fe_preBOQDetail2);

                                IList <PRMPreBOQDetailEntity> lstPRMPreBOQDetail = FCCPRMPreBOQDetail.GetFacadeCreate().GetIL(null, null, String.Empty, fe_preBOQDetail, DatabaseOperationType.LoadWithFilterExpression);

                                if (lstPRMPreBOQDetail != null && lstPRMPreBOQDetail.Count > 0)
                                {
                                    String fe_floorDetail = SqlExpressionBuilder.PrepareFilterExpression("PRMPreBOQFloorDetail." + PRMPreBOQFloorDetailEntity.FLD_NAME_PreBOQDetailID, lstPRMPreBOQDetail[0].PreBOQDetailID.ToString(), SQLMatchType.Equal);
                                    IList <PRMPreBOQFloorDetail_DetailedEntity> lstPRMPreBOQFloorDetail = FCCPRMPreBOQFloorDetail_Detailed.GetFacadeCreate().GetIL(10000, 1, String.Empty, fe_floorDetail);

                                    lvREQRequisitionItemFloorDetail.DataSource = lstPRMPreBOQFloorDetail;
                                    lvREQRequisitionItemFloorDetail.DataBind();
                                }

                                #endregion

                                break;

                            default:
                                break;
                            }
                        }
                    }

                    Label lblItemNameLV = (Label)e.Item.FindControl("lblItemNameLV");

                    //BindREQRequisitionFloorDetailList();
                    //lblFloorWiseItemName.Text = lblItemNameLV.Text.ToString();
                    this.ModalPopupExtender2.Show();

                    if (lvREQRequisitionItemFloorDetail.DataSource != null)
                    {
                        btnFloorPopupSave.Enabled = true;
                    }
                    else
                    {
                        btnFloorPopupSave.Enabled = false;
                    }

                    if (CurrentPRMWorkOrderEntity.WorkOrderStatusID != MasterDataConstants.WorkOrderStatus.APPROVED)
                    {
                        lblLockMessage.Visible = false;
                    }

                    else if (CurrentPRMWorkOrderEntity.WorkOrderStatusID == MasterDataConstants.WorkOrderStatus.APPROVED)
                    {
                        btnFloorPopupSave.Enabled = false;
                        lblLockMessage.Visible    = true;
                    }
                }
            }
        }