public IList <ACClassTypeEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <ACClassTypeEntity> aCClassTypeEntityList = new List <ACClassTypeEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = ACClassTypeEntity.FLD_NAME_ClassTypeID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; aCClassTypeEntityList = FCCACClassType.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (aCClassTypeEntityList != null && aCClassTypeEntityList.Count > 0) { totalRowCount = aCClassTypeEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(aCClassTypeEntityList ?? new List <ACClassTypeEntity>()); }
private void SaveACClassTypeEntity() { if (IsValid) { try { ACClassTypeEntity aCClassTypeEntity = BuildACClassTypeEntity(); Int64 result = -1; if (aCClassTypeEntity.IsNew) { result = FCCACClassType.GetFacadeCreate().Add(aCClassTypeEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(ACClassTypeEntity.FLD_NAME_ClassTypeID, aCClassTypeEntity.ClassTypeID.ToString(), SQLMatchType.Equal); result = FCCACClassType.GetFacadeCreate().Update(aCClassTypeEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _ClassTypeID = 0; _ACClassTypeEntity = new ACClassTypeEntity(); PrepareInitialView(); BindACClassTypeList(); if (aCClassTypeEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "A CClass Type Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "A CClass Type Information has been updated successfully.", false); } } else { if (aCClassTypeEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add A CClass Type Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update A CClass Type Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvACClassType_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 ClassTypeID; Int64.TryParse(e.CommandArgument.ToString(), out ClassTypeID); if (ClassTypeID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _ClassTypeID = ClassTypeID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(ACClassTypeEntity.FLD_NAME_ClassTypeID, ClassTypeID.ToString(), SQLMatchType.Equal); ACClassTypeEntity aCClassTypeEntity = new ACClassTypeEntity(); result = FCCACClassType.GetFacadeCreate().Delete(aCClassTypeEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _ClassTypeID = 0; _ACClassTypeEntity = new ACClassTypeEntity(); PrepareInitialView(); BindACClassTypeList(); MiscUtil.ShowMessage(lblMessage, "A CClass Type has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete A CClass Type.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <ACClassTypeEntity> GetData() { IList <ACClassTypeEntity> aCClassTypeEntityList = new List <ACClassTypeEntity>(); try { aCClassTypeEntityList = FCCACClassType.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (aCClassTypeEntityList != null && aCClassTypeEntityList.Count > 0) { totalRowCount = aCClassTypeEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(aCClassTypeEntityList ?? new List <ACClassTypeEntity>()); }