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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDEmployeeContactTypeEntity.FLD_NAME_EmployeeContactTypeID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDEmployeeContactTypeEntityList = FCCMDEmployeeContactType.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDEmployeeContactTypeEntityList ?? new List <MDEmployeeContactTypeEntity>());
        }
        private void SaveMDEmployeeContactTypeEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDEmployeeContactTypeEntity mDEmployeeContactTypeEntity = BuildMDEmployeeContactTypeEntity();

                    Int64 result = -1;

                    if (mDEmployeeContactTypeEntity.IsNew)
                    {
                        result = FCCMDEmployeeContactType.GetFacadeCreate().Add(mDEmployeeContactTypeEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDEmployeeContactTypeEntity.FLD_NAME_EmployeeContactTypeID, mDEmployeeContactTypeEntity.EmployeeContactTypeID.ToString(), SQLMatchType.Equal);
                        result = FCCMDEmployeeContactType.GetFacadeCreate().Update(mDEmployeeContactTypeEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _EmployeeContactTypeID       = 0;
                        _MDEmployeeContactTypeEntity = new MDEmployeeContactTypeEntity();
                        PrepareInitialView();
                        BindMDEmployeeContactTypeList();

                        if (mDEmployeeContactTypeEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Employee Contact Type Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Employee Contact Type Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDEmployeeContactTypeEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Employee Contact Type Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Employee Contact Type Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvMDEmployeeContactType_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 EmployeeContactTypeID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDEmployeeContactTypeEntity.FLD_NAME_EmployeeContactTypeID, EmployeeContactTypeID.ToString(), SQLMatchType.Equal);

                        MDEmployeeContactTypeEntity mDEmployeeContactTypeEntity = new MDEmployeeContactTypeEntity();


                        result = FCCMDEmployeeContactType.GetFacadeCreate().Delete(mDEmployeeContactTypeEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _EmployeeContactTypeID       = 0;
                            _MDEmployeeContactTypeEntity = new MDEmployeeContactTypeEntity();
                            PrepareInitialView();
                            BindMDEmployeeContactTypeList();

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

            try
            {
                mDEmployeeContactTypeEntityList = FCCMDEmployeeContactType.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDEmployeeContactTypeEntityList ?? new List <MDEmployeeContactTypeEntity>());
        }