Ejemplo n.º 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         Trades.FinalTrade(sqlConnection, ItemId, Convert.ToInt32(PaymentInstrumentCB.SelectedValue), Convert.ToInt32(PaymentInstrumentCB.SelectedValue));
         Trades.DeleteLink(sqlConnection, LinkId);
         MessageBox.Show("Заявка подтверждена.");
         this.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Ejemplo n.º 2
0
 private void RefuseButton_Click(object sender, EventArgs e)
 {
     try
     {
         ConvertData();
         if (Trades.FirstManager(SqlConnection, Id))
         {
             EstateObjects.UpdateStatus(SqlConnection, Id, 1);
             int linkid = Trades.FindLinkId(SqlConnection, Id);
             Trades.DeleteLink(SqlConnection, linkid);
             MessageBox.Show("Заявка отклонена");
         }
         this.Close();
     }
     catch (Exception t)
     {
         MessageBox.Show(t.ToString());
     }
 }
Ejemplo n.º 3
0
        private void RefuseButton_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count > 0)
            {
                int  index     = dataGridView1.SelectedRows[0].Index;
                int  id        = 0;
                bool converted = Int32.TryParse(dataGridView1[0, index].Value.ToString(), out id);
                if (converted == false)
                {
                    return;
                }

                try
                {
                    Trades.DeleteTrade(SqlConnection, id);
                    Trades.DeleteLink(SqlConnection, id);
                    MessageBox.Show("Заявка удалена.");
                }
                catch (Exception r)
                {
                    MessageBox.Show(r.ToString());
                }
            }
        }