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