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