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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDHolidayAppliedStatusEntity.FLD_NAME_HolidayAppliedStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDHolidayAppliedStatusEntityList = FCCMDHolidayAppliedStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDHolidayAppliedStatusEntityList ?? new List <MDHolidayAppliedStatusEntity>());
        }
        private void SaveMDHolidayAppliedStatusEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDHolidayAppliedStatusEntity mDHolidayAppliedStatusEntity = BuildMDHolidayAppliedStatusEntity();

                    Int64 result = -1;

                    if (mDHolidayAppliedStatusEntity.IsNew)
                    {
                        result = FCCMDHolidayAppliedStatus.GetFacadeCreate().Add(mDHolidayAppliedStatusEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDHolidayAppliedStatusEntity.FLD_NAME_HolidayAppliedStatusID, mDHolidayAppliedStatusEntity.HolidayAppliedStatusID.ToString(), SQLMatchType.Equal);
                        result = FCCMDHolidayAppliedStatus.GetFacadeCreate().Update(mDHolidayAppliedStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _HolidayAppliedStatusID       = 0;
                        _MDHolidayAppliedStatusEntity = new MDHolidayAppliedStatusEntity();
                        PrepareInitialView();
                        BindMDHolidayAppliedStatusList();

                        if (mDHolidayAppliedStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Holiday Applied Status Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Holiday Applied Status Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDHolidayAppliedStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Holiday Applied Status Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Holiday Applied Status Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvMDHolidayAppliedStatus_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 HolidayAppliedStatusID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDHolidayAppliedStatusEntity.FLD_NAME_HolidayAppliedStatusID, HolidayAppliedStatusID.ToString(), SQLMatchType.Equal);

                        MDHolidayAppliedStatusEntity mDHolidayAppliedStatusEntity = new MDHolidayAppliedStatusEntity();


                        result = FCCMDHolidayAppliedStatus.GetFacadeCreate().Delete(mDHolidayAppliedStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _HolidayAppliedStatusID       = 0;
                            _MDHolidayAppliedStatusEntity = new MDHolidayAppliedStatusEntity();
                            PrepareInitialView();
                            BindMDHolidayAppliedStatusList();

                            MiscUtil.ShowMessage(lblMessage, "Holiday Applied Status has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Holiday Applied Status.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <MDHolidayAppliedStatusEntity> GetData()
        {
            IList <MDHolidayAppliedStatusEntity> mDHolidayAppliedStatusEntityList = new List <MDHolidayAppliedStatusEntity>();

            try
            {
                mDHolidayAppliedStatusEntityList = FCCMDHolidayAppliedStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDHolidayAppliedStatusEntityList ?? new List <MDHolidayAppliedStatusEntity>());
        }