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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDIssueStatusEntity.FLD_NAME_IssueStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDIssueStatusEntityList = FCCMDIssueStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDIssueStatusEntityList ?? new List <MDIssueStatusEntity>());
        }
コード例 #2
0
        private void SaveMDIssueStatusEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDIssueStatusEntity mDIssueStatusEntity = BuildMDIssueStatusEntity();

                    Int64 result = -1;

                    if (mDIssueStatusEntity.IsNew)
                    {
                        result = FCCMDIssueStatus.GetFacadeCreate().Add(mDIssueStatusEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDIssueStatusEntity.FLD_NAME_IssueStatusID, mDIssueStatusEntity.IssueStatusID.ToString(), SQLMatchType.Equal);
                        result = FCCMDIssueStatus.GetFacadeCreate().Update(mDIssueStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _IssueStatusID       = 0;
                        _MDIssueStatusEntity = new MDIssueStatusEntity();
                        PrepareInitialView();
                        BindMDIssueStatusList();

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

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDIssueStatusEntity.FLD_NAME_IssueStatusID, IssueStatusID.ToString(), SQLMatchType.Equal);

                        MDIssueStatusEntity mDIssueStatusEntity = new MDIssueStatusEntity();


                        result = FCCMDIssueStatus.GetFacadeCreate().Delete(mDIssueStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _IssueStatusID       = 0;
                            _MDIssueStatusEntity = new MDIssueStatusEntity();
                            PrepareInitialView();
                            BindMDIssueStatusList();

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

            try
            {
                mDIssueStatusEntityList = FCCMDIssueStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDIssueStatusEntityList ?? new List <MDIssueStatusEntity>());
        }