Ejemplo n.º 1
0
        public IList <MDIssueCategoryEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <MDIssueCategoryEntity> mDIssueCategoryEntityList = new List <MDIssueCategoryEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDIssueCategoryEntity.FLD_NAME_IssueCategoryID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDIssueCategoryEntityList = FCCMDIssueCategory.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDIssueCategoryEntityList ?? new List <MDIssueCategoryEntity>());
        }
Ejemplo n.º 2
0
        private void SaveMDIssueCategoryEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDIssueCategoryEntity mDIssueCategoryEntity = BuildMDIssueCategoryEntity();

                    Int64 result = -1;

                    if (mDIssueCategoryEntity.IsNew)
                    {
                        result = FCCMDIssueCategory.GetFacadeCreate().Add(mDIssueCategoryEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDIssueCategoryEntity.FLD_NAME_IssueCategoryID, mDIssueCategoryEntity.IssueCategoryID.ToString(), SQLMatchType.Equal);
                        result = FCCMDIssueCategory.GetFacadeCreate().Update(mDIssueCategoryEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _IssueCategoryID       = 0;
                        _MDIssueCategoryEntity = new MDIssueCategoryEntity();
                        PrepareInitialView();
                        BindMDIssueCategoryList();

                        if (mDIssueCategoryEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Issue Category Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Issue Category Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDIssueCategoryEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Issue Category Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Issue Category Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Ejemplo n.º 3
0
        protected void lvMDIssueCategory_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 IssueCategoryID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDIssueCategoryEntity.FLD_NAME_IssueCategoryID, IssueCategoryID.ToString(), SQLMatchType.Equal);

                        MDIssueCategoryEntity mDIssueCategoryEntity = new MDIssueCategoryEntity();


                        result = FCCMDIssueCategory.GetFacadeCreate().Delete(mDIssueCategoryEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _IssueCategoryID       = 0;
                            _MDIssueCategoryEntity = new MDIssueCategoryEntity();
                            PrepareInitialView();
                            BindMDIssueCategoryList();

                            MiscUtil.ShowMessage(lblMessage, "Issue Category has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Issue Category.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public IList <MDIssueCategoryEntity> GetData()
        {
            IList <MDIssueCategoryEntity> mDIssueCategoryEntityList = new List <MDIssueCategoryEntity>();

            try
            {
                mDIssueCategoryEntityList = FCCMDIssueCategory.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDIssueCategoryEntityList ?? new List <MDIssueCategoryEntity>());
        }