public IList <BDProjectUnitLocationEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <BDProjectUnitLocationEntity> bDProjectUnitLocationEntityList = new List <BDProjectUnitLocationEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = BDProjectUnitLocationEntity.FLD_NAME_ProjectUnitLocationID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; bDProjectUnitLocationEntityList = FCCBDProjectUnitLocation.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (bDProjectUnitLocationEntityList != null && bDProjectUnitLocationEntityList.Count > 0) { totalRowCount = bDProjectUnitLocationEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(bDProjectUnitLocationEntityList ?? new List <BDProjectUnitLocationEntity>()); }
private void SaveBDProjectUnitLocationEntity() { if (IsValid) { try { BDProjectUnitLocationEntity bDProjectUnitLocationEntity = BuildBDProjectUnitLocationEntity(); Int64 result = -1; if (bDProjectUnitLocationEntity.IsNew) { result = FCCBDProjectUnitLocation.GetFacadeCreate().Add(bDProjectUnitLocationEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(BDProjectUnitLocationEntity.FLD_NAME_ProjectUnitLocationID, bDProjectUnitLocationEntity.ProjectUnitLocationID.ToString(), SQLMatchType.Equal); result = FCCBDProjectUnitLocation.GetFacadeCreate().Update(bDProjectUnitLocationEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _ProjectUnitLocationID = 0; _BDProjectUnitLocationEntity = new BDProjectUnitLocationEntity(); PrepareInitialView(); BindBDProjectUnitLocationList(); if (bDProjectUnitLocationEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Project Unit Location Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Project Unit Location Information has been updated successfully.", false); } } else { if (bDProjectUnitLocationEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Project Unit Location Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Project Unit Location Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvBDProjectUnitLocation_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 ProjectUnitLocationID; Int64.TryParse(e.CommandArgument.ToString(), out ProjectUnitLocationID); if (ProjectUnitLocationID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _ProjectUnitLocationID = ProjectUnitLocationID; PrepareEditView(); } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(BDProjectUnitLocationEntity.FLD_NAME_ProjectUnitLocationID, ProjectUnitLocationID.ToString(), SQLMatchType.Equal); BDProjectUnitLocationEntity bDProjectUnitLocationEntity = new BDProjectUnitLocationEntity(); result = FCCBDProjectUnitLocation.GetFacadeCreate().Delete(bDProjectUnitLocationEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _ProjectUnitLocationID = 0; _BDProjectUnitLocationEntity = new BDProjectUnitLocationEntity(); PrepareInitialView(); BindBDProjectUnitLocationList(); MiscUtil.ShowMessage(lblMessage, "Project Unit Location has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Project Unit Location.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <BDProjectUnitLocationEntity> GetData() { IList <BDProjectUnitLocationEntity> bDProjectUnitLocationEntityList = new List <BDProjectUnitLocationEntity>(); try { bDProjectUnitLocationEntityList = FCCBDProjectUnitLocation.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (bDProjectUnitLocationEntityList != null && bDProjectUnitLocationEntityList.Count > 0) { totalRowCount = bDProjectUnitLocationEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(bDProjectUnitLocationEntityList ?? new List <BDProjectUnitLocationEntity>()); }