Beispiel #1
0
        private void cmdSave_Click(object sender, EventArgs e)
        {
            DataView dv = (DataView)dgvView.DataSource;

            foreach (DataRow dr in dv.Table.Rows)
            {
                LabTestPrice.Save(dr["labTestPricePK"].ToString(), dr["labTestPK"].ToString(), dr["branchPK"].ToString(), Convert.ToDouble(dr["originalPrice"] == DBNull.Value ? 0 : dr["originalPrice"]), Convert.ToDouble(dr["profitMargin"] == DBNull.Value ? 0 : dr["profitMargin"]), Convert.ToInt32(dr["exchangePK"] == DBNull.Value?0:dr["exchangePK"]), Convert.ToDouble(dr["discount"] == DBNull.Value ? 0 : dr["discount"]), Convert.ToDouble(dr["sellingPrice"] == DBNull.Value ? 0 : dr["sellingPrice"]));
            }
            MessageBox.Show("Saving Successful");
        }
Beispiel #2
0
 public frmLabTestPrice()
 {
     InitializeComponent();
     dgv.DataSource = LabTestPrice.GetAllLabTestPrice();
     //lueLabTest.DataSource = LabTest.GetAllLabTest();
 }