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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDContractorCriterionStatusEntity.FLD_NAME_ContractorCriterionStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDContractorCriterionStatusEntityList = FCCMDContractorCriterionStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDContractorCriterionStatusEntityList ?? new List <MDContractorCriterionStatusEntity>());
        }
Example #2
0
        private void SaveMDContractorCriterionStatusEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDContractorCriterionStatusEntity mDContractorCriterionStatusEntity = BuildMDContractorCriterionStatusEntity();

                    Int64 result = -1;

                    if (mDContractorCriterionStatusEntity.IsNew)
                    {
                        result = FCCMDContractorCriterionStatus.GetFacadeCreate().Add(mDContractorCriterionStatusEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDContractorCriterionStatusEntity.FLD_NAME_ContractorCriterionStatusID, mDContractorCriterionStatusEntity.ContractorCriterionStatusID.ToString(), SQLMatchType.Equal);
                        result = FCCMDContractorCriterionStatus.GetFacadeCreate().Update(mDContractorCriterionStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ContractorCriterionStatusID       = 0;
                        _MDContractorCriterionStatusEntity = new MDContractorCriterionStatusEntity();
                        PrepareInitialView();
                        BindMDContractorCriterionStatusList();

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

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDContractorCriterionStatusEntity.FLD_NAME_ContractorCriterionStatusID, ContractorCriterionStatusID.ToString(), SQLMatchType.Equal);

                        MDContractorCriterionStatusEntity mDContractorCriterionStatusEntity = new MDContractorCriterionStatusEntity();


                        result = FCCMDContractorCriterionStatus.GetFacadeCreate().Delete(mDContractorCriterionStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _ContractorCriterionStatusID       = 0;
                            _MDContractorCriterionStatusEntity = new MDContractorCriterionStatusEntity();
                            PrepareInitialView();
                            BindMDContractorCriterionStatusList();

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

            try
            {
                mDContractorCriterionStatusEntityList = FCCMDContractorCriterionStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDContractorCriterionStatusEntityList ?? new List <MDContractorCriterionStatusEntity>());
        }