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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = BDMDProcessCategoryEntity.FLD_NAME_ProcessCategoryID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                bDMDProcessCategoryEntityList = FCCBDMDProcessCategory.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(bDMDProcessCategoryEntityList ?? new List <BDMDProcessCategoryEntity>());
        }
コード例 #2
0
        private void SaveBDMDProcessCategoryEntity()
        {
            if (IsValid)
            {
                try
                {
                    BDMDProcessCategoryEntity bDMDProcessCategoryEntity = BuildBDMDProcessCategoryEntity();

                    Int64 result = -1;

                    if (bDMDProcessCategoryEntity.IsNew)
                    {
                        result = FCCBDMDProcessCategory.GetFacadeCreate().Add(bDMDProcessCategoryEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(BDMDProcessCategoryEntity.FLD_NAME_ProcessCategoryID, bDMDProcessCategoryEntity.ProcessCategoryID.ToString(), SQLMatchType.Equal);
                        result = FCCBDMDProcessCategory.GetFacadeCreate().Update(bDMDProcessCategoryEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ProcessCategoryID         = 0;
                        _BDMDProcessCategoryEntity = new BDMDProcessCategoryEntity();
                        PrepareInitialView();
                        BindBDMDProcessCategoryList();

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

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

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

                    PrepareEditView();
                }

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(BDMDProcessCategoryEntity.FLD_NAME_ProcessCategoryID, ProcessCategoryID.ToString(), SQLMatchType.Equal);

                        BDMDProcessCategoryEntity bDMDProcessCategoryEntity = new BDMDProcessCategoryEntity();

                        result = FCCBDMDProcessCategory.GetFacadeCreate().Delete(bDMDProcessCategoryEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _ProcessCategoryID         = 0;
                            _BDMDProcessCategoryEntity = new BDMDProcessCategoryEntity();
                            PrepareInitialView();
                            BindBDMDProcessCategoryList();

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

            try
            {
                bDMDProcessCategoryEntityList = FCCBDMDProcessCategory.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(bDMDProcessCategoryEntityList ?? new List <BDMDProcessCategoryEntity>());
        }