Exemplo n.º 1
0
        private void DetaljiView(int id)
        {
            HttpResponseMessage responseN = narudzbeService.GetActionResponse("GetStavkeNarudzbe", id.ToString());

            if (responseN.IsSuccessStatusCode)
            {
                List <NarudzbaStavka> list = responseN.Content.ReadAsAsync <List <NarudzbaStavka> >().Result;
                DetaljiNarudzbe       form = new DetaljiNarudzbe(list);
                form.ShowDialog();
            }
            else
            {
                MessageBox.Show(Messages.error + ": " + responseN.ReasonPhrase, Messages.error, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
 private void PripremaDataGridView_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == 5)
     {
         int id = pripremaDataGridView.Rows[e.RowIndex].Cells[0].Value.ToInt();
         if (id == 0)
         {
             MessageBox.Show(Messages.order_id_error, Messages.warning, MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
         else
         {
             HttpResponseMessage responseN = narudzbeService.GetActionResponse("PrebaciUZavrsi", id.ToString());
             if (responseN.IsSuccessStatusCode)
             {
                 BindGridUPripremi();
             }
             else
             {
                 MessageBox.Show(Messages.error + ": " + responseN.ReasonPhrase, Messages.error, MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
     else if (e.ColumnIndex == 6)
     {
         int id = pripremaDataGridView.Rows[e.RowIndex].Cells[0].Value.ToInt();
         if (id == 0)
         {
             MessageBox.Show(Messages.order_id_error, Messages.warning, MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
         else
         {
             HttpResponseMessage responseN = narudzbeService.GetActionResponse("GetStavkeNarudzbe", id.ToString());
             if (responseN.IsSuccessStatusCode)
             {
                 List <NarudzbaStavka> list = responseN.Content.ReadAsAsync <List <NarudzbaStavka> >().Result;
                 DetaljiNarudzbe       form = new DetaljiNarudzbe(list);
                 form.ShowDialog();
             }
             else
             {
                 MessageBox.Show(Messages.error + ": " + responseN.ReasonPhrase, Messages.error, MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
 }