Beispiel #1
0
        public IList <MDEventLocationCategoryEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <MDEventLocationCategoryEntity> mDEventLocationCategoryEntityList = new List <MDEventLocationCategoryEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDEventLocationCategoryEntity.FLD_NAME_EventLocationCategoryID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDEventLocationCategoryEntityList = FCCMDEventLocationCategory.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDEventLocationCategoryEntityList ?? new List <MDEventLocationCategoryEntity>());
        }
        private void SaveMDEventLocationCategoryEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDEventLocationCategoryEntity mDEventLocationCategoryEntity = BuildMDEventLocationCategoryEntity();

                    Int64 result = -1;

                    if (mDEventLocationCategoryEntity.IsNew)
                    {
                        result = FCCMDEventLocationCategory.GetFacadeCreate().Add(mDEventLocationCategoryEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDEventLocationCategoryEntity.FLD_NAME_EventLocationCategoryID, mDEventLocationCategoryEntity.EventLocationCategoryID.ToString(), SQLMatchType.Equal);
                        result = FCCMDEventLocationCategory.GetFacadeCreate().Update(mDEventLocationCategoryEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _EventLocationCategoryID       = 0;
                        _MDEventLocationCategoryEntity = new MDEventLocationCategoryEntity();
                        PrepareInitialView();
                        BindMDEventLocationCategoryList();

                        if (mDEventLocationCategoryEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Event Location Category Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Event Location Category Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDEventLocationCategoryEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Event Location Category Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Event Location Category Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvMDEventLocationCategory_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 EventLocationCategoryID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDEventLocationCategoryEntity.FLD_NAME_EventLocationCategoryID, EventLocationCategoryID.ToString(), SQLMatchType.Equal);

                        MDEventLocationCategoryEntity mDEventLocationCategoryEntity = new MDEventLocationCategoryEntity();


                        result = FCCMDEventLocationCategory.GetFacadeCreate().Delete(mDEventLocationCategoryEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _EventLocationCategoryID       = 0;
                            _MDEventLocationCategoryEntity = new MDEventLocationCategoryEntity();
                            PrepareInitialView();
                            BindMDEventLocationCategoryList();

                            MiscUtil.ShowMessage(lblMessage, "Event Location Category has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Event Location Category.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Beispiel #4
0
        public IList <MDEventLocationCategoryEntity> GetData()
        {
            IList <MDEventLocationCategoryEntity> mDEventLocationCategoryEntityList = new List <MDEventLocationCategoryEntity>();

            try
            {
                mDEventLocationCategoryEntityList = FCCMDEventLocationCategory.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDEventLocationCategoryEntityList ?? new List <MDEventLocationCategoryEntity>());
        }