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