public override async void SaveAction(bool createNew) { try { if (Model.IsValid) { Model.UpdatedBy = EasyApp.Current.User.Login; WSCONCESIONESTIENDA data = ((WSCONCESIONESTIENDA)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(createNew: true); } } else { PostSaveAction(errorTitle: GetLocalizedMessage(Language.ApplicationInformation), errorMessage: GetLocalizedMessage(Language.ApplicationPendingValidations), showMessageError: true, createNew: false, image: MessageBoxImage.Information); } } catch (Exception ex) { PostSaveAction(errorTitle: GetLocalizedMessage(Language.ApplicationError), errorMessage: new BusinessException(ex).GetExceptionMessage(), showMessageError: true, createNew: false, image: MessageBoxImage.Error); } }
public override void SetQueryParameters(IQuery query, WSCONCESIONESTIENDA data, Boolean byId) { base.SetQueryParameters(query, data, byId); if (byId) { //add more parameters to method for query by id } else { //add more parameters to method for query by any field } }
public override WSCONCESIONESTIENDA Execute(WSCONCESIONESTIENDA data, Actions action, Options option, string token) { if (action == Actions.Add || action == Actions.Modify || action == Actions.Remove || (action == Actions.Find && (option == Options.Me || option == Options.Exist))) { data = base.Execute(data, action, option, ""); return(data); } else if (action == Actions.Find && (option == Options.All || option == Options.Light)) { data.Entities = FindAll(data, option); return(data); } else { throw new NotImplementedException(GetLocalizedMessage(Language.DLACTIONNOTIMPLEMENT, action.ToString(), option.ToString())); } }
public override String GetQuery(WSCONCESIONESTIENDA data, Boolean byId) { String dml = base.GetQuery(data, byId); if (byId) { //add more parameters to method for query by id } else { //add more parameters to method for query by any field dml += " order by a.Id asc "; } return(dml); }
public override async void FindAction() { try { WSCONCESIONESTIENDA data = ((WSCONCESIONESTIENDA)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 <WSCONCESIONESTIENDA>(data.Entities); } else { Model.Details = new BindingList <WSCONCESIONESTIENDA>(); } PostFindAction(queryName: "WS_CONCESIONES_TIENDAS", recordNumber: Model.Details.Count, errorMessage: ""); } catch (Exception ex) { PostFindAction("", 0, new BusinessException(ex).GetExceptionMessage()); } }
public override async void DeleteAction() { try { if (Model.IsValid) { Model.UpdatedBy = EasyApp.Current.User.Login; WSCONCESIONESTIENDA data = ((WSCONCESIONESTIENDA)await EasyApp.Current.eToolsServer().ExecuteAsync(Model.Entity, Actions.Remove, Options.Me, EasyApp.Current.DefaultDatabaseSettingName, "")); if (data != null) { Model.Details.Remove(data); PostDeleteAction(); } } else { PostDeleteAction(errorTitle: GetLocalizedMessage(Language.ApplicationInformation), errorMessage: GetLocalizedMessage(Language.ApplicationPendingValidations), showMessageError: true, image: MessageBoxImage.Information); } } catch (Exception ex) { PostDeleteAction(errorTitle: GetLocalizedMessage(Language.ApplicationError), errorMessage: new BusinessException(ex).GetExceptionMessage(), showMessageError: true, image: MessageBoxImage.Error); } }
public override void FindByIdRules(WSCONCESIONESTIENDA data) { base.FindByIdRules(data); }
public override void RemoveRules(WSCONCESIONESTIENDA data) { base.RemoveRules(data); }
public override void ModifyRules(WSCONCESIONESTIENDA data) { base.ModifyRules(data); data.LastUpdate = DateTime.Now; }
//public override void SaveOrUpdateDetails(WSCONCESIONESTIENDA data) //{ //} //public override void RemoveDetails(WSCONCESIONESTIENDA data) //{ //} #endregion #region Query Methods //public override void AddFindByIdDetails(WSCONCESIONESTIENDA data) //{ // //base.AddFindByIdDetails(data); //} #endregion #region Business Rules public override void CommonRules(WSCONCESIONESTIENDA data) { base.CommonRules(data); }