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