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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDEvaluationCriteriaCategoryEntity.FLD_NAME_EvaluationCriteriaCategoryID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDEvaluationCriteriaCategoryEntityList = FCCMDEvaluationCriteriaCategory.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDEvaluationCriteriaCategoryEntityList ?? new List <MDEvaluationCriteriaCategoryEntity>());
        }
Ejemplo n.º 2
0
        private void SaveMDEvaluationCriteriaCategoryEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDEvaluationCriteriaCategoryEntity mDEvaluationCriteriaCategoryEntity = BuildMDEvaluationCriteriaCategoryEntity();

                    Int64 result = -1;

                    if (mDEvaluationCriteriaCategoryEntity.IsNew)
                    {
                        result = FCCMDEvaluationCriteriaCategory.GetFacadeCreate().Add(mDEvaluationCriteriaCategoryEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDEvaluationCriteriaCategoryEntity.FLD_NAME_EvaluationCriteriaCategoryID, mDEvaluationCriteriaCategoryEntity.EvaluationCriteriaCategoryID.ToString(), SQLMatchType.Equal);
                        result = FCCMDEvaluationCriteriaCategory.GetFacadeCreate().Update(mDEvaluationCriteriaCategoryEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _EvaluationCriteriaCategoryID       = 0;
                        _MDEvaluationCriteriaCategoryEntity = new MDEvaluationCriteriaCategoryEntity();
                        PrepareInitialView();
                        BindMDEvaluationCriteriaCategoryList();

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

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDEvaluationCriteriaCategoryEntity.FLD_NAME_EvaluationCriteriaCategoryID, EvaluationCriteriaCategoryID.ToString(), SQLMatchType.Equal);

                        MDEvaluationCriteriaCategoryEntity mDEvaluationCriteriaCategoryEntity = new MDEvaluationCriteriaCategoryEntity();


                        result = FCCMDEvaluationCriteriaCategory.GetFacadeCreate().Delete(mDEvaluationCriteriaCategoryEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _EvaluationCriteriaCategoryID       = 0;
                            _MDEvaluationCriteriaCategoryEntity = new MDEvaluationCriteriaCategoryEntity();
                            PrepareInitialView();
                            BindMDEvaluationCriteriaCategoryList();

                            MiscUtil.ShowMessage(lblMessage, "Evaluation Criteria Category has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Evaluation Criteria Category.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <MDEvaluationCriteriaCategoryEntity> GetData()
        {
            IList <MDEvaluationCriteriaCategoryEntity> mDEvaluationCriteriaCategoryEntityList = new List <MDEvaluationCriteriaCategoryEntity>();

            try
            {
                mDEvaluationCriteriaCategoryEntityList = FCCMDEvaluationCriteriaCategory.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDEvaluationCriteriaCategoryEntityList ?? new List <MDEvaluationCriteriaCategoryEntity>());
        }