public IList <CMConsultantAddressInfoEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <CMConsultantAddressInfoEntity> cMConsultantAddressInfoEntityList = new List <CMConsultantAddressInfoEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = CMConsultantAddressInfoEntity.FLD_NAME_ConsultantAddressInfoID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; cMConsultantAddressInfoEntityList = FCCCMConsultantAddressInfo.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (cMConsultantAddressInfoEntityList != null && cMConsultantAddressInfoEntityList.Count > 0) { totalRowCount = cMConsultantAddressInfoEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(cMConsultantAddressInfoEntityList ?? new List <CMConsultantAddressInfoEntity>()); }
private void SaveCMConsultantAddressInfoEntity() { if (IsValid) { try { CMConsultantAddressInfoEntity cMConsultantAddressInfoEntity = BuildCMConsultantAddressInfoEntity(); Int64 result = -1; if (cMConsultantAddressInfoEntity.IsNew) { result = FCCCMConsultantAddressInfo.GetFacadeCreate().Add(cMConsultantAddressInfoEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CMConsultantAddressInfoEntity.FLD_NAME_ConsultantAddressInfoID, cMConsultantAddressInfoEntity.ConsultantAddressInfoID.ToString(), SQLMatchType.Equal); result = FCCCMConsultantAddressInfo.GetFacadeCreate().Update(cMConsultantAddressInfoEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _ConsultantAddressInfoID = 0; _CMConsultantAddressInfoEntity = new CMConsultantAddressInfoEntity(); PrepareInitialView(); BindCMConsultantAddressInfoList(); if (cMConsultantAddressInfoEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Consultant Address Info Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Consultant Address Info Information has been updated successfully.", false); } } else { if (cMConsultantAddressInfoEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Consultant Address Info Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Consultant Address Info Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvCMConsultantAddressInfo_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 ConsultantAddressInfoID; Int64.TryParse(e.CommandArgument.ToString(), out ConsultantAddressInfoID); if (ConsultantAddressInfoID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _ConsultantAddressInfoID = ConsultantAddressInfoID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(CMConsultantAddressInfoEntity.FLD_NAME_ConsultantAddressInfoID, ConsultantAddressInfoID.ToString(), SQLMatchType.Equal); CMConsultantAddressInfoEntity cMConsultantAddressInfoEntity = new CMConsultantAddressInfoEntity(); result = FCCCMConsultantAddressInfo.GetFacadeCreate().Delete(cMConsultantAddressInfoEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _ConsultantAddressInfoID = 0; _CMConsultantAddressInfoEntity = new CMConsultantAddressInfoEntity(); PrepareInitialView(); BindCMConsultantAddressInfoList(); MiscUtil.ShowMessage(lblMessage, "Consultant Address Info has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Consultant Address Info.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <CMConsultantAddressInfoEntity> GetData() { IList <CMConsultantAddressInfoEntity> cMConsultantAddressInfoEntityList = new List <CMConsultantAddressInfoEntity>(); try { cMConsultantAddressInfoEntityList = FCCCMConsultantAddressInfo.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (cMConsultantAddressInfoEntityList != null && cMConsultantAddressInfoEntityList.Count > 0) { totalRowCount = cMConsultantAddressInfoEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(cMConsultantAddressInfoEntityList ?? new List <CMConsultantAddressInfoEntity>()); }