Beispiel #1
0
        public IList <CRMLandBasicInfoEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <CRMLandBasicInfoEntity> cRMLandBasicInfoEntityList = new List <CRMLandBasicInfoEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = CRMLandBasicInfoEntity.FLD_NAME_LandBasicInfoID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                cRMLandBasicInfoEntityList = FCCCRMLandBasicInfo.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(cRMLandBasicInfoEntityList ?? new List <CRMLandBasicInfoEntity>());
        }
Beispiel #2
0
        protected void lvCRMLandBasicInfo_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 LandBasicInfoID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(CRMLandBasicInfoEntity.FLD_NAME_LandBasicInfoID, LandBasicInfoID.ToString(), SQLMatchType.Equal);

                        CRMLandBasicInfoEntity cRMLandBasicInfoEntity = new CRMLandBasicInfoEntity();


                        result = FCCCRMLandBasicInfo.GetFacadeCreate().Delete(cRMLandBasicInfoEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _LandBasicInfoID        = 0;
                            _CRMLandBasicInfoEntity = new CRMLandBasicInfoEntity();
                            PrepareInitialView();
                            BindCRMLandBasicInfoList();

                            MiscUtil.ShowMessage(lblMessage, "Land Basic Info has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Land Basic Info.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Beispiel #3
0
        public IList <CRMLandBasicInfoEntity> GetData()
        {
            IList <CRMLandBasicInfoEntity> cRMLandBasicInfoEntityList = new List <CRMLandBasicInfoEntity>();

            try
            {
                cRMLandBasicInfoEntityList = FCCCRMLandBasicInfo.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(cRMLandBasicInfoEntityList ?? new List <CRMLandBasicInfoEntity>());
        }
Beispiel #4
0
        private void SaveCRMLandBasicInfoEntity()
        {
            if (IsValid)
            {
                try
                {
                    CRMLandBasicInfoEntity cRMLandBasicInfoEntity = BuildCRMLandBasicInfoEntity();

                    Int64 result = -1;

                    if (cRMLandBasicInfoEntity.IsNew)
                    {
                        result = FCCCRMLandBasicInfo.GetFacadeCreate().Add(cRMLandBasicInfoEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CRMLandBasicInfoEntity.FLD_NAME_LandBasicInfoID, cRMLandBasicInfoEntity.LandBasicInfoID.ToString(), SQLMatchType.Equal);
                        result = FCCCRMLandBasicInfo.GetFacadeCreate().Update(cRMLandBasicInfoEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _LandBasicInfoID        = 0;
                        _CRMLandBasicInfoEntity = new CRMLandBasicInfoEntity();
                        PrepareInitialView();
                        BindCRMLandBasicInfoList();

                        if (Operation == "Communicate")
                        {
                            String navUrl = UrlHelper.BuildSecureUrl("~/CRM/CRMCommunication.aspx", string.Empty, "do", "Land", UrlConstants.OVERVIEW_LAND_BASIC_INFO_ID, result.ToString()).ToString();
                            Response.Redirect(navUrl);
                        }

                        else if (Operation == "none")
                        {
                            String navUrl = UrlHelper.BuildSecureUrl("~/CRM/CRMLandCurrentStatus.aspx", string.Empty, UrlConstants.OVERVIEW_LAND_BASIC_INFO_ID, result.ToString()).ToString();
                            Response.Redirect(navUrl);
                        }

                        if (cRMLandBasicInfoEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Land Basic Info Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Land Basic Info Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (cRMLandBasicInfoEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Land Basic Info Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Land Basic Info Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }