Esempio n. 1
0
 /// <summary>
 /// Добавление нового контрагента
 /// </summary>
 private void GridAgents_AddBtn_Click(object sender, System.EventArgs e)
 {
     using (AgentsEditForm f = new AgentsEditForm())
     {
         f.ShowDialog();
         this.RA.Add(f.agentEdit);
         this.GridAgents.Grid.DataSource = RA.Agents();
         this.GridAgents.Grid.Refresh();
         this.RA.Save();
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Редактирование контрагента
        /// </summary>
        private void GridAgents_EditBtn_Click(object sender, System.EventArgs e)
        {
            Agent editAgent = (Agent)this.GridAgents.Grid.SelectedRows[0].DataBoundItem;

            using (AgentsEditForm f = new AgentsEditForm(editAgent))
            {
                f.ShowDialog();
                this.RA.Edit(f.agentEdit);
                this.GridAgents.Grid.DataSource = RA.Agents();
                this.GridAgents.Grid.Refresh();
                this.RA.Save();

                // Вызов события обновление карточки эжедневника
                if (EventAgentEdit != null)
                {
                    EventAgentEdit();
                }
            }
        }