public async void FindWebServices() { try { CONIntegratorConfiguration data = ((CONIntegratorConfiguration)await EasyApp.Current.eToolsServer().ExecuteAsync(new CONIntegratorConfiguration { Active = true }, Actions.Find, Options.All, EasyApp.Current.DefaultDatabaseSettingName, "")); if (data.Entities != null && data.Entities.Count > 0) { foreach (CONIntegratorConfiguration item in data.Entities) { if (Model.SQLSends == null || Model.SQLSends.Count == 0) { Model.SQLSends = new BindingList <CONSQLSend>(); } CONSQLSend exists = Model.SQLSends.FirstOrDefault(x => x.CONIntegratorConfiguration.Id == item.Id); if (exists == null) { Model.SQLSends.Add(new CONSQLSend { CONIntegratorConfiguration = item }); } } } } catch (Exception ex) { MessageBox.Show(new BusinessException(ex).GetExceptionMessage(), "Error", MessageBoxButton.OK); FormIsBusy = false; PostFindAction("", 0, new BusinessException(ex).GetExceptionMessage()); } }
public override void SetQueryParameters(IQuery query, CONIntegratorConfiguration data, Boolean byId) { base.SetQueryParameters(query, data, byId); if (byId) { //add more parameters to method for query by id } else { //Determine if the boolean values are taken included as part of the consultation query.SetBoolean("Active", data.Active); //query.SetBoolean("DirectImport", data.DirectImport); //add more parameters to method for query by any field if (data.Integrator != null && data.Integrator.Id != 0) { query.SetInt32("Integrator", data.Integrator.Id); } if (data.Connection != null && data.Connection.Id != 0) { query.SetInt32("Connection", data.Connection.Id); } if (data.Company != null && data.Company.Id != 0) { query.SetInt32("Company", data.Company.Id); } } }
public override String GetQuery(CONIntegratorConfiguration data, Boolean byId) { String dml = base.GetQuery(data, byId); if (byId) { //add more parameters to method for query by id } else { //Determine if the boolean values are taken included as part of the consultation dml += " AND a.Active = :Active \n"; //dml += " AND a.DirectImport = :DirectImport \n"; //add more parameters to method for query by any field if (data.Integrator != null && data.Integrator.Id != 0) { dml += " AND a.Integrator.Id = :Integrator \n"; } if (data.Connection != null && data.Connection.Id != 0) { dml += " AND a.Connection.Id = :Connection \n"; } if (data.Company != null && data.Company.Id != 0) { dml += " AND a.Company.Id = :Company \n"; } dml += " order by a.Id asc "; } return(dml); }
public override async void DeleteAction() { try { if (Model.IsValid) { Model.UpdatedBy = EasyApp.Current.User.Login; CONIntegratorConfiguration data = ((CONIntegratorConfiguration)await EasyApp.Current.eToolsServer().ExecuteAsync(Model.Entity, Actions.Remove, Options.Me, EasyApp.Current.DefaultDatabaseSettingName, "")); if (data != null) { Model.Details.Remove(data); } PostDeleteAction(""); MessageBoxResult result = MessageBox.Show("Registro eliminado correctamente", "Eliminando", MessageBoxButton.OK, MessageBoxImage.Question); OnNewCommand(new object()); } else { MessageBox.Show("Hay validaciones pendientes por favor verifique.", "Información", MessageBoxButton.OK, MessageBoxImage.Information); PostDeleteAction("Hay validaciones pendientes por favor verifique."); } } catch (FaultException ex) { MessageBox.Show(new BusinessException(ex).GetExceptionMessage(), "Error", MessageBoxButton.OK); PostDeleteAction(new BusinessException(ex).GetExceptionMessage()); } catch (Exception ex) { MessageBox.Show(new BusinessException(ex).GetExceptionMessage(), "Error", MessageBoxButton.OK); PostDeleteAction(new BusinessException(ex).GetExceptionMessage()); } }
public override CONIntegratorConfiguration Execute(CONIntegratorConfiguration data, Actions action, Options option, string token) { try { if (action == Actions.Add || action == Actions.Modify || action == Actions.Remove || (action == Actions.Find && (option == Options.Me || option == Options.Exist))) { if ((action == Actions.Add || action == Actions.Modify) && option == Options.All) { BenginTransaction(); cONSQLSendDl = new CONSQLSendBLL(Work); } data = base.Execute(data, action, option, token); if (action == Actions.Find && option == Options.Me) { cONSQLSendDl = new CONSQLSendBLL(this.Work.Settings); data.SQLSends = cONSQLSendDl.FindAll(new CONSQLSend { CONIntegratorConfigurationId = data.Id }, Options.All); } if ((action == Actions.Add || action == Actions.Modify) && option == Options.All) { AddDetails(data); } //if (option == Options.All) // Work.Commit(); return(data); } else if (action == Actions.Find && (option == Options.All || option == Options.Light)) { if (option == Options.All) { data.Entities = FindAll(data, Options.All); } else if (option == Options.Light) { data.Entities = FindAll(data, Options.Light); } return(data); } else { throw new NotImplementedException(GetLocalizedMessage(Language.DLACTIONNOTIMPLEMENT, action.ToString(), option.ToString())); } } catch (FaultException <BusinessException> f) { Rollback(); throw f; } catch (Exception e) { Rollback(); throw new BusinessException(e).GetFaultException(); } finally { Commit(); } }
public override async void SaveAction(bool createNew) { try { if (Model.IsValid) { Model.UpdatedBy = EasyApp.Current.User.Login; CONIntegratorConfiguration data = ((CONIntegratorConfiguration)await EasyApp.Current.eToolsServer().ExecuteAsync(Model.Entity, (Model.Id == 0 ? Actions.Add : Actions.Modify), Options.Me, EasyApp.Current.DefaultDatabaseSettingName, "")); if (data != null) { if (Model.Details.IndexOf(data) != -1) { Model.Details[Model.Details.IndexOf(data)] = data; } else { Model.Details.Add(data); } Model.Entity = data; } PostSaveAction(""); MessageBoxResult result2 = MessageBox.Show("Registro guardado correctamente", "Información", MessageBoxButton.OK, MessageBoxImage.Information); if (createNew) { MessageBoxResult result = MessageBox.Show("Registro guardado correctamente, desea crear un nuevo registro", "Nuevo Registro", MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { OnNewCommand(new object()); } } } else { MessageBox.Show("Hay validaciones pendientes por favor verifique.", "Información", MessageBoxButton.OK, MessageBoxImage.Information); PostSaveAction("Hay validaciones pendientes por favor verifique."); } } catch (FaultException ex) { MessageBox.Show(new BusinessException(ex).GetExceptionMessage(), "Error", MessageBoxButton.OK); PostSaveAction(new BusinessException(ex).GetExceptionMessage()); } catch (Exception ex) { MessageBox.Show(new BusinessException(ex).GetExceptionMessage(), "Error", MessageBoxButton.OK); PostSaveAction(new BusinessException(ex).GetExceptionMessage()); } }
public void AddDetails(CONIntegratorConfiguration data) { if (data.SQLSends != null && data.SQLSends.Count > 0) { for (int i = 0; i < data.SQLSends.Count; i++) { data.SQLSends[i].CONIntegratorConfigurationId = data.Id; data.SQLSends[i].LastUpdate = DateTime.Now; data.SQLSends[i].UpdatedBy = data.UpdatedBy; if (data.SQLSends[i].SQL != null) { data.SQLSends[i].SQLId = data.SQLSends[i].SQL.Id; } if (data.SQLSends[i].Id == 0) { data.SQLSends[i] = cONSQLSendDl.Add(data.SQLSends[i]); } else { data.SQLSends[i] = cONSQLSendDl.Modify(data.SQLSends[i]); } } } }
public override async void FindAction() { try { CONIntegratorConfiguration data = ((CONIntegratorConfiguration)await EasyApp.Current.eToolsServer().ExecuteAsync(Model.Entity, Actions.Find, Options.All, EasyApp.Current.DefaultDatabaseSettingName, "")); if (data.Entities != null && data.Entities.Count > 0) { Model.Details = new BindingList <CONIntegratorConfiguration>(data.Entities); } PostFindAction("CONIntegratorConfigurations", Model.Details.Count, ""); } catch (FaultException ex) { MessageBox.Show(new BusinessException(ex).GetExceptionMessage(), "Error", MessageBoxButton.OK); FormIsBusy = false; PostFindAction("", 0, new BusinessException(ex).GetExceptionMessage()); } catch (Exception ex) { MessageBox.Show(new BusinessException(ex).GetExceptionMessage(), "Error", MessageBoxButton.OK); FormIsBusy = false; PostFindAction("", 0, new BusinessException(ex).GetExceptionMessage()); } }
public override void FindByIdRules(CONIntegratorConfiguration data) { base.FindByIdRules(data); }
public override void RemoveRules(CONIntegratorConfiguration data) { base.RemoveRules(data); }
public override void ModifyRules(CONIntegratorConfiguration data) { base.ModifyRules(data); data.LastUpdate = DateTime.Now; }
public override void CommonRules(CONIntegratorConfiguration data) { base.CommonRules(data); }
public override List <CONIntegratorConfiguration> FindAll(CONIntegratorConfiguration data, Options option) { return(base.FindAll(data, option)); }
public override CONIntegratorConfiguration FindById(CONIntegratorConfiguration data) { return(base.FindById(data)); }
public override void AddMoreDetailFindById(CONIntegratorConfiguration data) { }
public override void SaveOrUpdateDetails(CONIntegratorConfiguration data) { base.SaveOrUpdateDetails(data); }