//this executes _off_ the UI thread static void CustomerSearchOnExecute(CustomerSearchArgs state) { // ReSharper disable InconsistentNaming using (var Customer_Search = new Proc("Customer_Search")) // ReSharper restore InconsistentNaming state.ResultTable = Customer_Search.AssignValues(state.Values).ExecuteDataSet(state).Tables[0]; }
//this happens off the UI thread void VendorSearchOnExecute(VendorSearchArgs state) { using (Proc Vendor_Search = new Proc("Vendor_Search")) { Vendor_Search.AssignValues(state.values); state.resultTable = Vendor_Search.ExecuteDataTable(state); } }
//this happens off the UI thread void SearchOnExecute(SearchArgs state) { using (Proc GoodsAndServices_Search = new Proc("GoodsAndServices_Search")) { GoodsAndServices_Search.AssignValues(state.values); state.resultTable = GoodsAndServices_Search.ExecuteDataTable(state); } }
protected bool SaveMe(bool isFiling = false, bool updateSponsor = true) { // generally, inserts and deletes will be edge cases handled elsewhere, modified fields on existing rows are the primary save scenario for child lists hanging off main entities like TaxForm (e.g. TaxFormRemarks) //pulling back on this for now... seems theoretically possible to save a pending NF2 with un-printed status just like NF1's, it's not "issued" until it's printed //if (IsClass2 && !Validate()) //{ // ShowUserMessage("It is invalid to save an NF2/EF2 that's not fully completed."); // return (false); //} if (Fields.IsDirty()) //the "Fields" logic does actually need to be here if called from FileForm() rather than base.Save(); { // ReSharper disable InconsistentNaming using (var TaxForm_u = new iTRAACProc("TaxForm_u")) // ReSharper restore InconsistentNaming { TaxForm_u.AssignValues(Fields); TaxForm_u["@IsFiling"] = isFiling; if (!TaxForm_u.ExecuteDataSet(UserMessagePrefix)) { return(false); } Fields.AcceptChanges(); if (isFiling) { CacheTables(TaxForm_u); } } if (updateSponsor) { OnFormStatusChange(); } } if (ExtendedFields.IsDirty()) { // ReSharper disable InconsistentNaming using (var TaxForm_TransactionTypeExt_u = new Proc("TaxForm_TransactionTypeExt_u")) // ReSharper restore InconsistentNaming { TaxForm_TransactionTypeExt_u.AssignValues(ExtendedFields); TaxForm_TransactionTypeExt_u["@TaxFormGUID"] = GUID; if (!TaxForm_TransactionTypeExt_u.ExecuteNonQuery(UserMessagePrefix)) { return(false); } } ExtendedFields.AcceptChanges(); } RemarkModel.SaveRemarks("FKRowGUID", GUID, UserMessagePrefix, TaxFormRemarks); return(true); }
protected bool SaveMe(bool isFiling = false, bool updateSponsor = true) { // generally, inserts and deletes will be edge cases handled elsewhere, modified fields on existing rows are the primary save scenario for child lists hanging off main entities like TaxForm (e.g. TaxFormRemarks) //pulling back on this for now... seems theoretically possible to save a pending NF2 with un-printed status just like NF1's, it's not "issued" until it's printed //if (IsClass2 && !Validate()) //{ // ShowUserMessage("It is invalid to save an NF2/EF2 that's not fully completed."); // return (false); //} if (Fields.IsDirty()) //the "Fields" logic does actually need to be here if called from FileForm() rather than base.Save(); { // ReSharper disable InconsistentNaming using (var TaxForm_u = new iTRAACProc("TaxForm_u")) // ReSharper restore InconsistentNaming { TaxForm_u.AssignValues(Fields); TaxForm_u["@IsFiling"] = isFiling; if (!TaxForm_u.ExecuteDataSet(UserMessagePrefix)) return (false); Fields.AcceptChanges(); if (isFiling) CacheTables(TaxForm_u); } if (updateSponsor) OnFormStatusChange(); } if (ExtendedFields.IsDirty()) { // ReSharper disable InconsistentNaming using (var TaxForm_TransactionTypeExt_u = new Proc("TaxForm_TransactionTypeExt_u")) // ReSharper restore InconsistentNaming { TaxForm_TransactionTypeExt_u.AssignValues(ExtendedFields); TaxForm_TransactionTypeExt_u["@TaxFormGUID"] = GUID; if (!TaxForm_TransactionTypeExt_u.ExecuteNonQuery(UserMessagePrefix)) return (false); } ExtendedFields.AcceptChanges(); } RemarkModel.SaveRemarks("FKRowGUID", GUID, UserMessagePrefix, TaxFormRemarks); return (true); }