public IList <CMMDBillFloorDetailCategoryEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <CMMDBillFloorDetailCategoryEntity> cMMDBillFloorDetailCategoryEntityList = new List <CMMDBillFloorDetailCategoryEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = CMMDBillFloorDetailCategoryEntity.FLD_NAME_BillFloorDetailCategoryID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                cMMDBillFloorDetailCategoryEntityList = FCCCMMDBillFloorDetailCategory.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(cMMDBillFloorDetailCategoryEntityList ?? new List <CMMDBillFloorDetailCategoryEntity>());
        }
        private void SaveCMMDBillFloorDetailCategoryEntity()
        {
            if (IsValid)
            {
                try
                {
                    CMMDBillFloorDetailCategoryEntity cMMDBillFloorDetailCategoryEntity = BuildCMMDBillFloorDetailCategoryEntity();

                    Int64 result = -1;

                    if (cMMDBillFloorDetailCategoryEntity.IsNew)
                    {
                        result = FCCCMMDBillFloorDetailCategory.GetFacadeCreate().Add(cMMDBillFloorDetailCategoryEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CMMDBillFloorDetailCategoryEntity.FLD_NAME_BillFloorDetailCategoryID, cMMDBillFloorDetailCategoryEntity.BillFloorDetailCategoryID.ToString(), SQLMatchType.Equal);
                        result = FCCCMMDBillFloorDetailCategory.GetFacadeCreate().Update(cMMDBillFloorDetailCategoryEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _BillFloorDetailCategoryID         = 0;
                        _CMMDBillFloorDetailCategoryEntity = new CMMDBillFloorDetailCategoryEntity();
                        PrepareInitialView();
                        BindCMMDBillFloorDetailCategoryList();

                        if (cMMDBillFloorDetailCategoryEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "C MBill Floor Detail Category Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "C MBill Floor Detail Category Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (cMMDBillFloorDetailCategoryEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add C MBill Floor Detail Category Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update C MBill Floor Detail Category Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvCMMDBillFloorDetailCategory_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 BillFloorDetailCategoryID;

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

            if (BillFloorDetailCategoryID > 0)
            {
                if (string.Equals(e.CommandName, "EditItem"))
                {
                    _BillFloorDetailCategoryID = BillFloorDetailCategoryID;

                    PrepareEditView();

                    cpeEditor.Collapsed   = false;
                    cpeEditor.ClientState = "false";
                }
                else if (string.Equals(e.CommandName, "DeleteItem"))
                {
                    try
                    {
                        Int64 result = -1;

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(CMMDBillFloorDetailCategoryEntity.FLD_NAME_BillFloorDetailCategoryID, BillFloorDetailCategoryID.ToString(), SQLMatchType.Equal);

                        CMMDBillFloorDetailCategoryEntity cMMDBillFloorDetailCategoryEntity = new CMMDBillFloorDetailCategoryEntity();


                        result = FCCCMMDBillFloorDetailCategory.GetFacadeCreate().Delete(cMMDBillFloorDetailCategoryEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _BillFloorDetailCategoryID         = 0;
                            _CMMDBillFloorDetailCategoryEntity = new CMMDBillFloorDetailCategoryEntity();
                            PrepareInitialView();
                            BindCMMDBillFloorDetailCategoryList();

                            MiscUtil.ShowMessage(lblMessage, "C MBill Floor Detail Category has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete C MBill Floor Detail Category.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <CMMDBillFloorDetailCategoryEntity> GetData()
        {
            IList <CMMDBillFloorDetailCategoryEntity> cMMDBillFloorDetailCategoryEntityList = new List <CMMDBillFloorDetailCategoryEntity>();

            try
            {
                cMMDBillFloorDetailCategoryEntityList = FCCCMMDBillFloorDetailCategory.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(cMMDBillFloorDetailCategoryEntityList ?? new List <CMMDBillFloorDetailCategoryEntity>());
        }