public IList <MDPreBOQStatusEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <MDPreBOQStatusEntity> mDPreBOQStatusEntityList = new List <MDPreBOQStatusEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = MDPreBOQStatusEntity.FLD_NAME_PreBOQStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; mDPreBOQStatusEntityList = FCCMDPreBOQStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (mDPreBOQStatusEntityList != null && mDPreBOQStatusEntityList.Count > 0) { totalRowCount = mDPreBOQStatusEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDPreBOQStatusEntityList ?? new List <MDPreBOQStatusEntity>()); }
private void SaveMDPreBOQStatusEntity() { if (IsValid) { try { MDPreBOQStatusEntity mDPreBOQStatusEntity = BuildMDPreBOQStatusEntity(); Int64 result = -1; if (mDPreBOQStatusEntity.IsNew) { result = FCCMDPreBOQStatus.GetFacadeCreate().Add(mDPreBOQStatusEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDPreBOQStatusEntity.FLD_NAME_PreBOQStatusID, mDPreBOQStatusEntity.PreBOQStatusID.ToString(), SQLMatchType.Equal); result = FCCMDPreBOQStatus.GetFacadeCreate().Update(mDPreBOQStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _PreBOQStatusID = 0; _MDPreBOQStatusEntity = new MDPreBOQStatusEntity(); PrepareInitialView(); BindMDPreBOQStatusList(); if (mDPreBOQStatusEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Pre BOQStatus Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Pre BOQStatus Information has been updated successfully.", false); } } else { if (mDPreBOQStatusEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Pre BOQStatus Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Pre BOQStatus Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvMDPreBOQStatus_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 PreBOQStatusID; Int64.TryParse(e.CommandArgument.ToString(), out PreBOQStatusID); if (PreBOQStatusID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _PreBOQStatusID = PreBOQStatusID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(MDPreBOQStatusEntity.FLD_NAME_PreBOQStatusID, PreBOQStatusID.ToString(), SQLMatchType.Equal); MDPreBOQStatusEntity mDPreBOQStatusEntity = new MDPreBOQStatusEntity(); result = FCCMDPreBOQStatus.GetFacadeCreate().Delete(mDPreBOQStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _PreBOQStatusID = 0; _MDPreBOQStatusEntity = new MDPreBOQStatusEntity(); PrepareInitialView(); BindMDPreBOQStatusList(); MiscUtil.ShowMessage(lblMessage, "Pre BOQStatus has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Pre BOQStatus.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <MDPreBOQStatusEntity> GetData() { IList <MDPreBOQStatusEntity> mDPreBOQStatusEntityList = new List <MDPreBOQStatusEntity>(); try { mDPreBOQStatusEntityList = FCCMDPreBOQStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (mDPreBOQStatusEntityList != null && mDPreBOQStatusEntityList.Count > 0) { totalRowCount = mDPreBOQStatusEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDPreBOQStatusEntityList ?? new List <MDPreBOQStatusEntity>()); }