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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = CRMPaymentCollectionEntity.FLD_NAME_PaymentCollectionID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                cRMPaymentCollectionEntityList = FCCCRMPaymentCollection.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(cRMPaymentCollectionEntityList ?? new List <CRMPaymentCollectionEntity>());
        }
        public IList <CRMPaymentCollectionEntity> GetData()
        {
            IList <CRMPaymentCollectionEntity> cRMPaymentCollectionEntityList = new List <CRMPaymentCollectionEntity>();

            try
            {
                cRMPaymentCollectionEntityList = FCCCRMPaymentCollection.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(cRMPaymentCollectionEntityList ?? new List <CRMPaymentCollectionEntity>());
        }
예제 #3
0
        protected void lvCRMPaymentCollection_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 PaymentCollectionID;

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

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

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(CRMPaymentCollectionEntity.FLD_NAME_PaymentCollectionID, PaymentCollectionID.ToString(), SQLMatchType.Equal);

                        CRMPaymentCollectionEntity cRMPaymentCollectionEntity = new CRMPaymentCollectionEntity();


                        result = FCCCRMPaymentCollection.GetFacadeCreate().Delete(cRMPaymentCollectionEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _PaymentCollectionID        = 0;
                            _CRMPaymentCollectionEntity = new CRMPaymentCollectionEntity();
                            PrepareInitialView();
                            BindCRMPaymentCollectionList();

                            MiscUtil.ShowMessage(lblMessage, "C RMPayment Collection has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete C RMPayment Collection.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
                else if (string.Equals(e.CommandName, "UpdateItem"))
                {
                    try
                    {
                        Int64 result = -1;

                        CRMPaymentCollectionEntity cRMPaymentCollectionEntity = FCCCRMPaymentCollection.GetFacadeCreate().GetByID(PaymentCollectionID);
                        String fe = SqlExpressionBuilder.PrepareFilterExpression(CRMPaymentCollectionEntity.FLD_NAME_PaymentCollectionID, PaymentCollectionID.ToString(), SQLMatchType.Equal);

                        cRMPaymentCollectionEntity.ChequeInCashConfirmation = true;

                        result = FCCCRMPaymentCollection.GetFacadeCreate().Update(cRMPaymentCollectionEntity, fe, DatabaseOperationType.Update, TransactionRequired.No);

                        if (result > 0)
                        {
                            _PaymentCollectionID        = 0;
                            _CRMPaymentCollectionEntity = new CRMPaymentCollectionEntity();
                            PrepareInitialView();
                            BindCRMPaymentCollectionList();

                            MiscUtil.ShowMessage(lblMessage, "Payment Collection has been successfully updated.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Payment Collection.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }