public IList <MDEvaluatedByEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <MDEvaluatedByEntity> mDEvaluatedByEntityList = new List <MDEvaluatedByEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = MDEvaluatedByEntity.FLD_NAME_EvaluatedByID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; mDEvaluatedByEntityList = FCCMDEvaluatedBy.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (mDEvaluatedByEntityList != null && mDEvaluatedByEntityList.Count > 0) { totalRowCount = mDEvaluatedByEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDEvaluatedByEntityList ?? new List <MDEvaluatedByEntity>()); }
private void SaveMDEvaluatedByEntity() { if (IsValid) { try { MDEvaluatedByEntity mDEvaluatedByEntity = BuildMDEvaluatedByEntity(); Int64 result = -1; if (mDEvaluatedByEntity.IsNew) { result = FCCMDEvaluatedBy.GetFacadeCreate().Add(mDEvaluatedByEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDEvaluatedByEntity.FLD_NAME_EvaluatedByID, mDEvaluatedByEntity.EvaluatedByID.ToString(), SQLMatchType.Equal); result = FCCMDEvaluatedBy.GetFacadeCreate().Update(mDEvaluatedByEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _EvaluatedByID = 0; _MDEvaluatedByEntity = new MDEvaluatedByEntity(); PrepareInitialView(); BindMDEvaluatedByList(); if (mDEvaluatedByEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Evaluated By Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Evaluated By Information has been updated successfully.", false); } } else { if (mDEvaluatedByEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Evaluated By Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Evaluated By Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvMDEvaluatedBy_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 EvaluatedByID; Int64.TryParse(e.CommandArgument.ToString(), out EvaluatedByID); if (EvaluatedByID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _EvaluatedByID = EvaluatedByID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(MDEvaluatedByEntity.FLD_NAME_EvaluatedByID, EvaluatedByID.ToString(), SQLMatchType.Equal); MDEvaluatedByEntity mDEvaluatedByEntity = new MDEvaluatedByEntity(); result = FCCMDEvaluatedBy.GetFacadeCreate().Delete(mDEvaluatedByEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _EvaluatedByID = 0; _MDEvaluatedByEntity = new MDEvaluatedByEntity(); PrepareInitialView(); BindMDEvaluatedByList(); MiscUtil.ShowMessage(lblMessage, "Evaluated By has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Evaluated By.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <MDEvaluatedByEntity> GetData() { IList <MDEvaluatedByEntity> mDEvaluatedByEntityList = new List <MDEvaluatedByEntity>(); try { mDEvaluatedByEntityList = FCCMDEvaluatedBy.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (mDEvaluatedByEntityList != null && mDEvaluatedByEntityList.Count > 0) { totalRowCount = mDEvaluatedByEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDEvaluatedByEntityList ?? new List <MDEvaluatedByEntity>()); }