Beispiel #1
0
        protected override async Task SaveChanges()
        {
            if (!Validar())
            {
                return;
            }
            LogicModel logicModel = new LogicModel();

            try
            {
                if (_currentEntity.Id > 0)
                {
                    await logicModel.UpdateModel(MapFromForm());

                    base.ShowInfo("Modelo modificado correctamente.", "Modificar Modelo.");
                }
                else
                {
                    await logicModel.AddNewModel(MapFromForm());

                    base.ShowInfo("Modelo agregado correctamente.", "Modificar Modelo.");
                }
                if (Caller == ManagePhones.Util.Enums.CallerType.Panel)
                {
                    Panels.ManageModels.Instancia.LoadData();
                }
                this.Close();
            }
            catch (LoggedException logex)
            {
                base.ShowError(logex.Message, "Modificar Modelo.");
            }
        }