public IList <CMNProcessCategoryEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <CMNProcessCategoryEntity> cMNProcessCategoryEntityList = new List <CMNProcessCategoryEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = CMNProcessCategoryEntity.FLD_NAME_ProcessCategoryID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; cMNProcessCategoryEntityList = FCCCMNProcessCategory.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (cMNProcessCategoryEntityList != null && cMNProcessCategoryEntityList.Count > 0) { totalRowCount = cMNProcessCategoryEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(cMNProcessCategoryEntityList ?? new List <CMNProcessCategoryEntity>()); }
private void SaveCMNProcessCategoryEntity() { if (IsValid) { try { CMNProcessCategoryEntity cMNProcessCategoryEntity = BuildCMNProcessCategoryEntity(); Int64 result = -1; if (cMNProcessCategoryEntity.IsNew) { result = FCCCMNProcessCategory.GetFacadeCreate().Add(cMNProcessCategoryEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CMNProcessCategoryEntity.FLD_NAME_ProcessCategoryID, cMNProcessCategoryEntity.ProcessCategoryID.ToString(), SQLMatchType.Equal); result = FCCCMNProcessCategory.GetFacadeCreate().Update(cMNProcessCategoryEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _ProcessCategoryID = 0; _CMNProcessCategoryEntity = new CMNProcessCategoryEntity(); PrepareInitialView(); BindCMNProcessCategoryList(); if (cMNProcessCategoryEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "C MNProcess Category Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "C MNProcess Category Information has been updated successfully.", false); } } else { if (cMNProcessCategoryEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add C MNProcess Category Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update C MNProcess Category Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvCMNProcessCategory_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 ProcessCategoryID; Int64.TryParse(e.CommandArgument.ToString(), out ProcessCategoryID); if (ProcessCategoryID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _ProcessCategoryID = ProcessCategoryID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(CMNProcessCategoryEntity.FLD_NAME_ProcessCategoryID, ProcessCategoryID.ToString(), SQLMatchType.Equal); CMNProcessCategoryEntity cMNProcessCategoryEntity = new CMNProcessCategoryEntity(); result = FCCCMNProcessCategory.GetFacadeCreate().Delete(cMNProcessCategoryEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _ProcessCategoryID = 0; _CMNProcessCategoryEntity = new CMNProcessCategoryEntity(); PrepareInitialView(); BindCMNProcessCategoryList(); MiscUtil.ShowMessage(lblMessage, "C MNProcess Category has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete C MNProcess Category.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <CMNProcessCategoryEntity> GetData() { IList <CMNProcessCategoryEntity> cMNProcessCategoryEntityList = new List <CMNProcessCategoryEntity>(); try { cMNProcessCategoryEntityList = FCCCMNProcessCategory.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (cMNProcessCategoryEntityList != null && cMNProcessCategoryEntityList.Count > 0) { totalRowCount = cMNProcessCategoryEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(cMNProcessCategoryEntityList ?? new List <CMNProcessCategoryEntity>()); }