public IList <MDConstructionToolCategoryEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <MDConstructionToolCategoryEntity> mDConstructionToolCategoryEntityList = new List <MDConstructionToolCategoryEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = MDConstructionToolCategoryEntity.FLD_NAME_ConstructionToolCategoryID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; mDConstructionToolCategoryEntityList = FCCMDConstructionToolCategory.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (mDConstructionToolCategoryEntityList != null && mDConstructionToolCategoryEntityList.Count > 0) { totalRowCount = mDConstructionToolCategoryEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDConstructionToolCategoryEntityList ?? new List <MDConstructionToolCategoryEntity>()); }
private void SaveMDConstructionToolCategoryEntity() { if (IsValid) { try { MDConstructionToolCategoryEntity mDConstructionToolCategoryEntity = BuildMDConstructionToolCategoryEntity(); Int64 result = -1; if (mDConstructionToolCategoryEntity.IsNew) { result = FCCMDConstructionToolCategory.GetFacadeCreate().Add(mDConstructionToolCategoryEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDConstructionToolCategoryEntity.FLD_NAME_ConstructionToolCategoryID, mDConstructionToolCategoryEntity.ConstructionToolCategoryID.ToString(), SQLMatchType.Equal); result = FCCMDConstructionToolCategory.GetFacadeCreate().Update(mDConstructionToolCategoryEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _ConstructionToolCategoryID = 0; _MDConstructionToolCategoryEntity = new MDConstructionToolCategoryEntity(); PrepareInitialView(); BindMDConstructionToolCategoryList(); if (mDConstructionToolCategoryEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Construction Tool Category Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Construction Tool Category Information has been updated successfully.", false); } } else { if (mDConstructionToolCategoryEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Construction Tool Category Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Construction Tool Category Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvMDConstructionToolCategory_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 ConstructionToolCategoryID; Int64.TryParse(e.CommandArgument.ToString(), out ConstructionToolCategoryID); if (ConstructionToolCategoryID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _ConstructionToolCategoryID = ConstructionToolCategoryID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(MDConstructionToolCategoryEntity.FLD_NAME_ConstructionToolCategoryID, ConstructionToolCategoryID.ToString(), SQLMatchType.Equal); MDConstructionToolCategoryEntity mDConstructionToolCategoryEntity = new MDConstructionToolCategoryEntity(); result = FCCMDConstructionToolCategory.GetFacadeCreate().Delete(mDConstructionToolCategoryEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _ConstructionToolCategoryID = 0; _MDConstructionToolCategoryEntity = new MDConstructionToolCategoryEntity(); PrepareInitialView(); BindMDConstructionToolCategoryList(); MiscUtil.ShowMessage(lblMessage, "Construction Tool Category has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Construction Tool Category.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <MDConstructionToolCategoryEntity> GetData() { IList <MDConstructionToolCategoryEntity> mDConstructionToolCategoryEntityList = new List <MDConstructionToolCategoryEntity>(); try { mDConstructionToolCategoryEntityList = FCCMDConstructionToolCategory.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (mDConstructionToolCategoryEntityList != null && mDConstructionToolCategoryEntityList.Count > 0) { totalRowCount = mDConstructionToolCategoryEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDConstructionToolCategoryEntityList ?? new List <MDConstructionToolCategoryEntity>()); }