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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDFamilyRelationTypeEntity.FLD_NAME_FamilyRelationTypeID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDFamilyRelationTypeEntityList = FCCMDFamilyRelationType.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDFamilyRelationTypeEntityList ?? new List <MDFamilyRelationTypeEntity>());
        }
Esempio n. 2
0
        private void SaveMDFamilyRelationTypeEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDFamilyRelationTypeEntity mDFamilyRelationTypeEntity = BuildMDFamilyRelationTypeEntity();

                    Int64 result = -1;

                    if (mDFamilyRelationTypeEntity.IsNew)
                    {
                        result = FCCMDFamilyRelationType.GetFacadeCreate().Add(mDFamilyRelationTypeEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDFamilyRelationTypeEntity.FLD_NAME_FamilyRelationTypeID, mDFamilyRelationTypeEntity.FamilyRelationTypeID.ToString(), SQLMatchType.Equal);
                        result = FCCMDFamilyRelationType.GetFacadeCreate().Update(mDFamilyRelationTypeEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _FamilyRelationTypeID       = 0;
                        _MDFamilyRelationTypeEntity = new MDFamilyRelationTypeEntity();
                        PrepareInitialView();
                        BindMDFamilyRelationTypeList();

                        if (mDFamilyRelationTypeEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Family Relation Type Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Family Relation Type Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDFamilyRelationTypeEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Family Relation Type Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Family Relation Type Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Esempio n. 3
0
        protected void lvMDFamilyRelationType_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 FamilyRelationTypeID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDFamilyRelationTypeEntity.FLD_NAME_FamilyRelationTypeID, FamilyRelationTypeID.ToString(), SQLMatchType.Equal);

                        MDFamilyRelationTypeEntity mDFamilyRelationTypeEntity = new MDFamilyRelationTypeEntity();


                        result = FCCMDFamilyRelationType.GetFacadeCreate().Delete(mDFamilyRelationTypeEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _FamilyRelationTypeID       = 0;
                            _MDFamilyRelationTypeEntity = new MDFamilyRelationTypeEntity();
                            PrepareInitialView();
                            BindMDFamilyRelationTypeList();

                            MiscUtil.ShowMessage(lblMessage, "Family Relation Type has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Family Relation Type.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <MDFamilyRelationTypeEntity> GetData()
        {
            IList <MDFamilyRelationTypeEntity> mDFamilyRelationTypeEntityList = new List <MDFamilyRelationTypeEntity>();

            try
            {
                mDFamilyRelationTypeEntityList = FCCMDFamilyRelationType.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDFamilyRelationTypeEntityList ?? new List <MDFamilyRelationTypeEntity>());
        }