public IList <APPanelItemCategoryMapEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <APPanelItemCategoryMapEntity> aPPanelItemCategoryMapEntityList = new List <APPanelItemCategoryMapEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = APPanelItemCategoryMapEntity.FLD_NAME_APPanelItemCategoryMapID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; aPPanelItemCategoryMapEntityList = FCCAPPanelItemCategoryMap.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (aPPanelItemCategoryMapEntityList != null && aPPanelItemCategoryMapEntityList.Count > 0) { totalRowCount = aPPanelItemCategoryMapEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(aPPanelItemCategoryMapEntityList ?? new List <APPanelItemCategoryMapEntity>()); }
private void SaveAPPanelItemCategoryMapEntity() { if (IsValid) { try { APPanelItemCategoryMapEntity aPPanelItemCategoryMapEntity = BuildAPPanelItemCategoryMapEntity(); Int64 result = -1; if (aPPanelItemCategoryMapEntity.IsNew) { result = FCCAPPanelItemCategoryMap.GetFacadeCreate().Add(aPPanelItemCategoryMapEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(APPanelItemCategoryMapEntity.FLD_NAME_APPanelItemCategoryMapID, aPPanelItemCategoryMapEntity.APPanelItemCategoryMapID.ToString(), SQLMatchType.Equal); result = FCCAPPanelItemCategoryMap.GetFacadeCreate().Update(aPPanelItemCategoryMapEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _APPanelItemCategoryMapID = 0; _APPanelItemCategoryMapEntity = new APPanelItemCategoryMapEntity(); PrepareInitialView(); BindAPPanelItemCategoryMapList(); if (aPPanelItemCategoryMapEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "A PPanel Item Category Map Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "A PPanel Item Category Map Information has been updated successfully.", false); } } else { if (aPPanelItemCategoryMapEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add A PPanel Item Category Map Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update A PPanel Item Category Map Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvAPPanelItemCategoryMap_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 APPanelItemCategoryMapID; Int64.TryParse(e.CommandArgument.ToString(), out APPanelItemCategoryMapID); if (APPanelItemCategoryMapID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _APPanelItemCategoryMapID = APPanelItemCategoryMapID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(APPanelItemCategoryMapEntity.FLD_NAME_APPanelItemCategoryMapID, APPanelItemCategoryMapID.ToString(), SQLMatchType.Equal); APPanelItemCategoryMapEntity aPPanelItemCategoryMapEntity = new APPanelItemCategoryMapEntity(); result = FCCAPPanelItemCategoryMap.GetFacadeCreate().Delete(aPPanelItemCategoryMapEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _APPanelItemCategoryMapID = 0; _APPanelItemCategoryMapEntity = new APPanelItemCategoryMapEntity(); PrepareInitialView(); BindAPPanelItemCategoryMapList(); MiscUtil.ShowMessage(lblMessage, "A PPanel Item Category Map has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete A PPanel Item Category Map.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <APPanelItemCategoryMapEntity> GetData() { IList <APPanelItemCategoryMapEntity> aPPanelItemCategoryMapEntityList = new List <APPanelItemCategoryMapEntity>(); try { aPPanelItemCategoryMapEntityList = FCCAPPanelItemCategoryMap.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (aPPanelItemCategoryMapEntityList != null && aPPanelItemCategoryMapEntityList.Count > 0) { totalRowCount = aPPanelItemCategoryMapEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(aPPanelItemCategoryMapEntityList ?? new List <APPanelItemCategoryMapEntity>()); }