public IList <CMContractorAssignedWorkAreaEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <CMContractorAssignedWorkAreaEntity> cMContractorAssignedWorkAreaEntityList = new List <CMContractorAssignedWorkAreaEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = CMContractorAssignedWorkAreaEntity.FLD_NAME_ContractorAssignedWorkAreaID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; cMContractorAssignedWorkAreaEntityList = FCCCMContractorAssignedWorkArea.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (cMContractorAssignedWorkAreaEntityList != null && cMContractorAssignedWorkAreaEntityList.Count > 0) { totalRowCount = cMContractorAssignedWorkAreaEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(cMContractorAssignedWorkAreaEntityList ?? new List <CMContractorAssignedWorkAreaEntity>()); }
private void SaveCMContractorAssignedWorkAreaEntity() { if (IsValid) { try { CMContractorAssignedWorkAreaEntity cMContractorAssignedWorkAreaEntity = BuildCMContractorAssignedWorkAreaEntity(); Int64 result = -1; if (cMContractorAssignedWorkAreaEntity.IsNew) { result = FCCCMContractorAssignedWorkArea.GetFacadeCreate().Add(cMContractorAssignedWorkAreaEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CMContractorAssignedWorkAreaEntity.FLD_NAME_ContractorAssignedWorkAreaID, cMContractorAssignedWorkAreaEntity.ContractorAssignedWorkAreaID.ToString(), SQLMatchType.Equal); result = FCCCMContractorAssignedWorkArea.GetFacadeCreate().Update(cMContractorAssignedWorkAreaEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _ContractorAssignedWorkAreaID = 0; _CMContractorAssignedWorkAreaEntity = new CMContractorAssignedWorkAreaEntity(); PrepareInitialView(); BindCMContractorAssignedWorkAreaList(); if (cMContractorAssignedWorkAreaEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "C MContractor Assigned Work Area Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "C MContractor Assigned Work Area Information has been updated successfully.", false); } } else { if (cMContractorAssignedWorkAreaEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add C MContractor Assigned Work Area Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update C MContractor Assigned Work Area Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvCMContractorAssignedWorkArea_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 ContractorAssignedWorkAreaID; Int64.TryParse(e.CommandArgument.ToString(), out ContractorAssignedWorkAreaID); if (ContractorAssignedWorkAreaID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _ContractorAssignedWorkAreaID = ContractorAssignedWorkAreaID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(CMContractorAssignedWorkAreaEntity.FLD_NAME_ContractorAssignedWorkAreaID, ContractorAssignedWorkAreaID.ToString(), SQLMatchType.Equal); CMContractorAssignedWorkAreaEntity cMContractorAssignedWorkAreaEntity = new CMContractorAssignedWorkAreaEntity(); result = FCCCMContractorAssignedWorkArea.GetFacadeCreate().Delete(cMContractorAssignedWorkAreaEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _ContractorAssignedWorkAreaID = 0; _CMContractorAssignedWorkAreaEntity = new CMContractorAssignedWorkAreaEntity(); PrepareInitialView(); BindCMContractorAssignedWorkAreaList(); MiscUtil.ShowMessage(lblMessage, "C MContractor Assigned Work Area has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete C MContractor Assigned Work Area.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <CMContractorAssignedWorkAreaEntity> GetData() { IList <CMContractorAssignedWorkAreaEntity> cMContractorAssignedWorkAreaEntityList = new List <CMContractorAssignedWorkAreaEntity>(); try { cMContractorAssignedWorkAreaEntityList = FCCCMContractorAssignedWorkArea.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (cMContractorAssignedWorkAreaEntityList != null && cMContractorAssignedWorkAreaEntityList.Count > 0) { totalRowCount = cMContractorAssignedWorkAreaEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(cMContractorAssignedWorkAreaEntityList ?? new List <CMContractorAssignedWorkAreaEntity>()); }