public IList <PRMWorkOrderItemDetailEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <PRMWorkOrderItemDetailEntity> pRMWorkOrderItemDetailEntityList = new List <PRMWorkOrderItemDetailEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = PRMWorkOrderItemDetailEntity.FLD_NAME_WorkOrderItemDetailID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; pRMWorkOrderItemDetailEntityList = FCCPRMWorkOrderItemDetail.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (pRMWorkOrderItemDetailEntityList != null && pRMWorkOrderItemDetailEntityList.Count > 0) { totalRowCount = pRMWorkOrderItemDetailEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(pRMWorkOrderItemDetailEntityList ?? new List <PRMWorkOrderItemDetailEntity>()); }
private void SavePRMWorkOrderItemDetailEntity() { if (IsValid) { try { PRMWorkOrderItemDetailEntity pRMWorkOrderItemDetailEntity = BuildPRMWorkOrderItemDetailEntity(); Int64 result = -1; if (pRMWorkOrderItemDetailEntity.IsNew) { result = FCCPRMWorkOrderItemDetail.GetFacadeCreate().Add(pRMWorkOrderItemDetailEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(PRMWorkOrderItemDetailEntity.FLD_NAME_WorkOrderItemDetailID, pRMWorkOrderItemDetailEntity.WorkOrderItemDetailID.ToString(), SQLMatchType.Equal); result = FCCPRMWorkOrderItemDetail.GetFacadeCreate().Update(pRMWorkOrderItemDetailEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _WorkOrderItemDetailID = 0; _PRMWorkOrderItemDetailEntity = new PRMWorkOrderItemDetailEntity(); PrepareInitialView(); BindPRMWorkOrderItemDetailList(); if (pRMWorkOrderItemDetailEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Work Order Item Detail Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Work Order Item Detail Information has been updated successfully.", false); } } else { if (pRMWorkOrderItemDetailEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Work Order Item Detail Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Work Order Item Detail Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvPRMWorkOrderItemDetail_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 WorkOrderItemDetailID; Int64.TryParse(e.CommandArgument.ToString(), out WorkOrderItemDetailID); if (WorkOrderItemDetailID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _WorkOrderItemDetailID = WorkOrderItemDetailID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(PRMWorkOrderItemDetailEntity.FLD_NAME_WorkOrderItemDetailID, WorkOrderItemDetailID.ToString(), SQLMatchType.Equal); PRMWorkOrderItemDetailEntity pRMWorkOrderItemDetailEntity = new PRMWorkOrderItemDetailEntity(); result = FCCPRMWorkOrderItemDetail.GetFacadeCreate().Delete(pRMWorkOrderItemDetailEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _WorkOrderItemDetailID = 0; _PRMWorkOrderItemDetailEntity = new PRMWorkOrderItemDetailEntity(); PrepareInitialView(); BindPRMWorkOrderItemDetailList(); MiscUtil.ShowMessage(lblMessage, "Work Order Item Detail has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Work Order Item Detail.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <PRMWorkOrderItemDetailEntity> GetData() { IList <PRMWorkOrderItemDetailEntity> pRMWorkOrderItemDetailEntityList = new List <PRMWorkOrderItemDetailEntity>(); try { pRMWorkOrderItemDetailEntityList = FCCPRMWorkOrderItemDetail.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (pRMWorkOrderItemDetailEntityList != null && pRMWorkOrderItemDetailEntityList.Count > 0) { totalRowCount = pRMWorkOrderItemDetailEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(pRMWorkOrderItemDetailEntityList ?? new List <PRMWorkOrderItemDetailEntity>()); }