Esempio n. 1
0
        private void pictureBox2_Click(object sender, EventArgs e)
        {
            if (gvProductsToBills.Rows.Count == 0)
            {
                MessageBox.Show("Choose product, Please!", "Message");
                return;
            }
            List <PrintDto> lstProductForPrint = new List <PrintDto>();

            for (int i = 0; i < gvProductsToBills.Rows.Count; i++)
            {
                PrintDto printDto = new PrintDto()
                {
                    ProductName = gvProductsToBills.Rows[i].Cells["colProductName"].Value.ToString(),
                    Price       = float.Parse(gvProductsToBills.Rows[i].Cells["colRealPrice"].Value.ToString()),
                    Amounts     = int.Parse(gvProductsToBills.Rows[i].Cells["colAmounts"].Value.ToString()),
                    Sum         = float.Parse(gvProductsToBills.Rows[i].Cells["colTotal"].Value.ToString()),
                    Total       = SumTotal()
                };
                lstProductForPrint.Add(printDto);
            }
            CRReport frm = new CRReport(lstProductForPrint);

            frm.ShowDialog();
        }
Esempio n. 2
0
 private void pictureBox2_Click(object sender, EventArgs e)
 {
     if (gvProductsToBills.Rows.Count == 0) {
         MessageBox.Show("Choose product, Please!", "Message");
         return;
     }
     List<PrintDto> lstProductForPrint = new List<PrintDto>();
     for (int i = 0; i < gvProductsToBills.Rows.Count; i++)
     {
         PrintDto printDto = new PrintDto() {
             ProductName = gvProductsToBills.Rows[i].Cells["colProductName"].Value.ToString(),
             Price = float.Parse(gvProductsToBills.Rows[i].Cells["colRealPrice"].Value.ToString()),
             Amounts = int.Parse(gvProductsToBills.Rows[i].Cells["colAmounts"].Value.ToString()),
             Sum = float.Parse(gvProductsToBills.Rows[i].Cells["colTotal"].Value.ToString()),
             Total = SumTotal()
         };
         lstProductForPrint.Add(printDto);
     }
     CRReport frm = new CRReport(lstProductForPrint);
     frm.ShowDialog();
 }