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