public IList <MDSurveyOwnerTypeEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <MDSurveyOwnerTypeEntity> mDSurveyOwnerTypeEntityList = new List <MDSurveyOwnerTypeEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = MDSurveyOwnerTypeEntity.FLD_NAME_SurveyOwnerTypeID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; mDSurveyOwnerTypeEntityList = FCCMDSurveyOwnerType.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (mDSurveyOwnerTypeEntityList != null && mDSurveyOwnerTypeEntityList.Count > 0) { totalRowCount = mDSurveyOwnerTypeEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDSurveyOwnerTypeEntityList ?? new List <MDSurveyOwnerTypeEntity>()); }
private void SaveMDSurveyOwnerTypeEntity() { if (IsValid) { try { MDSurveyOwnerTypeEntity mDSurveyOwnerTypeEntity = BuildMDSurveyOwnerTypeEntity(); Int64 result = -1; if (mDSurveyOwnerTypeEntity.IsNew) { result = FCCMDSurveyOwnerType.GetFacadeCreate().Add(mDSurveyOwnerTypeEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDSurveyOwnerTypeEntity.FLD_NAME_SurveyOwnerTypeID, mDSurveyOwnerTypeEntity.SurveyOwnerTypeID.ToString(), SQLMatchType.Equal); result = FCCMDSurveyOwnerType.GetFacadeCreate().Update(mDSurveyOwnerTypeEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _SurveyOwnerTypeID = 0; _MDSurveyOwnerTypeEntity = new MDSurveyOwnerTypeEntity(); PrepareInitialView(); BindMDSurveyOwnerTypeList(); if (mDSurveyOwnerTypeEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Survey Owner Type Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Survey Owner Type Information has been updated successfully.", false); } } else { if (mDSurveyOwnerTypeEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Survey Owner Type Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Survey Owner Type Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvMDSurveyOwnerType_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 SurveyOwnerTypeID; Int64.TryParse(e.CommandArgument.ToString(), out SurveyOwnerTypeID); if (SurveyOwnerTypeID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _SurveyOwnerTypeID = SurveyOwnerTypeID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(MDSurveyOwnerTypeEntity.FLD_NAME_SurveyOwnerTypeID, SurveyOwnerTypeID.ToString(), SQLMatchType.Equal); MDSurveyOwnerTypeEntity mDSurveyOwnerTypeEntity = new MDSurveyOwnerTypeEntity(); result = FCCMDSurveyOwnerType.GetFacadeCreate().Delete(mDSurveyOwnerTypeEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _SurveyOwnerTypeID = 0; _MDSurveyOwnerTypeEntity = new MDSurveyOwnerTypeEntity(); PrepareInitialView(); BindMDSurveyOwnerTypeList(); MiscUtil.ShowMessage(lblMessage, "Survey Owner Type has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Survey Owner Type.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <MDSurveyOwnerTypeEntity> GetData() { IList <MDSurveyOwnerTypeEntity> mDSurveyOwnerTypeEntityList = new List <MDSurveyOwnerTypeEntity>(); try { mDSurveyOwnerTypeEntityList = FCCMDSurveyOwnerType.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (mDSurveyOwnerTypeEntityList != null && mDSurveyOwnerTypeEntityList.Count > 0) { totalRowCount = mDSurveyOwnerTypeEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDSurveyOwnerTypeEntityList ?? new List <MDSurveyOwnerTypeEntity>()); }