예제 #1
0
        private void InputForm_Load(object sender, EventArgs e)
        {
            DaneRepository = new DaneRepository(NHManager.OpenSession());
            DaneRepository.DaneList();
            try
            {
                if (DaneRepository.DaneList().Count > 0)
                {
                    listView1.Items.Clear();
                    listView2.Items.Clear();

                    var daneList = DaneRepository.DaneList();

                    for (int i = 0; i < daneList.Count; i++)
                    {
                        //pierwszy listView
                        listView1.Items.Add(daneList[i].ID.ToString());
                        listView1.Items[i].SubItems.Add(daneList[i].promien_ro);
                        listView1.Items[i].SubItems.Add(daneList[i].szerokosc_bo);
                        listView1.Items[i].SubItems.Add(daneList[i].wysH);
                        listView1.Items[i].SubItems.Add(daneList[i].wys_h);
                        listView1.Items[i].SubItems.Add(daneList[i].rd);
                        listView1.Items[i].SubItems.Add(daneList[i].bd);
                        listView1.Items[i].SubItems.Add(daneList[i].delta_h);

                        //drugi listView
                        listView2.Items.Add(daneList[i].ID.ToString());
                        listView2.Items[i].SubItems.Add(daneList[i].fi);
                        listView2.Items[i].SubItems.Add(daneList[i].sp_c);
                        listView2.Items[i].SubItems.Add(daneList[i].wsp_K);
                        listView2.Items[i].SubItems.Add(daneList[i].wyk_n);
                        listView2.Items[i].SubItems.Add(daneList[i].wsp_odkrzt_k);
                        listView2.Items[i].SubItems.Add(daneList[i].bp);
                        listView2.Items[i].SubItems.Add(daneList[i].Wd);
                        listView2.Items[i].SubItems.Add(daneList[i].yb);
                    }
                }
                else
                {
                    MessageBox.Show("Brak rekordów.", "Alert");
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.GetType().ToString()); }
        }
예제 #2
0
        private void Calc_Load(object sender, EventArgs e)
        {
            DaneRepository = new DaneRepository(NHManager.OpenSession());
            var dane = DaneRepository.GetDaneRecord(index);

            //try
            //{
            if (DaneRepository.DaneList().Count > 0)
            {
                listView1.Items.Clear();


                var daneList = DaneRepository.DaneList();

                string fii = string.Empty;

                ro = Convert.ToDouble(dane.promien_ro.Replace('.', ','));
                bo = Convert.ToDouble(dane.szerokosc_bo.Replace('.', ','));
                wH = Convert.ToDouble(dane.wysH.Replace('.', ','));
                wh = Convert.ToDouble(dane.wys_h.Replace('.', ','));
                rd = Convert.ToDouble(dane.rd.Replace('.', ','));

                bd  = Convert.ToDouble(dane.bd.Replace('.', ','));
                dh  = Convert.ToDouble(dane.delta_h.Replace('.', ','));
                fii = dane.fi.Replace('.', ',');

                if (!string.IsNullOrWhiteSpace(fii))
                {
                    fi = Convert.ToDouble(dane.fi);
                }
                else
                {
                    fi = 0;
                }
                spc  = Convert.ToDouble(dane.sp_c.Replace('.', ','));
                wspk = Convert.ToDouble(dane.wsp_K.Replace('.', ','));
                wykn = Convert.ToDouble(dane.wyk_n.Replace('.', ','));
                K    = Convert.ToDouble(dane.wsp_odkrzt_k.Replace('.', ','));
                bp   = Convert.ToDouble(dane.bp.Replace('.', ','));
                wd   = Convert.ToDouble(dane.Wd.Replace('.', ','));
                yb   = Convert.ToDouble(dane.yb.Replace('.', ','));
                jmax = Convert.ToDouble(j_max.Text);
            }
            else
            {
                ro   = Convert.ToDouble(pro.Text);
                bo   = Convert.ToDouble(sbo.Text);
                wH   = Convert.ToDouble(w_h.Text);
                wh   = Convert.ToDouble(wysh.Text);
                rd   = Convert.ToDouble(r_d.Text);
                bd   = Convert.ToDouble(b_d.Text);
                dh   = Convert.ToDouble(d_h.Text);
                fi   = Convert.ToDouble(KK.Text);
                spc  = Convert.ToDouble(cc.Text);
                wspk = Convert.ToDouble(ff.Text);
                wykn = Convert.ToDouble(nn.Text);
                K    = Convert.ToDouble(w_d.Text);
                bp   = Convert.ToDouble(k_tr.Text);
                wd   = Convert.ToDouble(b_p.Text);
                yb   = Convert.ToDouble(y_b.Text);
                jmax = Convert.ToDouble(j_max.Text);
            }
            Obliczenia();
        }