예제 #1
0
        public IList <MDMemberTypeEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <MDMemberTypeEntity> mDMemberTypeEntityList = new List <MDMemberTypeEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDMemberTypeEntity.FLD_NAME_MemberTypeID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDMemberTypeEntityList = FCCMDMemberType.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDMemberTypeEntityList ?? new List <MDMemberTypeEntity>());
        }
예제 #2
0
        private void SaveMDMemberTypeEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDMemberTypeEntity mDMemberTypeEntity = BuildMDMemberTypeEntity();

                    Int64 result = -1;

                    if (mDMemberTypeEntity.IsNew)
                    {
                        result = FCCMDMemberType.GetFacadeCreate().Add(mDMemberTypeEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDMemberTypeEntity.FLD_NAME_MemberTypeID, mDMemberTypeEntity.MemberTypeID.ToString(), SQLMatchType.Equal);
                        result = FCCMDMemberType.GetFacadeCreate().Update(mDMemberTypeEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _MemberTypeID       = 0;
                        _MDMemberTypeEntity = new MDMemberTypeEntity();
                        PrepareInitialView();
                        BindMDMemberTypeList();

                        if (mDMemberTypeEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Member Type Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Member Type Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDMemberTypeEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Member Type Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Member Type Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
예제 #3
0
        protected void lvMDMemberType_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 MemberTypeID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDMemberTypeEntity.FLD_NAME_MemberTypeID, MemberTypeID.ToString(), SQLMatchType.Equal);

                        MDMemberTypeEntity mDMemberTypeEntity = new MDMemberTypeEntity();


                        result = FCCMDMemberType.GetFacadeCreate().Delete(mDMemberTypeEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _MemberTypeID       = 0;
                            _MDMemberTypeEntity = new MDMemberTypeEntity();
                            PrepareInitialView();
                            BindMDMemberTypeList();

                            MiscUtil.ShowMessage(lblMessage, "Member Type has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Member Type.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
예제 #4
0
        public IList <MDMemberTypeEntity> GetData()
        {
            IList <MDMemberTypeEntity> mDMemberTypeEntityList = new List <MDMemberTypeEntity>();

            try
            {
                mDMemberTypeEntityList = FCCMDMemberType.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDMemberTypeEntityList ?? new List <MDMemberTypeEntity>());
        }