//While click on Supply status icon, it will open and create a new order entry protected void NewRecordInquiry() { JMMPrescriptionOrderBL objJMPrescriptionOrderBL = null; long?JMPrescriptionOrderID = KPIHlp.CVI64(hdnJMPrescriptionOrderID.Value); try { objJMPrescriptionOrderBL = new JMMPrescriptionOrderBL(); if (JMPrescriptionOrderID.HasValue && JMPrescriptionOrderID != long.MinValue) { JMMPrescriptionOrder objJMPrescriptionOrder = objJMPrescriptionOrderBL.Select(JMPrescriptionOrderID.Value); if (objJMPrescriptionOrder != null) { hdnBookingID.Value = objJMPrescriptionOrder.JMBookingID.HasValue ? objJMPrescriptionOrder.JMBookingID.Value.ToString() : null; hdnJMMedPrescriptionID.Value = objJMPrescriptionOrder.JMMedPrescriptionID.HasValue ? objJMPrescriptionOrder.JMMedPrescriptionID.Value.ToString() : null; hdnJMPrescriptionOrderID.Value = objJMPrescriptionOrder.JMPrescriptionOrderID.HasValue ? objJMPrescriptionOrder.JMPrescriptionOrderID.Value.ToString() : null; hdnOrderNo.Value = objJMPrescriptionOrder.OrderedNo.HasValue ? objJMPrescriptionOrder.OrderedNo.Value.ToString() : null; hdnJurisId.Value = objJMPrescriptionOrder.JurisID.HasValue ? objJMPrescriptionOrder.JurisID.Value.ToString() : null; hdnOrderNo.Value = objJMPrescriptionOrder.OrderedNo.HasValue ? objJMPrescriptionOrder.OrderedNo.Value.ToString() : null; hdnOrderAction.Value = objJMPrescriptionOrder.OrderAction; hdnQuantity.Value = objJMPrescriptionOrder.QtyBalance.HasValue ? objJMPrescriptionOrder.QtyBalance.Value.ToString() : string.Empty; ClearData(); } } } catch (Exception) { throw; } }
private bool Save() { JMMPrescriptionOrder objJMPrescriptionOrder = null; JMMPreOrderHist objJMPreOrderHist = null; JMMPrescriptionOrderBL objJMPrescriptionOrderBL = null; JMMPreOrderHistBL objJMPreOrderHistBL = null; try { if (KPIHlp.CVI64(hdnJMPreOrderHistID.Value) == long.MinValue) { objJMPrescriptionOrder = NewReadScr(); objJMPrescriptionOrderBL = new JMMPrescriptionOrderBL(); KPITrace.Debug(TraceWeight.Five, "Calling Manage for Prescription Order Entry"); WrtActivityLog(long.MinValue, " Managing Prescription Order Entry Dtls.", hdnMode.Value); objJMPrescriptionOrderBL.Manage(ref objJMPrescriptionOrder); hdnJMPrescriptionOrderID.Value = objJMPrescriptionOrder.JMPrescriptionOrderID.HasValue ? objJMPrescriptionOrder.JMPrescriptionOrderID.Value.ToString() : null; NewRecordInquiry(); } else { objJMPreOrderHistBL = new JMMPreOrderHistBL(); objJMPreOrderHist = OldReadScr(); objJMPreOrderHistBL.UpdateHistory(objJMPreOrderHist); ExistingRecordInquiry(); } AutoUpdateParent(); ShowMsg(MsgType.Success, FrwkMsg.UPD_SUCCESS); } catch (Exception objErr) { ShowMsg(MsgType.Error, FrwkMsg.PAGE_ERR, objErr); } return(true); }
private JMMPrescriptionOrder NewReadScr() { JMMPrescriptionOrder objJMPrescriptionOrder = new JMMPrescriptionOrder(); KPITrace.Debug(TraceWeight.Five, "Calling Readscreen for Prescription Order Entry"); try { objJMPrescriptionOrder.JMBookingID = KPIHlp.CVI64(hdnBookingID.Value); objJMPrescriptionOrder.JMMedPrescriptionID = KPIHlp.CVI64(hdnJMMedPrescriptionID.Value); objJMPrescriptionOrder.JurisID = KPIHlp.CVI32(hdnJurisId.Value); objJMPrescriptionOrder.Drug = !String.IsNullOrWhiteSpace(hdnDrugID.Value) ? hdnDrugID.Value : null; if (KPIHlp.CVI64(hdnJMPrescriptionOrderID.Value) == long.MinValue) { objJMPrescriptionOrder.JMPrescriptionOrderID = KPICounter.GetCounterID(objJMPrescriptionOrder.JurisID.Value); hdnJMPrescriptionOrderID.Value = objJMPrescriptionOrder.JMPrescriptionOrderID.HasValue ? objJMPrescriptionOrder.JMPrescriptionOrderID.Value.ToString() : null; objJMPrescriptionOrder.OrderedNo = Counter.GetCounterNo(objJMPrescriptionOrder.JurisID.Value, CounterType.JMPrescriptionOrderNo, Int64.MinValue); hdnOrderNo.Value = objJMPrescriptionOrder.OrderedNo.HasValue ? objJMPrescriptionOrder.OrderedNo.Value.ToString() : null; objJMPrescriptionOrder.cMode = 'A'; } else { objJMPrescriptionOrder.JMPrescriptionOrderID = KPIHlp.CVI64(hdnJMPrescriptionOrderID.Value); objJMPrescriptionOrder.OrderedNo = KPIHlp.CVI64(hdnOrderNo.Value); objJMPrescriptionOrder.cMode = 'C'; } objJMPrescriptionOrder.OrderAction = cddOrderAction.CodeValue; objJMPrescriptionOrder.StorageLocation = cddStorageLocation.CodeValue; if (dttmOrderedDate.DateValue != DateTime.MinValue) { objJMPrescriptionOrder.OrderedDttm = dttmOrderedDate.DateValue; } if (lupOrderedPF.KPIID > 0) { objJMPrescriptionOrder.OrderedPFID = lupOrderedPF.KPIID; } if (!String.IsNullOrWhiteSpace(txtQuantity.Text)) { objJMPrescriptionOrder.QtyBalance = KPIHlp.CVI32(txtQuantity.Text); objJMPrescriptionOrder.MedicationType = cddQuantityType.CodeValue; } if (txtDescription.Text.Length > txtDescription.MaxLength && txtDescription.MaxLength > 0) //Notes field as a custom column { objJMPrescriptionOrder.OrderNotes = txtDescription.Text.Substring(0, txtDescription.MaxLength); } else { objJMPrescriptionOrder.OrderNotes = txtDescription.Text; } switch (objJMPrescriptionOrder.OrderAction) { case "D": case "RI": objJMPrescriptionOrder.CurQuantity = objJMPrescriptionOrder.QtyBalance; objJMPrescriptionOrder.HowDestroyed = cddDestroyed.CodeValue; if (lupWitness.KPIID > 0) { objJMPrescriptionOrder.WitnessPFID = lupWitness.KPIID; } break; case "F": case "RC": objJMPrescriptionOrder.CurQuantity = objJMPrescriptionOrder.QtyBalance; break; case "O": case "R": break; } } catch (Exception objErr) { ShowMsg(MsgType.Error, FrwkMsg.PAGE_ERR, objErr); } return(objJMPrescriptionOrder); }