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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = CMNApprovalProcessEntity.FLD_NAME_ApprovalProcessID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                cMNApprovalProcessEntityList = FCCCMNApprovalProcess.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(cMNApprovalProcessEntityList ?? new List <CMNApprovalProcessEntity>());
        }
        private void SaveCMNApprovalProcessEntity()
        {
            if (IsValid)
            {
                try
                {
                    CMNApprovalProcessEntity cMNApprovalProcessEntity = BuildCMNApprovalProcessEntity();

                    Int64 result = -1;

                    if (cMNApprovalProcessEntity.IsNew)
                    {
                        result = FCCCMNApprovalProcess.GetFacadeCreate().Add(cMNApprovalProcessEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CMNApprovalProcessEntity.FLD_NAME_ApprovalProcessID, cMNApprovalProcessEntity.ApprovalProcessID.ToString(), SQLMatchType.Equal);
                        result = FCCCMNApprovalProcess.GetFacadeCreate().Update(cMNApprovalProcessEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ApprovalProcessID        = 0;
                        _CMNApprovalProcessEntity = new CMNApprovalProcessEntity();
                        PrepareInitialView();
                        BindCMNApprovalProcessList();

                        if (cMNApprovalProcessEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "C MNApproval Process Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "C MNApproval Process Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (cMNApprovalProcessEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add C MNApproval Process Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update C MNApproval Process Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvCMNApprovalProcess_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 ApprovalProcessID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(CMNApprovalProcessEntity.FLD_NAME_ApprovalProcessID, ApprovalProcessID.ToString(), SQLMatchType.Equal);

                        CMNApprovalProcessEntity cMNApprovalProcessEntity = new CMNApprovalProcessEntity();


                        result = FCCCMNApprovalProcess.GetFacadeCreate().Delete(cMNApprovalProcessEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _ApprovalProcessID        = 0;
                            _CMNApprovalProcessEntity = new CMNApprovalProcessEntity();
                            PrepareInitialView();
                            BindCMNApprovalProcessList();

                            MiscUtil.ShowMessage(lblMessage, "C MNApproval Process has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete C MNApproval Process.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <CMNApprovalProcessEntity> GetData()
        {
            IList <CMNApprovalProcessEntity> cMNApprovalProcessEntityList = new List <CMNApprovalProcessEntity>();

            try
            {
                cMNApprovalProcessEntityList = FCCCMNApprovalProcess.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(cMNApprovalProcessEntityList ?? new List <CMNApprovalProcessEntity>());
        }