public override async void SaveAction(bool createNew)
 {
     try
     {
         if (Model.IsValid)
         {
             Model.UpdatedBy         = EasyApp.Current.User.Login;
             Model.FechaModificacion = DateTime.Now;
             WSCONCESIONE data = ((WSCONCESIONE)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);
     }
 }
Example #2
0
 public override void SetQueryParameters(IQuery query, WSCONCESIONE 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
     }
 }
Example #3
0
 public override WSCONCESIONE Execute(WSCONCESIONE 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()));
     }
 }
Example #4
0
        public override String GetQuery(WSCONCESIONE 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
     {
         WSCONCESIONE data = ((WSCONCESIONE)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 <WSCONCESIONE>(data.Entities);
         }
         else
         {
             Model.Details = new BindingList <WSCONCESIONE>();
         }
         PostFindAction(queryName: "WS_CONCESIONES", 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;
             WSCONCESIONE data = ((WSCONCESIONE)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);
     }
 }
Example #7
0
 public override void FindByIdRules(WSCONCESIONE data)
 {
     base.FindByIdRules(data);
 }
Example #8
0
 public override void RemoveRules(WSCONCESIONE data)
 {
     base.RemoveRules(data);
 }
Example #9
0
 public override void ModifyRules(WSCONCESIONE data)
 {
     base.ModifyRules(data);
     data.LastUpdate = DateTime.Now;
 }
Example #10
0
        //public override void SaveOrUpdateDetails(WSCONCESIONE data)
        //{
        //}

        //public override void RemoveDetails(WSCONCESIONE data)
        //{
        //}

        #endregion

        #region Query Methods

        //public override void AddFindByIdDetails(WSCONCESIONE data)
        //{
        //   //base.AddFindByIdDetails(data);
        //}

        #endregion

        #region Business Rules

        public override void CommonRules(WSCONCESIONE data)
        {
            base.CommonRules(data);
        }