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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = CRMCustomerAddressInfoEntity.FLD_NAME_CustomerAddressInfoID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                cRMCustomerAddressInfoEntityList = FCCCRMCustomerAddressInfo.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(cRMCustomerAddressInfoEntityList ?? new List <CRMCustomerAddressInfoEntity>());
        }
Exemplo n.º 2
0
        private void SaveCRMCustomerAddressInfoEntity()
        {
            if (IsValid)
            {
                try
                {
                    CRMCustomerAddressInfoEntity cRMCustomerAddressInfoEntity = BuildCRMCustomerAddressInfoEntity();

                    Int64 result = -1;

                    if (cRMCustomerAddressInfoEntity.IsNew)
                    {
                        result = FCCCRMCustomerAddressInfo.GetFacadeCreate().Add(cRMCustomerAddressInfoEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CRMCustomerAddressInfoEntity.FLD_NAME_CustomerAddressInfoID, cRMCustomerAddressInfoEntity.CustomerAddressInfoID.ToString(), SQLMatchType.Equal);
                        result = FCCCRMCustomerAddressInfo.GetFacadeCreate().Update(cRMCustomerAddressInfoEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _CustomerAddressInfoID        = 0;
                        _CRMCustomerAddressInfoEntity = new CRMCustomerAddressInfoEntity();
                        PrepareInitialView();
                        BindCRMCustomerAddressInfoList();

                        if (cRMCustomerAddressInfoEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "C RMCustomer Address Info Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "C RMCustomer Address Info Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (cRMCustomerAddressInfoEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add C RMCustomer Address Info Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update C RMCustomer Address Info Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Exemplo n.º 3
0
        protected void lvCRMCustomerAddressInfo_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 CustomerAddressInfoID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(CRMCustomerAddressInfoEntity.FLD_NAME_CustomerAddressInfoID, CustomerAddressInfoID.ToString(), SQLMatchType.Equal);

                        CRMCustomerAddressInfoEntity cRMCustomerAddressInfoEntity = new CRMCustomerAddressInfoEntity();


                        result = FCCCRMCustomerAddressInfo.GetFacadeCreate().Delete(cRMCustomerAddressInfoEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _CustomerAddressInfoID        = 0;
                            _CRMCustomerAddressInfoEntity = new CRMCustomerAddressInfoEntity();
                            PrepareInitialView();
                            BindCRMCustomerAddressInfoList();

                            MiscUtil.ShowMessage(lblMessage, "C RMCustomer Address Info has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete C RMCustomer Address Info.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Exemplo n.º 4
0
        public IList <CRMCustomerAddressInfoEntity> GetData()
        {
            IList <CRMCustomerAddressInfoEntity> cRMCustomerAddressInfoEntityList = new List <CRMCustomerAddressInfoEntity>();

            try
            {
                cRMCustomerAddressInfoEntityList = FCCCRMCustomerAddressInfo.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(cRMCustomerAddressInfoEntityList ?? new List <CRMCustomerAddressInfoEntity>());
        }