public IList <CMConstructionToolEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <CMConstructionToolEntity> cMConstructionToolEntityList = new List <CMConstructionToolEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = CMConstructionToolEntity.FLD_NAME_ConstructionToolID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; cMConstructionToolEntityList = FCCCMConstructionTool.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (cMConstructionToolEntityList != null && cMConstructionToolEntityList.Count > 0) { totalRowCount = cMConstructionToolEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(cMConstructionToolEntityList ?? new List <CMConstructionToolEntity>()); }
private void SaveCMConstructionToolEntity() { if (IsValid) { try { CMConstructionToolEntity cMConstructionToolEntity = BuildCMConstructionToolEntity(); Int64 result = -1; if (cMConstructionToolEntity.IsNew) { result = FCCCMConstructionTool.GetFacadeCreate().Add(cMConstructionToolEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CMConstructionToolEntity.FLD_NAME_ConstructionToolID, cMConstructionToolEntity.ConstructionToolID.ToString(), SQLMatchType.Equal); result = FCCCMConstructionTool.GetFacadeCreate().Update(cMConstructionToolEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _ConstructionToolID = 0; _CMConstructionToolEntity = new CMConstructionToolEntity(); PrepareInitialView(); BindCMConstructionToolList(); if (cMConstructionToolEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Construction Tool Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Construction Tool Information has been updated successfully.", false); } } else { if (cMConstructionToolEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Construction Tool Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update C MConstruction Tool Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvCMConstructionTool_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 ConstructionToolID; Int64.TryParse(e.CommandArgument.ToString(), out ConstructionToolID); if (ConstructionToolID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _ConstructionToolID = ConstructionToolID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(CMConstructionToolEntity.FLD_NAME_ConstructionToolID, ConstructionToolID.ToString(), SQLMatchType.Equal); CMConstructionToolEntity cMConstructionToolEntity = new CMConstructionToolEntity(); result = FCCCMConstructionTool.GetFacadeCreate().Delete(cMConstructionToolEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _ConstructionToolID = 0; _CMConstructionToolEntity = new CMConstructionToolEntity(); PrepareInitialView(); BindCMConstructionToolList(); MiscUtil.ShowMessage(lblMessage, "Construction Tool has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Construction Tool.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
private void PopulateTree() { this.Nodes.Clear(); nodeList = FCCCMConstructionTool.GetFacadeCreate().GetIL(null, null, String.Empty, String.Empty, DatabaseOperationType.Load); toolDetailList = FCCCMConstructionToolDetail.GetFacadeCreate().GetIL(null, null, String.Empty, String.Empty, DatabaseOperationType.Load); TreeNode rootNode = new TreeNode(); rootNode.Text = RootNodeText; rootNode.Value = "0"; rootNode.SelectAction = TreeNodeSelectAction.Expand; rootNode.Expanded = true; LoadCategories(rootNode); this.Nodes.Add(rootNode); }
public IList <CMConstructionToolEntity> GetData() { IList <CMConstructionToolEntity> cMConstructionToolEntityList = new List <CMConstructionToolEntity>(); try { cMConstructionToolEntityList = FCCCMConstructionTool.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (cMConstructionToolEntityList != null && cMConstructionToolEntityList.Count > 0) { totalRowCount = cMConstructionToolEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(cMConstructionToolEntityList ?? new List <CMConstructionToolEntity>()); }