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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDProjectFloorUnitTypeEntity.FLD_NAME_ProjectFloorUnitTypeID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDProjectFloorUnitTypeEntityList = FCCMDProjectFloorUnitType.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDProjectFloorUnitTypeEntityList ?? new List <MDProjectFloorUnitTypeEntity>());
        }
        private void SaveMDProjectFloorUnitTypeEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDProjectFloorUnitTypeEntity mDProjectFloorUnitTypeEntity = BuildMDProjectFloorUnitTypeEntity();

                    Int64 result = -1;

                    if (mDProjectFloorUnitTypeEntity.IsNew)
                    {
                        result = FCCMDProjectFloorUnitType.GetFacadeCreate().Add(mDProjectFloorUnitTypeEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDProjectFloorUnitTypeEntity.FLD_NAME_ProjectFloorUnitTypeID, mDProjectFloorUnitTypeEntity.ProjectFloorUnitTypeID.ToString(), SQLMatchType.Equal);
                        result = FCCMDProjectFloorUnitType.GetFacadeCreate().Update(mDProjectFloorUnitTypeEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ProjectFloorUnitTypeID       = 0;
                        _MDProjectFloorUnitTypeEntity = new MDProjectFloorUnitTypeEntity();
                        PrepareInitialView();
                        BindMDProjectFloorUnitTypeList();

                        if (mDProjectFloorUnitTypeEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Project Floor Unit Type Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Project Floor Unit Type Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDProjectFloorUnitTypeEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Project Floor Unit Type Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Project Floor Unit Type Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvMDProjectFloorUnitType_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 ProjectFloorUnitTypeID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDProjectFloorUnitTypeEntity.FLD_NAME_ProjectFloorUnitTypeID, ProjectFloorUnitTypeID.ToString(), SQLMatchType.Equal);

                        MDProjectFloorUnitTypeEntity mDProjectFloorUnitTypeEntity = new MDProjectFloorUnitTypeEntity();


                        result = FCCMDProjectFloorUnitType.GetFacadeCreate().Delete(mDProjectFloorUnitTypeEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _ProjectFloorUnitTypeID       = 0;
                            _MDProjectFloorUnitTypeEntity = new MDProjectFloorUnitTypeEntity();
                            PrepareInitialView();
                            BindMDProjectFloorUnitTypeList();

                            MiscUtil.ShowMessage(lblMessage, "Project Floor Unit Type has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Project Floor Unit Type.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <MDProjectFloorUnitTypeEntity> GetData()
        {
            IList <MDProjectFloorUnitTypeEntity> mDProjectFloorUnitTypeEntityList = new List <MDProjectFloorUnitTypeEntity>();

            try
            {
                mDProjectFloorUnitTypeEntityList = FCCMDProjectFloorUnitType.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDProjectFloorUnitTypeEntityList ?? new List <MDProjectFloorUnitTypeEntity>());
        }