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