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