Exemplo n.º 1
0
        public IList <CRMMDAgreementApprovalStatusEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <CRMMDAgreementApprovalStatusEntity> cRMMDAgreementApprovalStatusEntityList = new List <CRMMDAgreementApprovalStatusEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = CRMMDAgreementApprovalStatusEntity.FLD_NAME_AgreementApprovalStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                cRMMDAgreementApprovalStatusEntityList = FCCCRMMDAgreementApprovalStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(cRMMDAgreementApprovalStatusEntityList ?? new List <CRMMDAgreementApprovalStatusEntity>());
        }
        private void SaveCRMMDAgreementApprovalStatusEntity()
        {
            if (IsValid)
            {
                try
                {
                    CRMMDAgreementApprovalStatusEntity cRMMDAgreementApprovalStatusEntity = BuildCRMMDAgreementApprovalStatusEntity();

                    Int64 result = -1;

                    if (cRMMDAgreementApprovalStatusEntity.IsNew)
                    {
                        result = FCCCRMMDAgreementApprovalStatus.GetFacadeCreate().Add(cRMMDAgreementApprovalStatusEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CRMMDAgreementApprovalStatusEntity.FLD_NAME_AgreementApprovalStatusID, cRMMDAgreementApprovalStatusEntity.AgreementApprovalStatusID.ToString(), SQLMatchType.Equal);
                        result = FCCCRMMDAgreementApprovalStatus.GetFacadeCreate().Update(cRMMDAgreementApprovalStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _AgreementApprovalStatusID          = 0;
                        _CRMMDAgreementApprovalStatusEntity = new CRMMDAgreementApprovalStatusEntity();
                        PrepareInitialView();
                        BindCRMMDAgreementApprovalStatusList();

                        if (cRMMDAgreementApprovalStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "C RMAgreement Approval Status Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "C RMAgreement Approval Status Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (cRMMDAgreementApprovalStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add C RMAgreement Approval Status Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update C RMAgreement Approval Status Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvCRMMDAgreementApprovalStatus_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 AgreementApprovalStatusID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(CRMMDAgreementApprovalStatusEntity.FLD_NAME_AgreementApprovalStatusID, AgreementApprovalStatusID.ToString(), SQLMatchType.Equal);

                        CRMMDAgreementApprovalStatusEntity cRMMDAgreementApprovalStatusEntity = new CRMMDAgreementApprovalStatusEntity();


                        result = FCCCRMMDAgreementApprovalStatus.GetFacadeCreate().Delete(cRMMDAgreementApprovalStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _AgreementApprovalStatusID          = 0;
                            _CRMMDAgreementApprovalStatusEntity = new CRMMDAgreementApprovalStatusEntity();
                            PrepareInitialView();
                            BindCRMMDAgreementApprovalStatusList();

                            MiscUtil.ShowMessage(lblMessage, "C RMAgreement Approval Status has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete C RMAgreement Approval Status.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Exemplo n.º 4
0
        public IList <CRMMDAgreementApprovalStatusEntity> GetData()
        {
            IList <CRMMDAgreementApprovalStatusEntity> cRMMDAgreementApprovalStatusEntityList = new List <CRMMDAgreementApprovalStatusEntity>();

            try
            {
                cRMMDAgreementApprovalStatusEntityList = FCCCRMMDAgreementApprovalStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(cRMMDAgreementApprovalStatusEntityList ?? new List <CRMMDAgreementApprovalStatusEntity>());
        }