示例#1
0
 private void FrmLabTest_Load(object sender, EventArgs e)
 {
     lbtBll = new LabTestBLL();
     quotes = lbtBll.GetLabTests();
     this.GrdMain.DataSource = this.quotes;
     this.FormatGrid();
 }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            ts    = ltbll.GetLabTests();
            inLbs = inbll.GetInjectionLabTests();
            foreach (InjectionLabTest inLb in inLbs)
            {
                if (inLb.IsInjectionToken)
                {
                    continue;
                }
                string s = inLb.Type.ToString();
                switch (s)
                {
                case "Deserving":
                    LabTest x = (from t in ts where
                                 t.LabTestId == inLb.Tests[0].LabTestId
                                 select t).Single <LabTest>();
                    inLb.CashReceived = Convert.ToDouble(x.Deserving);
                    this.listBox1.Items.Add(s);
                    break;

                case "General":
                    LabTest x1 = (from t in ts
                                  where
                                  t.LabTestId == inLb.Tests[0].LabTestId
                                  select t).Single <LabTest>();
                    inLb.CashReceived = Convert.ToDouble(x1.General);
                    this.listBox1.Items.Add(s);
                    break;

                case "Poor":
                    LabTest x2 = (from t in ts
                                  where
                                  t.LabTestId == inLb.Tests[0].LabTestId
                                  select t).Single <LabTest>();
                    inLb.CashReceived = Convert.ToDouble(x2.Poor);

                    this.listBox1.Items.Add(s);
                    break;

                case "YCOD":
                    LabTest x3 = (from t in ts
                                  where
                                  t.LabTestId == inLb.Tests[0].LabTestId
                                  select t).Single <LabTest>();
                    inLb.CashReceived = Convert.ToDouble(x3.YCDO);

                    this.listBox1.Items.Add(s);
                    break;
                }
                inbll.UpdateInjectionLabTest(inLb);
            }
        }
示例#3
0
 private void tsSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (lbtBll.SaveLabTests(quotes) == true)
         {
             quotes = lbtBll.GetLabTests();
             this.GrdMain.DataSource = null;
             this.GrdMain.DataSource = quotes;
             FormatGrid();
             MessageBox.Show("Record saved successfully.", "Inforamtion");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }