Example #1
0
        public IList <MDEvaluationSessionStatusEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <MDEvaluationSessionStatusEntity> mDEvaluationSessionStatusEntityList = new List <MDEvaluationSessionStatusEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDEvaluationSessionStatusEntity.FLD_NAME_EvaluationSessionStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDEvaluationSessionStatusEntityList = FCCMDEvaluationSessionStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDEvaluationSessionStatusEntityList ?? new List <MDEvaluationSessionStatusEntity>());
        }
Example #2
0
        private void SaveMDEvaluationSessionStatusEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDEvaluationSessionStatusEntity mDEvaluationSessionStatusEntity = BuildMDEvaluationSessionStatusEntity();

                    Int64 result = -1;

                    if (mDEvaluationSessionStatusEntity.IsNew)
                    {
                        result = FCCMDEvaluationSessionStatus.GetFacadeCreate().Add(mDEvaluationSessionStatusEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDEvaluationSessionStatusEntity.FLD_NAME_EvaluationSessionStatusID, mDEvaluationSessionStatusEntity.EvaluationSessionStatusID.ToString(), SQLMatchType.Equal);
                        result = FCCMDEvaluationSessionStatus.GetFacadeCreate().Update(mDEvaluationSessionStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _EvaluationSessionStatusID       = 0;
                        _MDEvaluationSessionStatusEntity = new MDEvaluationSessionStatusEntity();
                        PrepareInitialView();
                        BindMDEvaluationSessionStatusList();

                        if (mDEvaluationSessionStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Evaluation Session Status Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Evaluation Session Status Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDEvaluationSessionStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Evaluation Session Status Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Evaluation Session Status Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Example #3
0
        protected void lvMDEvaluationSessionStatus_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 EvaluationSessionStatusID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDEvaluationSessionStatusEntity.FLD_NAME_EvaluationSessionStatusID, EvaluationSessionStatusID.ToString(), SQLMatchType.Equal);

                        MDEvaluationSessionStatusEntity mDEvaluationSessionStatusEntity = new MDEvaluationSessionStatusEntity();


                        result = FCCMDEvaluationSessionStatus.GetFacadeCreate().Delete(mDEvaluationSessionStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _EvaluationSessionStatusID       = 0;
                            _MDEvaluationSessionStatusEntity = new MDEvaluationSessionStatusEntity();
                            PrepareInitialView();
                            BindMDEvaluationSessionStatusList();

                            MiscUtil.ShowMessage(lblMessage, "Evaluation Session Status has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Evaluation Session Status.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Example #4
0
        public IList <MDEvaluationSessionStatusEntity> GetData()
        {
            IList <MDEvaluationSessionStatusEntity> mDEvaluationSessionStatusEntityList = new List <MDEvaluationSessionStatusEntity>();

            try
            {
                mDEvaluationSessionStatusEntityList = FCCMDEvaluationSessionStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDEvaluationSessionStatusEntityList ?? new List <MDEvaluationSessionStatusEntity>());
        }