public void AddData(ModelNotifiedForCustomerCustomerDemo modelNotifiedForCustomerCustomerDemo, out string error) { CustomerCustomerDemoBsn bsn = new CustomerCustomerDemoBsn(wpfConfig); CustomerCustomerDemoInfo dbItem = new CustomerCustomerDemoInfo(); Cloner.CopyAllTo(typeof(ModelNotifiedForCustomerCustomerDemo), modelNotifiedForCustomerCustomerDemo, typeof(CustomerCustomerDemoInfo), dbItem); bsn.InsertOne(dbItem, out error); modelNotifiedForCustomerCustomerDemo.NewItem = false; Cloner.CopyAllTo(typeof(CustomerCustomerDemoInfo), dbItem, typeof(ModelNotifiedForCustomerCustomerDemo), modelNotifiedForCustomerCustomerDemo); }
public void TryInclude(CreateCustomerCustomerDemoView viewToInclude, out RestExceptionError error) { error = null; CustomerCustomerDemoInfo dbViewToInclude = new CustomerCustomerDemoInfo(); try { Cloner.CopyAllTo(typeof(CreateCustomerCustomerDemoView), viewToInclude, typeof(CustomerCustomerDemoInfo), dbViewToInclude); } catch (Exception ex) { error = new RestExceptionError(); error.InternalMessage = "Internal Error parsing data for (CustomerCustomerDemo.TryInclude/Parsing)"; error.ExceptionMessage = ex.Message; error.SourceError = RestExceptionError._SourceError.ServerSide; error.StackTrace = ex.StackTrace; } try { CustomerCustomerDemoBsn bsn = new CustomerCustomerDemoBsn(restConfig); string dbError = null; bsn.InsertOne(dbViewToInclude, out dbError); if (dbError != null) { error = new RestExceptionError(); error.InternalMessage = "Internal Error Save data for [CustomerCustomerDemo.TryInclude/Save]"; error.ExceptionMessage = dbError; error.SourceError = RestExceptionError._SourceError.ServerSide; error.StackTrace = ""; } } catch (Exception ex) { error = new RestExceptionError(); error.InternalMessage = "Internal Error Save data for [CustomerCustomerDemo.TryInclude/Save]"; error.ExceptionMessage = ex.Message; error.SourceError = RestExceptionError._SourceError.ServerSide; error.StackTrace = ex.StackTrace; } }