Example #1
0
 private void btnAddNew_Click(object sender, EventArgs e)
 {
     DataSetTpos.agentsRow     agRow      = Classes.DB.DBclass.DS.agents.NewagentsRow();
     frontEnd.FormChangeAgents agentsForm = new FormChangeAgents(agRow, false);
     if (agentsForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         Classes.DB.DBclass.DS.agents.AddagentsRow(agRow);
         DataSetTposTableAdapters.agentsTableAdapter ata = new DataSetTposTableAdapters.agentsTableAdapter();
         ata.Update(Classes.DB.DBclass.DS.agents);
         ata.Fill(Classes.DB.DBclass.DS.agents);
     }
 }
Example #2
0
 private void dgvAgents_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         int Id = (int)dgvAgents.Rows[e.RowIndex].Cells["ID"].Value;
         DataSetTpos.agentsRow agRow             = Classes.DB.DBclass.DS.agents.Single <DataSetTpos.agentsRow>(crId => crId.ID == Id);
         SubForms.frontEnd.FormChangeAgents fcha = new FormChangeAgents(agRow, true);
         if (fcha.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             DataSetTposTableAdapters.agentsTableAdapter ata = new DataSetTposTableAdapters.agentsTableAdapter();
             ata.Update(Classes.DB.DBclass.DS.agents);
             ata.Fill(Classes.DB.DBclass.DS.agents);
         }
     }
 }