public IList <ACMDTDSCategoryEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <ACMDTDSCategoryEntity> aCMDTDSCategoryEntityList = new List <ACMDTDSCategoryEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = ACMDTDSCategoryEntity.FLD_NAME_TDSCategoryID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; aCMDTDSCategoryEntityList = FCCACMDTDSCategory.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (aCMDTDSCategoryEntityList != null && aCMDTDSCategoryEntityList.Count > 0) { totalRowCount = aCMDTDSCategoryEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(aCMDTDSCategoryEntityList ?? new List <ACMDTDSCategoryEntity>()); }
private void SaveACMDTDSCategoryEntity() { if (IsValid) { try { ACMDTDSCategoryEntity aCMDTDSCategoryEntity = BuildACMDTDSCategoryEntity(); Int64 result = -1; if (aCMDTDSCategoryEntity.IsNew) { result = FCCACMDTDSCategory.GetFacadeCreate().Add(aCMDTDSCategoryEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(ACMDTDSCategoryEntity.FLD_NAME_TDSCategoryID, aCMDTDSCategoryEntity.TDSCategoryID.ToString(), SQLMatchType.Equal); result = FCCACMDTDSCategory.GetFacadeCreate().Update(aCMDTDSCategoryEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _TDSCategoryID = 0; _ACMDTDSCategoryEntity = new ACMDTDSCategoryEntity(); PrepareInitialView(); BindACMDTDSCategoryList(); if (aCMDTDSCategoryEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "A CTDSCategory Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "A CTDSCategory Information has been updated successfully.", false); } } else { if (aCMDTDSCategoryEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add A CTDSCategory Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update A CTDSCategory Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvACMDTDSCategory_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 TDSCategoryID; Int64.TryParse(e.CommandArgument.ToString(), out TDSCategoryID); if (TDSCategoryID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _TDSCategoryID = TDSCategoryID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(ACMDTDSCategoryEntity.FLD_NAME_TDSCategoryID, TDSCategoryID.ToString(), SQLMatchType.Equal); ACMDTDSCategoryEntity aCMDTDSCategoryEntity = new ACMDTDSCategoryEntity(); result = FCCACMDTDSCategory.GetFacadeCreate().Delete(aCMDTDSCategoryEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _TDSCategoryID = 0; _ACMDTDSCategoryEntity = new ACMDTDSCategoryEntity(); PrepareInitialView(); BindACMDTDSCategoryList(); MiscUtil.ShowMessage(lblMessage, "A CTDSCategory has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete A CTDSCategory.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <ACMDTDSCategoryEntity> GetData() { IList <ACMDTDSCategoryEntity> aCMDTDSCategoryEntityList = new List <ACMDTDSCategoryEntity>(); try { aCMDTDSCategoryEntityList = FCCACMDTDSCategory.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (aCMDTDSCategoryEntityList != null && aCMDTDSCategoryEntityList.Count > 0) { totalRowCount = aCMDTDSCategoryEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(aCMDTDSCategoryEntityList ?? new List <ACMDTDSCategoryEntity>()); }