Exemplo n.º 1
0
 private void tSBDelete_Click(object sender, EventArgs e)
 {
     if (this.dgvRiverList.SelectedRows.Count < 1)
     {
         return;
     }
     try
     {
         this.river = new RiverClass()
         {
             Id     = (int)this.dgvRiverList.SelectedRows[0].Cells[0].Value,
             Name   = (string)this.dgvRiverList.SelectedRows[0].Cells[2].Value,
             Number = (int)this.dgvRiverList.SelectedRows[0].Cells[3].Value,
             Status = (byte)2
         };
         this.dgvRiverList.Rows.RemoveAt(this.dgvRiverList.SelectedRows[0].Index);
         // ISSUE: reference to a compiler-generated field
         if (this.GetChangeRiver != null)
         {
             // ISSUE: reference to a compiler-generated field
             this.GetChangeRiver((object)this, e);
         }
         this.river = (RiverClass)null;
     }
     catch (Exception ex)
     {
         int num = (int)MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 2
0
 private void tSBEditing_Click(object sender, EventArgs e)
 {
     if (this.dgvRiverList.SelectedRows.Count < 1)
     {
         return;
     }
     try
     {
         this.river = new RiverClass()
         {
             Id     = (int)this.dgvRiverList.SelectedRows[0].Cells[0].Value,
             Name   = (string)this.dgvRiverList.SelectedRows[0].Cells[2].Value,
             Number = (int)this.dgvRiverList.SelectedRows[0].Cells[3].Value,
             Status = (byte)this.dgvRiverList.SelectedRows[0].Cells[4].Value
         };
         NewRiverForm newRiverForm = new NewRiverForm(this.river);
         newRiverForm.GetRiver += new EventHandler(this.GetRiver);
         int num = (int)newRiverForm.ShowDialog();
         this.river = (RiverClass)null;
     }
     catch (Exception ex)
     {
         int num = (int)MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 3
0
 public NewRiverForm(RiverClass river)
 {
     this.InitializeComponent();
     this.river       = river;
     this.Id          = river.Id;
     this.key         = (byte)1;
     this.tbName.Text = river.Name;
     this.tbKey.Text  = river.Number.ToString();
 }
Exemplo n.º 4
0
 private void GetRiver(object sender, EventArgs e)
 {
     this.river = (sender as NewRiverForm).river;
     if (this.river == null)
     {
         return;
     }
     if ((int)this.river.Status == 0)
     {
         // ISSUE: reference to a compiler-generated field
         if (this.GetChangeRiver != null)
         {
             // ISSUE: reference to a compiler-generated field
             this.GetChangeRiver((object)this, e);
         }
         this.river.Id = Form1.StaticId;
         if (this.river.Id < 0)
         {
             return;
         }
         this.river.Status = (byte)4;
         this.dgvRiverList.Rows.Add((object)this.river.Id, (object)(this.dgvRiverList.RowCount + 1), (object)this.river.Name, (object)this.river.Number, (object)this.river.Status);
     }
     else
     {
         this.river.Status = (byte)1;
         // ISSUE: reference to a compiler-generated field
         if (this.GetChangeRiver != null)
         {
             // ISSUE: reference to a compiler-generated field
             this.GetChangeRiver((object)this, e);
         }
         this.river.Status = (byte)4;
         if (Form1.StaticId < 0)
         {
             return;
         }
         this.dgvRiverList.SelectedRows[0].Cells[0].Value = (object)this.river.Id;
         this.dgvRiverList.SelectedRows[0].Cells[2].Value = (object)this.river.Name;
         this.dgvRiverList.SelectedRows[0].Cells[3].Value = (object)this.river.Number;
         this.dgvRiverList.SelectedRows[0].Cells[4].Value = (object)this.river.Status;
     }
 }
Exemplo n.º 5
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     this.river = new RiverClass();
     if (this.tbName.Text == "" || this.tbName.Text == null)
     {
         int num1 = (int)MessageBox.Show("Наеминование не заполнение");
     }
     else
     {
         int result = 0;
         if (!int.TryParse(this.tbKey.Text, out result))
         {
             int num2 = (int)MessageBox.Show("Код должно целое число");
         }
         else
         {
             this.river.Name   = this.tbName.Text;
             this.river.Number = result;
             if ((int)this.key == 0)
             {
                 this.river.Status = (byte)0;
             }
             else
             {
                 this.river.Status = (byte)1;
                 this.river.Id     = this.Id;
             }
             // ISSUE: reference to a compiler-generated field
             if (this.GetRiver != null)
             {
                 // ISSUE: reference to a compiler-generated field
                 this.GetRiver((object)this, e);
             }
             this.Close();
         }
     }
 }
Exemplo n.º 6
0
 public NewRiverForm()
 {
     this.InitializeComponent();
     this.river = (RiverClass)null;
 }