示例#1
0
 /// <summary>
 /// Add new manufacturer.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void NewBtn_Click(object sender, EventArgs e)
 {
     try
     {
         GXManufacturer   m   = new GXManufacturer();
         ManufacturerForm dlg = new ManufacturerForm(Manufacturers, m);
         if (dlg.ShowDialog(this) == DialogResult.OK)
         {
             Manufacturers.Add(m);
             AddManufacturer(m).Selected = true;
         }
     }
     catch (Exception Ex)
     {
         GXDLMS.Common.Error.ShowError(this, Ex);
     }
 }
示例#2
0
 /// <summary>
 /// Edit selected manufacturer's settings.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void EditBtn_Click(object sender, EventArgs e)
 {
     try
     {
         GXManufacturer   m   = (GXManufacturer)ManufacturersList.SelectedItems[0].Tag;
         ManufacturerForm dlg = new ManufacturerForm(Manufacturers, m);
         if (dlg.ShowDialog(this) == DialogResult.OK)
         {
             ManufacturersList.SelectedItems[0].Text = m.Name;
             UpdateValues();
         }
     }
     catch (Exception Ex)
     {
         GXDLMS.Common.Error.ShowError(this, Ex);
     }
 }
示例#3
0
 /// <summary>
 /// Add new manufacturer.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void NewBtn_Click(object sender, EventArgs e)
 {
     try
     {
         GXManufacturer m = new GXManufacturer();
         ManufacturerForm dlg = new ManufacturerForm(Manufacturers, m);
         if (dlg.ShowDialog(this) == DialogResult.OK)
         {
             Manufacturers.Add(m);
             AddManufacturer(m).Selected = true;
         }
     }
     catch (Exception Ex)
     {
         GXDLMS.Common.Error.ShowError(this, Ex);
     }
 }
示例#4
0
 /// <summary>
 /// Edit selected manufacturer's settings.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void EditBtn_Click(object sender, EventArgs e)
 {
     try
     {
         if (ManufacturersList.SelectedItems.Count == 1)
         {
             GXManufacturer m = (GXManufacturer)ManufacturersList.SelectedItems[0].Tag;
             ManufacturerForm dlg = new ManufacturerForm(Manufacturers, m);
             if (dlg.ShowDialog(this) == DialogResult.OK)
             {
                 ManufacturersList.SelectedItems[0].Text = m.Name;
                 UpdateValues();
             }
         }
     }
     catch (Exception Ex)
     {
         GXDLMS.Common.Error.ShowError(this, Ex);
     }
 }