public IList <CRMMDLandOwnerTypeEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <CRMMDLandOwnerTypeEntity> cRMMDLandOwnerTypeEntityList = new List <CRMMDLandOwnerTypeEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = CRMMDLandOwnerTypeEntity.FLD_NAME_LandOwnerTypeID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; cRMMDLandOwnerTypeEntityList = FCCCRMMDLandOwnerType.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (cRMMDLandOwnerTypeEntityList != null && cRMMDLandOwnerTypeEntityList.Count > 0) { totalRowCount = cRMMDLandOwnerTypeEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(cRMMDLandOwnerTypeEntityList ?? new List <CRMMDLandOwnerTypeEntity>()); }
private void SaveCRMMDLandOwnerTypeEntity() { if (IsValid) { try { CRMMDLandOwnerTypeEntity cRMMDLandOwnerTypeEntity = BuildCRMMDLandOwnerTypeEntity(); Int64 result = -1; if (cRMMDLandOwnerTypeEntity.IsNew) { result = FCCCRMMDLandOwnerType.GetFacadeCreate().Add(cRMMDLandOwnerTypeEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CRMMDLandOwnerTypeEntity.FLD_NAME_LandOwnerTypeID, cRMMDLandOwnerTypeEntity.LandOwnerTypeID.ToString(), SQLMatchType.Equal); result = FCCCRMMDLandOwnerType.GetFacadeCreate().Update(cRMMDLandOwnerTypeEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _LandOwnerTypeID = 0; _CRMMDLandOwnerTypeEntity = new CRMMDLandOwnerTypeEntity(); PrepareInitialView(); BindCRMMDLandOwnerTypeList(); if (cRMMDLandOwnerTypeEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "C RMLandowner Type Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "C RMLandowner Type Information has been updated successfully.", false); } } else { if (cRMMDLandOwnerTypeEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add C RMLandowner Type Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update C RMLandowner Type Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvCRMMDLandOwnerType_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 LandOwnerTypeID; Int64.TryParse(e.CommandArgument.ToString(), out LandOwnerTypeID); if (LandOwnerTypeID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _LandOwnerTypeID = LandOwnerTypeID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(CRMMDLandOwnerTypeEntity.FLD_NAME_LandOwnerTypeID, LandOwnerTypeID.ToString(), SQLMatchType.Equal); CRMMDLandOwnerTypeEntity cRMMDLandOwnerTypeEntity = new CRMMDLandOwnerTypeEntity(); result = FCCCRMMDLandOwnerType.GetFacadeCreate().Delete(cRMMDLandOwnerTypeEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _LandOwnerTypeID = 0; _CRMMDLandOwnerTypeEntity = new CRMMDLandOwnerTypeEntity(); PrepareInitialView(); BindCRMMDLandOwnerTypeList(); MiscUtil.ShowMessage(lblMessage, "C RMLandowner Type has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete C RMLandowner Type.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <CRMMDLandOwnerTypeEntity> GetData() { IList <CRMMDLandOwnerTypeEntity> cRMMDLandOwnerTypeEntityList = new List <CRMMDLandOwnerTypeEntity>(); try { cRMMDLandOwnerTypeEntityList = FCCCRMMDLandOwnerType.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (cRMMDLandOwnerTypeEntityList != null && cRMMDLandOwnerTypeEntityList.Count > 0) { totalRowCount = cRMMDLandOwnerTypeEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(cRMMDLandOwnerTypeEntityList ?? new List <CRMMDLandOwnerTypeEntity>()); }