public IList <MDMailTextTypeEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <MDMailTextTypeEntity> mDMailTextTypeEntityList = new List <MDMailTextTypeEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = MDMailTextTypeEntity.FLD_NAME_MailTextTypeID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; mDMailTextTypeEntityList = FCCMDMailTextType.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (mDMailTextTypeEntityList != null && mDMailTextTypeEntityList.Count > 0) { totalRowCount = mDMailTextTypeEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDMailTextTypeEntityList ?? new List <MDMailTextTypeEntity>()); }
private void SaveMDMailTextTypeEntity() { if (IsValid) { try { MDMailTextTypeEntity mDMailTextTypeEntity = BuildMDMailTextTypeEntity(); Int64 result = -1; if (mDMailTextTypeEntity.IsNew) { result = FCCMDMailTextType.GetFacadeCreate().Add(mDMailTextTypeEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDMailTextTypeEntity.FLD_NAME_MailTextTypeID, mDMailTextTypeEntity.MailTextTypeID.ToString(), SQLMatchType.Equal); result = FCCMDMailTextType.GetFacadeCreate().Update(mDMailTextTypeEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _MailTextTypeID = 0; _MDMailTextTypeEntity = new MDMailTextTypeEntity(); PrepareInitialView(); BindMDMailTextTypeList(); if (mDMailTextTypeEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Mail Text Type Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Mail Text Type Information has been updated successfully.", false); } } else { if (mDMailTextTypeEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Mail Text Type Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Mail Text Type Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvMDMailTextType_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 MailTextTypeID; Int64.TryParse(e.CommandArgument.ToString(), out MailTextTypeID); if (MailTextTypeID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _MailTextTypeID = MailTextTypeID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(MDMailTextTypeEntity.FLD_NAME_MailTextTypeID, MailTextTypeID.ToString(), SQLMatchType.Equal); MDMailTextTypeEntity mDMailTextTypeEntity = new MDMailTextTypeEntity(); result = FCCMDMailTextType.GetFacadeCreate().Delete(mDMailTextTypeEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _MailTextTypeID = 0; _MDMailTextTypeEntity = new MDMailTextTypeEntity(); PrepareInitialView(); BindMDMailTextTypeList(); MiscUtil.ShowMessage(lblMessage, "Mail Text Type has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Mail Text Type.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <MDMailTextTypeEntity> GetData() { IList <MDMailTextTypeEntity> mDMailTextTypeEntityList = new List <MDMailTextTypeEntity>(); try { mDMailTextTypeEntityList = FCCMDMailTextType.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (mDMailTextTypeEntityList != null && mDMailTextTypeEntityList.Count > 0) { totalRowCount = mDMailTextTypeEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDMailTextTypeEntityList ?? new List <MDMailTextTypeEntity>()); }