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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = CRMLandOwnerEntity.FLD_NAME_LandOwnerID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                cRMLandOwnerEntityList = FCCCRMLandOwner.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(cRMLandOwnerEntityList ?? new List <CRMLandOwnerEntity>());
        }
        private void SaveCRMLandOwnerEntity()
        {
            if (IsValid)
            {
                try
                {
                    CRMLandOwnerEntity cRMLandOwnerEntity = BuildCRMLandOwnerEntity();

                    Int64 result = -1;

                    if (cRMLandOwnerEntity.IsNew)
                    {
                        result = FCCCRMLandOwner.GetFacadeCreate().Add(cRMLandOwnerEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CRMLandOwnerEntity.FLD_NAME_LandOwnerID, cRMLandOwnerEntity.LandOwnerID.ToString(), SQLMatchType.Equal);
                        result = FCCCRMLandOwner.GetFacadeCreate().Update(cRMLandOwnerEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _LandOwnerID        = 0;
                        _CRMLandOwnerEntity = new CRMLandOwnerEntity();
                        PrepareInitialView();
                        BindCRMLandOwnerList();

                        if (cRMLandOwnerEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Landowner Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Landowner Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (cRMLandOwnerEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Landowner Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Landowner Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvCRMLandOwner_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 LandOwnerID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(CRMLandOwnerEntity.FLD_NAME_LandOwnerID, LandOwnerID.ToString(), SQLMatchType.Equal);

                        CRMLandOwnerEntity cRMLandOwnerEntity = new CRMLandOwnerEntity();


                        result = FCCCRMLandOwner.GetFacadeCreate().Delete(cRMLandOwnerEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _LandOwnerID        = 0;
                            _CRMLandOwnerEntity = new CRMLandOwnerEntity();
                            PrepareInitialView();
                            BindCRMLandOwnerList();

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

            try
            {
                cRMLandOwnerEntityList = FCCCRMLandOwner.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(cRMLandOwnerEntityList ?? new List <CRMLandOwnerEntity>());
        }