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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDArtGalleriaLocationEntity.FLD_NAME_ArtGalleriaLocationID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDArtGalleriaLocationEntityList = FCCMDArtGalleriaLocation.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDArtGalleriaLocationEntityList ?? new List <MDArtGalleriaLocationEntity>());
        }
        private void SaveMDArtGalleriaLocationEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDArtGalleriaLocationEntity mDArtGalleriaLocationEntity = BuildMDArtGalleriaLocationEntity();

                    Int64 result = -1;

                    if (mDArtGalleriaLocationEntity.IsNew)
                    {
                        result = FCCMDArtGalleriaLocation.GetFacadeCreate().Add(mDArtGalleriaLocationEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDArtGalleriaLocationEntity.FLD_NAME_ArtGalleriaLocationID, mDArtGalleriaLocationEntity.ArtGalleriaLocationID.ToString(), SQLMatchType.Equal);
                        result = FCCMDArtGalleriaLocation.GetFacadeCreate().Update(mDArtGalleriaLocationEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ArtGalleriaLocationID       = 0;
                        _MDArtGalleriaLocationEntity = new MDArtGalleriaLocationEntity();
                        PrepareInitialView();
                        BindMDArtGalleriaLocationList();

                        if (mDArtGalleriaLocationEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Art Galleria Location Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Art Galleria Location Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDArtGalleriaLocationEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Art Galleria Location Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Art Galleria Location Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvMDArtGalleriaLocation_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 ArtGalleriaLocationID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDArtGalleriaLocationEntity.FLD_NAME_ArtGalleriaLocationID, ArtGalleriaLocationID.ToString(), SQLMatchType.Equal);

                        MDArtGalleriaLocationEntity mDArtGalleriaLocationEntity = new MDArtGalleriaLocationEntity();


                        result = FCCMDArtGalleriaLocation.GetFacadeCreate().Delete(mDArtGalleriaLocationEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _ArtGalleriaLocationID       = 0;
                            _MDArtGalleriaLocationEntity = new MDArtGalleriaLocationEntity();
                            PrepareInitialView();
                            BindMDArtGalleriaLocationList();

                            MiscUtil.ShowMessage(lblMessage, "Art Galleria Location has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Art Galleria Location.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <MDArtGalleriaLocationEntity> GetData()
        {
            IList <MDArtGalleriaLocationEntity> mDArtGalleriaLocationEntityList = new List <MDArtGalleriaLocationEntity>();

            try
            {
                mDArtGalleriaLocationEntityList = FCCMDArtGalleriaLocation.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDArtGalleriaLocationEntityList ?? new List <MDArtGalleriaLocationEntity>());
        }