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