public IList <CRMMDBookingStatusEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <CRMMDBookingStatusEntity> cRMMDBookingStatusEntityList = new List <CRMMDBookingStatusEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = CRMMDBookingStatusEntity.FLD_NAME_BookingStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; cRMMDBookingStatusEntityList = FCCCRMMDBookingStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (cRMMDBookingStatusEntityList != null && cRMMDBookingStatusEntityList.Count > 0) { totalRowCount = cRMMDBookingStatusEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(cRMMDBookingStatusEntityList ?? new List <CRMMDBookingStatusEntity>()); }
private void SaveCRMMDBookingStatusEntity() { if (IsValid) { try { CRMMDBookingStatusEntity cRMMDBookingStatusEntity = BuildCRMMDBookingStatusEntity(); Int64 result = -1; if (cRMMDBookingStatusEntity.IsNew) { result = FCCCRMMDBookingStatus.GetFacadeCreate().Add(cRMMDBookingStatusEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CRMMDBookingStatusEntity.FLD_NAME_BookingStatusID, cRMMDBookingStatusEntity.BookingStatusID.ToString(), SQLMatchType.Equal); result = FCCCRMMDBookingStatus.GetFacadeCreate().Update(cRMMDBookingStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _BookingStatusID = 0; _CRMMDBookingStatusEntity = new CRMMDBookingStatusEntity(); PrepareInitialView(); BindCRMMDBookingStatusList(); if (cRMMDBookingStatusEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "C RMBooking Status Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "C RMBooking Status Information has been updated successfully.", false); } } else { if (cRMMDBookingStatusEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add C RMBooking Status Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update C RMBooking Status Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvCRMMDBookingStatus_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 BookingStatusID; Int64.TryParse(e.CommandArgument.ToString(), out BookingStatusID); if (BookingStatusID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _BookingStatusID = BookingStatusID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(CRMMDBookingStatusEntity.FLD_NAME_BookingStatusID, BookingStatusID.ToString(), SQLMatchType.Equal); CRMMDBookingStatusEntity cRMMDBookingStatusEntity = new CRMMDBookingStatusEntity(); result = FCCCRMMDBookingStatus.GetFacadeCreate().Delete(cRMMDBookingStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _BookingStatusID = 0; _CRMMDBookingStatusEntity = new CRMMDBookingStatusEntity(); PrepareInitialView(); BindCRMMDBookingStatusList(); MiscUtil.ShowMessage(lblMessage, "C RMBooking Status has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete C RMBooking Status.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <CRMMDBookingStatusEntity> GetData() { IList <CRMMDBookingStatusEntity> cRMMDBookingStatusEntityList = new List <CRMMDBookingStatusEntity>(); try { cRMMDBookingStatusEntityList = FCCCRMMDBookingStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (cRMMDBookingStatusEntityList != null && cRMMDBookingStatusEntityList.Count > 0) { totalRowCount = cRMMDBookingStatusEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(cRMMDBookingStatusEntityList ?? new List <CRMMDBookingStatusEntity>()); }