public IList <BDMDRepeatCategoryEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <BDMDRepeatCategoryEntity> bDMDRepeatCategoryEntityList = new List <BDMDRepeatCategoryEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = BDMDRepeatCategoryEntity.FLD_NAME_RepeatCategoryID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; bDMDRepeatCategoryEntityList = FCCBDMDRepeatCategory.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (bDMDRepeatCategoryEntityList != null && bDMDRepeatCategoryEntityList.Count > 0) { totalRowCount = bDMDRepeatCategoryEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(bDMDRepeatCategoryEntityList ?? new List <BDMDRepeatCategoryEntity>()); }
private void SaveBDMDRepeatCategoryEntity() { if (IsValid) { try { BDMDRepeatCategoryEntity bDMDRepeatCategoryEntity = BuildBDMDRepeatCategoryEntity(); Int64 result = -1; if (bDMDRepeatCategoryEntity.IsNew) { result = FCCBDMDRepeatCategory.GetFacadeCreate().Add(bDMDRepeatCategoryEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(BDMDRepeatCategoryEntity.FLD_NAME_RepeatCategoryID, bDMDRepeatCategoryEntity.RepeatCategoryID.ToString(), SQLMatchType.Equal); result = FCCBDMDRepeatCategory.GetFacadeCreate().Update(bDMDRepeatCategoryEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _RepeatCategoryID = 0; _BDMDRepeatCategoryEntity = new BDMDRepeatCategoryEntity(); PrepareInitialView(); BindBDMDRepeatCategoryList(); if (bDMDRepeatCategoryEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Repeat Category Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Repeat Category Information has been updated successfully.", false); } } else { if (bDMDRepeatCategoryEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Repeat Category Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Repeat Category Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvBDMDRepeatCategory_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 RepeatCategoryID; Int64.TryParse(e.CommandArgument.ToString(), out RepeatCategoryID); if (RepeatCategoryID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _RepeatCategoryID = RepeatCategoryID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(BDMDRepeatCategoryEntity.FLD_NAME_RepeatCategoryID, RepeatCategoryID.ToString(), SQLMatchType.Equal); BDMDRepeatCategoryEntity bDMDRepeatCategoryEntity = new BDMDRepeatCategoryEntity(); result = FCCBDMDRepeatCategory.GetFacadeCreate().Delete(bDMDRepeatCategoryEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _RepeatCategoryID = 0; _BDMDRepeatCategoryEntity = new BDMDRepeatCategoryEntity(); PrepareInitialView(); BindBDMDRepeatCategoryList(); MiscUtil.ShowMessage(lblMessage, "Repeat Category has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Repeat Category.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <BDMDRepeatCategoryEntity> GetData() { IList <BDMDRepeatCategoryEntity> bDMDRepeatCategoryEntityList = new List <BDMDRepeatCategoryEntity>(); try { bDMDRepeatCategoryEntityList = FCCBDMDRepeatCategory.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (bDMDRepeatCategoryEntityList != null && bDMDRepeatCategoryEntityList.Count > 0) { totalRowCount = bDMDRepeatCategoryEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(bDMDRepeatCategoryEntityList ?? new List <BDMDRepeatCategoryEntity>()); }