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