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