public IList <CMConsultantEnlistedWorkAreaEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <CMConsultantEnlistedWorkAreaEntity> cMConsultantEnlistedWorkAreaEntityList = new List <CMConsultantEnlistedWorkAreaEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = CMConsultantEnlistedWorkAreaEntity.FLD_NAME_ConsultantEnlistedWorkAreaID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; cMConsultantEnlistedWorkAreaEntityList = FCCCMConsultantEnlistedWorkArea.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (cMConsultantEnlistedWorkAreaEntityList != null && cMConsultantEnlistedWorkAreaEntityList.Count > 0) { totalRowCount = cMConsultantEnlistedWorkAreaEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(cMConsultantEnlistedWorkAreaEntityList ?? new List <CMConsultantEnlistedWorkAreaEntity>()); }
private void SaveCMConsultantEnlistedWorkAreaEntity() { if (IsValid) { try { CMConsultantEnlistedWorkAreaEntity cMConsultantEnlistedWorkAreaEntity = BuildCMConsultantEnlistedWorkAreaEntity(); Int64 result = -1; if (cMConsultantEnlistedWorkAreaEntity.IsNew) { result = FCCCMConsultantEnlistedWorkArea.GetFacadeCreate().Add(cMConsultantEnlistedWorkAreaEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CMConsultantEnlistedWorkAreaEntity.FLD_NAME_ConsultantEnlistedWorkAreaID, cMConsultantEnlistedWorkAreaEntity.ConsultantEnlistedWorkAreaID.ToString(), SQLMatchType.Equal); result = FCCCMConsultantEnlistedWorkArea.GetFacadeCreate().Update(cMConsultantEnlistedWorkAreaEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _ConsultantEnlistedWorkAreaID = 0; _CMConsultantEnlistedWorkAreaEntity = new CMConsultantEnlistedWorkAreaEntity(); PrepareInitialView(); BindCMConsultantEnlistedWorkAreaList(); if (cMConsultantEnlistedWorkAreaEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Consultant Enlisted Work Area Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Consultant Enlisted Work Area Information has been updated successfully.", false); } } else { if (cMConsultantEnlistedWorkAreaEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Consultant Enlisted Work Area Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Consultant Enlisted Work Area Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvCMConsultantEnlistedWorkArea_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 ConsultantEnlistedWorkAreaID; Int64.TryParse(e.CommandArgument.ToString(), out ConsultantEnlistedWorkAreaID); if (ConsultantEnlistedWorkAreaID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _ConsultantEnlistedWorkAreaID = ConsultantEnlistedWorkAreaID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(CMConsultantEnlistedWorkAreaEntity.FLD_NAME_ConsultantEnlistedWorkAreaID, ConsultantEnlistedWorkAreaID.ToString(), SQLMatchType.Equal); CMConsultantEnlistedWorkAreaEntity cMConsultantEnlistedWorkAreaEntity = new CMConsultantEnlistedWorkAreaEntity(); result = FCCCMConsultantEnlistedWorkArea.GetFacadeCreate().Delete(cMConsultantEnlistedWorkAreaEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _ConsultantEnlistedWorkAreaID = 0; _CMConsultantEnlistedWorkAreaEntity = new CMConsultantEnlistedWorkAreaEntity(); PrepareInitialView(); BindCMConsultantEnlistedWorkAreaList(); MiscUtil.ShowMessage(lblMessage, "Consultant Enlisted Work Area has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Consultant Enlisted Work Area.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <CMConsultantEnlistedWorkAreaEntity> GetData() { IList <CMConsultantEnlistedWorkAreaEntity> cMConsultantEnlistedWorkAreaEntityList = new List <CMConsultantEnlistedWorkAreaEntity>(); try { cMConsultantEnlistedWorkAreaEntityList = FCCCMConsultantEnlistedWorkArea.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (cMConsultantEnlistedWorkAreaEntityList != null && cMConsultantEnlistedWorkAreaEntityList.Count > 0) { totalRowCount = cMConsultantEnlistedWorkAreaEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(cMConsultantEnlistedWorkAreaEntityList ?? new List <CMConsultantEnlistedWorkAreaEntity>()); }