private void butAddP_Click(object sender, EventArgs e) { MasterProduct pro = LqtUtil.GetComboBoxValue<MasterProduct>(comProductP); if (pro != null) { if (comPeriodP.SelectedValue != null) { if (!_consum.IsExsistUsageRatePerPeriod(pro.Id)) { ConsumableUsage cu = new ConsumableUsage(); cu.Period = comPeriodP.SelectedValue.ToString(); cu.PerPeriod = true; cu.Product = pro; cu.ProductUsageRate = 1; cu.MasterConsumable = _consum; _consum.ConsumableUsages.Add(cu); BindProductUsageP(); if (OnDataUsageEdit != null) { OnDataUsageEdit(this, new EventArgs()); } } } } }
private void butAddT_Click(object sender, EventArgs e) { MasterProduct pro = LqtUtil.GetComboBoxValue<MasterProduct>(comProductT); if (pro != null) { if (!_consum.IsExsistUsageRatePerTest(pro.Id)) { if (txtNoofTest.Text != "0") { ConsumableUsage cu = new ConsumableUsage(); cu.NoOfTest = int.Parse(txtNoofTest.Text); cu.PerTest = true; cu.Product = pro; cu.ProductUsageRate = 1; cu.MasterConsumable = _consum; _consum.ConsumableUsages.Add(cu); BindProductUsage(); if (OnDataUsageEdit != null) { OnDataUsageEdit(this, new EventArgs()); } } } } }
private void butAddI_Click_1(object sender, EventArgs e) { Instrument ins = LqtUtil.GetComboBoxValue<Instrument>(comInstrumentI); if (ins != null) { MasterProduct pro = LqtUtil.GetComboBoxValue<MasterProduct>(comProductI); if (pro != null) { //if (! _consum.IsExsistProductUsage(ins.Id, pro.Id)) // { if (comPeriodI.SelectedValue != null) { if (!_consum.IsExsistUsageRatePerInst(ins.Id,pro.Id)) { ConsumableUsage cu = new ConsumableUsage(); cu.Period = comPeriodI.Text; cu.PerInstrument = true; cu.Product = pro; cu.Instrument = ins; cu.ProductUsageRate = 1; cu.MasterConsumable = _consum; _consum.ConsumableUsages.Add(cu); BindProductUsageI(); if (OnDataUsageEdit != null) { OnDataUsageEdit(this, new EventArgs()); } } } } } }