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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDZoneDesignationEntity.FLD_NAME_ZoneDesignationID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDZoneDesignationEntityList = FCCMDZoneDesignation.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDZoneDesignationEntityList ?? new List <MDZoneDesignationEntity>());
        }
        private void SaveMDZoneDesignationEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDZoneDesignationEntity mDZoneDesignationEntity = BuildMDZoneDesignationEntity();

                    Int64 result = -1;

                    if (mDZoneDesignationEntity.IsNew)
                    {
                        result = FCCMDZoneDesignation.GetFacadeCreate().Add(mDZoneDesignationEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDZoneDesignationEntity.FLD_NAME_ZoneDesignationID, mDZoneDesignationEntity.ZoneDesignationID.ToString(), SQLMatchType.Equal);
                        result = FCCMDZoneDesignation.GetFacadeCreate().Update(mDZoneDesignationEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ZoneDesignationID       = 0;
                        _MDZoneDesignationEntity = new MDZoneDesignationEntity();
                        PrepareInitialView();
                        BindMDZoneDesignationList();

                        if (mDZoneDesignationEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Zone Designation Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Zone Designation Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDZoneDesignationEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Zone Designation Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Zone Designation Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvMDZoneDesignation_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 ZoneDesignationID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDZoneDesignationEntity.FLD_NAME_ZoneDesignationID, ZoneDesignationID.ToString(), SQLMatchType.Equal);

                        MDZoneDesignationEntity mDZoneDesignationEntity = new MDZoneDesignationEntity();


                        result = FCCMDZoneDesignation.GetFacadeCreate().Delete(mDZoneDesignationEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _ZoneDesignationID       = 0;
                            _MDZoneDesignationEntity = new MDZoneDesignationEntity();
                            PrepareInitialView();
                            BindMDZoneDesignationList();

                            MiscUtil.ShowMessage(lblMessage, "Zone Designation has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Zone Designation.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <MDZoneDesignationEntity> GetData()
        {
            IList <MDZoneDesignationEntity> mDZoneDesignationEntityList = new List <MDZoneDesignationEntity>();

            try
            {
                mDZoneDesignationEntityList = FCCMDZoneDesignation.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDZoneDesignationEntityList ?? new List <MDZoneDesignationEntity>());
        }