public IList <BDProjectHistoryEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <BDProjectHistoryEntity> bDProjectHistoryEntityList = new List <BDProjectHistoryEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = BDProjectHistoryEntity.FLD_NAME_ProjectHistoryID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; bDProjectHistoryEntityList = FCCBDProjectHistory.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (bDProjectHistoryEntityList != null && bDProjectHistoryEntityList.Count > 0) { totalRowCount = bDProjectHistoryEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(bDProjectHistoryEntityList ?? new List <BDProjectHistoryEntity>()); }
private void SaveBDProjectHistoryEntity() { if (IsValid) { try { BDProjectHistoryEntity bDProjectHistoryEntity = BuildBDProjectHistoryEntity(); Int64 result = -1; if (bDProjectHistoryEntity.IsNew) { result = FCCBDProjectHistory.GetFacadeCreate().Add(bDProjectHistoryEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(BDProjectHistoryEntity.FLD_NAME_ProjectHistoryID, bDProjectHistoryEntity.ProjectHistoryID.ToString(), SQLMatchType.Equal); result = FCCBDProjectHistory.GetFacadeCreate().Update(bDProjectHistoryEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _ProjectHistoryID = 0; _BDProjectHistoryEntity = new BDProjectHistoryEntity(); PrepareInitialView(); BindBDProjectHistoryList(); if (bDProjectHistoryEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Project History Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Project History Information has been updated successfully.", false); } } else { if (bDProjectHistoryEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Project History Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Project History Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvBDProjectHistory_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 ProjectHistoryID; Int64.TryParse(e.CommandArgument.ToString(), out ProjectHistoryID); if (ProjectHistoryID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _ProjectHistoryID = ProjectHistoryID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(BDProjectHistoryEntity.FLD_NAME_ProjectHistoryID, ProjectHistoryID.ToString(), SQLMatchType.Equal); BDProjectHistoryEntity bDProjectHistoryEntity = new BDProjectHistoryEntity(); result = FCCBDProjectHistory.GetFacadeCreate().Delete(bDProjectHistoryEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _ProjectHistoryID = 0; _BDProjectHistoryEntity = new BDProjectHistoryEntity(); PrepareInitialView(); BindBDProjectHistoryList(); MiscUtil.ShowMessage(lblMessage, "Project History has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Project History.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <BDProjectHistoryEntity> GetData() { IList <BDProjectHistoryEntity> bDProjectHistoryEntityList = new List <BDProjectHistoryEntity>(); try { bDProjectHistoryEntityList = FCCBDProjectHistory.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (bDProjectHistoryEntityList != null && bDProjectHistoryEntityList.Count > 0) { totalRowCount = bDProjectHistoryEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(bDProjectHistoryEntityList ?? new List <BDProjectHistoryEntity>()); }