public IList <ACDepreciationMethodEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <ACDepreciationMethodEntity> aCDepreciationMethodEntityList = new List <ACDepreciationMethodEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = ACDepreciationMethodEntity.FLD_NAME_DepreciationMethodID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; aCDepreciationMethodEntityList = FCCACDepreciationMethod.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (aCDepreciationMethodEntityList != null && aCDepreciationMethodEntityList.Count > 0) { totalRowCount = aCDepreciationMethodEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(aCDepreciationMethodEntityList ?? new List <ACDepreciationMethodEntity>()); }
private void SaveACDepreciationMethodEntity() { if (IsValid) { try { ACDepreciationMethodEntity aCDepreciationMethodEntity = BuildACDepreciationMethodEntity(); Int64 result = -1; if (aCDepreciationMethodEntity.IsNew) { result = FCCACDepreciationMethod.GetFacadeCreate().Add(aCDepreciationMethodEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(ACDepreciationMethodEntity.FLD_NAME_DepreciationMethodID, aCDepreciationMethodEntity.DepreciationMethodID.ToString(), SQLMatchType.Equal); result = FCCACDepreciationMethod.GetFacadeCreate().Update(aCDepreciationMethodEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _DepreciationMethodID = 0; _ACDepreciationMethodEntity = new ACDepreciationMethodEntity(); PrepareInitialView(); BindACDepreciationMethodList(); if (aCDepreciationMethodEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "A CDepreciation Method Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "A CDepreciation Method Information has been updated successfully.", false); } } else { if (aCDepreciationMethodEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add A CDepreciation Method Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update A CDepreciation Method Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvACDepreciationMethod_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 DepreciationMethodID; Int64.TryParse(e.CommandArgument.ToString(), out DepreciationMethodID); if (DepreciationMethodID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _DepreciationMethodID = DepreciationMethodID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(ACDepreciationMethodEntity.FLD_NAME_DepreciationMethodID, DepreciationMethodID.ToString(), SQLMatchType.Equal); ACDepreciationMethodEntity aCDepreciationMethodEntity = new ACDepreciationMethodEntity(); result = FCCACDepreciationMethod.GetFacadeCreate().Delete(aCDepreciationMethodEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _DepreciationMethodID = 0; _ACDepreciationMethodEntity = new ACDepreciationMethodEntity(); PrepareInitialView(); BindACDepreciationMethodList(); MiscUtil.ShowMessage(lblMessage, "A CDepreciation Method has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete A CDepreciation Method.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <ACDepreciationMethodEntity> GetData() { IList <ACDepreciationMethodEntity> aCDepreciationMethodEntityList = new List <ACDepreciationMethodEntity>(); try { aCDepreciationMethodEntityList = FCCACDepreciationMethod.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (aCDepreciationMethodEntityList != null && aCDepreciationMethodEntityList.Count > 0) { totalRowCount = aCDepreciationMethodEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(aCDepreciationMethodEntityList ?? new List <ACDepreciationMethodEntity>()); }