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