コード例 #1
0
        public IList <MDApprovalProcessStatusEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <MDApprovalProcessStatusEntity> mDApprovalProcessStatusEntityList = new List <MDApprovalProcessStatusEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDApprovalProcessStatusEntity.FLD_NAME_ApprovalProcessStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDApprovalProcessStatusEntityList = FCCMDApprovalProcessStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDApprovalProcessStatusEntityList ?? new List <MDApprovalProcessStatusEntity>());
        }
コード例 #2
0
        private void SaveMDApprovalProcessStatusEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDApprovalProcessStatusEntity mDApprovalProcessStatusEntity = BuildMDApprovalProcessStatusEntity();

                    Int64 result = -1;

                    if (mDApprovalProcessStatusEntity.IsNew)
                    {
                        result = FCCMDApprovalProcessStatus.GetFacadeCreate().Add(mDApprovalProcessStatusEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDApprovalProcessStatusEntity.FLD_NAME_ApprovalProcessStatusID, mDApprovalProcessStatusEntity.ApprovalProcessStatusID.ToString(), SQLMatchType.Equal);
                        result = FCCMDApprovalProcessStatus.GetFacadeCreate().Update(mDApprovalProcessStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ApprovalProcessStatusID       = 0;
                        _MDApprovalProcessStatusEntity = new MDApprovalProcessStatusEntity();
                        PrepareInitialView();
                        BindMDApprovalProcessStatusList();

                        if (mDApprovalProcessStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Approval Process Status Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Approval Process Status Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDApprovalProcessStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Approval Process Status Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Approval Process Status Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
コード例 #3
0
        protected void lvMDApprovalProcessStatus_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 ApprovalProcessStatusID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDApprovalProcessStatusEntity.FLD_NAME_ApprovalProcessStatusID, ApprovalProcessStatusID.ToString(), SQLMatchType.Equal);

                        MDApprovalProcessStatusEntity mDApprovalProcessStatusEntity = new MDApprovalProcessStatusEntity();


                        result = FCCMDApprovalProcessStatus.GetFacadeCreate().Delete(mDApprovalProcessStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _ApprovalProcessStatusID       = 0;
                            _MDApprovalProcessStatusEntity = new MDApprovalProcessStatusEntity();
                            PrepareInitialView();
                            BindMDApprovalProcessStatusList();

                            MiscUtil.ShowMessage(lblMessage, "Approval Process Status has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Approval Process Status.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
コード例 #4
0
        public IList <MDApprovalProcessStatusEntity> GetData()
        {
            IList <MDApprovalProcessStatusEntity> mDApprovalProcessStatusEntityList = new List <MDApprovalProcessStatusEntity>();

            try
            {
                mDApprovalProcessStatusEntityList = FCCMDApprovalProcessStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDApprovalProcessStatusEntityList ?? new List <MDApprovalProcessStatusEntity>());
        }