public IList <MDApprovalRuleDesignationMapEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <MDApprovalRuleDesignationMapEntity> mDApprovalRuleDesignationMapEntityList = new List <MDApprovalRuleDesignationMapEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = MDApprovalRuleDesignationMapEntity.FLD_NAME_ApprovalRuleDesignationMapID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; mDApprovalRuleDesignationMapEntityList = FCCMDApprovalRuleDesignationMap.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (mDApprovalRuleDesignationMapEntityList != null && mDApprovalRuleDesignationMapEntityList.Count > 0) { totalRowCount = mDApprovalRuleDesignationMapEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDApprovalRuleDesignationMapEntityList ?? new List <MDApprovalRuleDesignationMapEntity>()); }
private void SaveMDApprovalRuleDesignationMapEntity() { if (IsValid) { try { MDApprovalRuleDesignationMapEntity mDApprovalRuleDesignationMapEntity = BuildMDApprovalRuleDesignationMapEntity(); Int64 result = -1; if (mDApprovalRuleDesignationMapEntity.IsNew) { result = FCCMDApprovalRuleDesignationMap.GetFacadeCreate().Add(mDApprovalRuleDesignationMapEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDApprovalRuleDesignationMapEntity.FLD_NAME_ApprovalRuleDesignationMapID, mDApprovalRuleDesignationMapEntity.ApprovalRuleDesignationMapID.ToString(), SQLMatchType.Equal); result = FCCMDApprovalRuleDesignationMap.GetFacadeCreate().Update(mDApprovalRuleDesignationMapEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _ApprovalRuleDesignationMapID = 0; _MDApprovalRuleDesignationMapEntity = new MDApprovalRuleDesignationMapEntity(); PrepareInitialView(); BindMDApprovalRuleDesignationMapList(); if (mDApprovalRuleDesignationMapEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Approval Rule Designation Map Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Approval Rule Designation Map Information has been updated successfully.", false); } } else { if (mDApprovalRuleDesignationMapEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Approval Rule Designation Map Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Approval Rule Designation Map Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvMDApprovalRuleDesignationMap_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 ApprovalRuleDesignationMapID; Int64.TryParse(e.CommandArgument.ToString(), out ApprovalRuleDesignationMapID); if (ApprovalRuleDesignationMapID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _ApprovalRuleDesignationMapID = ApprovalRuleDesignationMapID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(MDApprovalRuleDesignationMapEntity.FLD_NAME_ApprovalRuleDesignationMapID, ApprovalRuleDesignationMapID.ToString(), SQLMatchType.Equal); MDApprovalRuleDesignationMapEntity mDApprovalRuleDesignationMapEntity = new MDApprovalRuleDesignationMapEntity(); result = FCCMDApprovalRuleDesignationMap.GetFacadeCreate().Delete(mDApprovalRuleDesignationMapEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _ApprovalRuleDesignationMapID = 0; _MDApprovalRuleDesignationMapEntity = new MDApprovalRuleDesignationMapEntity(); PrepareInitialView(); BindMDApprovalRuleDesignationMapList(); MiscUtil.ShowMessage(lblMessage, "Approval Rule Designation Map has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Approval Rule Designation Map.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <MDApprovalRuleDesignationMapEntity> GetData() { IList <MDApprovalRuleDesignationMapEntity> mDApprovalRuleDesignationMapEntityList = new List <MDApprovalRuleDesignationMapEntity>(); try { mDApprovalRuleDesignationMapEntityList = FCCMDApprovalRuleDesignationMap.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (mDApprovalRuleDesignationMapEntityList != null && mDApprovalRuleDesignationMapEntityList.Count > 0) { totalRowCount = mDApprovalRuleDesignationMapEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDApprovalRuleDesignationMapEntityList ?? new List <MDApprovalRuleDesignationMapEntity>()); }