Ejemplo n.º 1
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            string action = entity.Id > 0 ? "Modification" : "Insertion";

            try
            {
                Langue y = RecopieView();
                if (ControleView(y))
                {
                    if (y.Id > 0)
                    {
                        dao.Update(y);
                        Action(y, 2, false);
                    }
                    else
                    {
                        y         = dao.Insert(y);
                        entity.Id = y.Id;
                        Action(y, 1, false);
                    }
                    ResetView();
                    Messages.Succes();
                }
            }
            catch (Exception ex)
            {
                Messages.Error(action + " impossible!");
                Logs.Exception("Form_Langue (btn_save_Click)", ex);
            }
        }