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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDLeaveApplicationApplicationStatusEntity.FLD_NAME_LeaveApplicationApplicationStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDLeaveApplicationApplicationStatusEntityList = FCCMDLeaveApplicationApplicationStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDLeaveApplicationApplicationStatusEntityList ?? new List <MDLeaveApplicationApplicationStatusEntity>());
        }
Beispiel #2
0
        private void SaveMDLeaveApplicationApplicationStatusEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDLeaveApplicationApplicationStatusEntity mDLeaveApplicationApplicationStatusEntity = BuildMDLeaveApplicationApplicationStatusEntity();

                    Int64 result = -1;

                    if (mDLeaveApplicationApplicationStatusEntity.IsNew)
                    {
                        result = FCCMDLeaveApplicationApplicationStatus.GetFacadeCreate().Add(mDLeaveApplicationApplicationStatusEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDLeaveApplicationApplicationStatusEntity.FLD_NAME_LeaveApplicationApplicationStatusID, mDLeaveApplicationApplicationStatusEntity.LeaveApplicationApplicationStatusID.ToString(), SQLMatchType.Equal);
                        result = FCCMDLeaveApplicationApplicationStatus.GetFacadeCreate().Update(mDLeaveApplicationApplicationStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _LeaveApplicationApplicationStatusID       = 0;
                        _MDLeaveApplicationApplicationStatusEntity = new MDLeaveApplicationApplicationStatusEntity();
                        PrepareInitialView();
                        BindMDLeaveApplicationApplicationStatusList();

                        if (mDLeaveApplicationApplicationStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Leave Application Application Status Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Leave Application Application Status Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDLeaveApplicationApplicationStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Leave Application Application Status Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Leave Application Application Status Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Beispiel #3
0
        protected void lvMDLeaveApplicationApplicationStatus_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 LeaveApplicationApplicationStatusID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDLeaveApplicationApplicationStatusEntity.FLD_NAME_LeaveApplicationApplicationStatusID, LeaveApplicationApplicationStatusID.ToString(), SQLMatchType.Equal);

                        MDLeaveApplicationApplicationStatusEntity mDLeaveApplicationApplicationStatusEntity = new MDLeaveApplicationApplicationStatusEntity();


                        result = FCCMDLeaveApplicationApplicationStatus.GetFacadeCreate().Delete(mDLeaveApplicationApplicationStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _LeaveApplicationApplicationStatusID       = 0;
                            _MDLeaveApplicationApplicationStatusEntity = new MDLeaveApplicationApplicationStatusEntity();
                            PrepareInitialView();
                            BindMDLeaveApplicationApplicationStatusList();

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

            try
            {
                mDLeaveApplicationApplicationStatusEntityList = FCCMDLeaveApplicationApplicationStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDLeaveApplicationApplicationStatusEntityList ?? new List <MDLeaveApplicationApplicationStatusEntity>());
        }