Пример #1
0
        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);
        }
Пример #2
0
        protected void ExistingRecordInquiry()
        {
            JMMPreOrderHistBL objJMPreOrderHistBL = null;
            long?JMPreOrderHistID = KPIHlp.CVI64(hdnJMPreOrderHistID.Value);

            try
            {
                objJMPreOrderHistBL = new JMMPreOrderHistBL();
                if (JMPreOrderHistID.HasValue && JMPreOrderHistID.Value != long.MinValue)
                {
                    JMMPreOrderHist objJMPreOrderHist = objJMPreOrderHistBL.Select(JMPreOrderHistID.Value);
                    if (objJMPreOrderHist != null)
                    {
                        hdnJMPreOrderHistID.Value      = objJMPreOrderHist.JMPreOrderHistID.HasValue ? objJMPreOrderHist.JMPreOrderHistID.Value.ToString() : null;
                        hdnBookingID.Value             = objJMPreOrderHist.JMBookingID.HasValue ? objJMPreOrderHist.JMBookingID.Value.ToString() : null;
                        hdnJMMedPrescriptionID.Value   = objJMPreOrderHist.JMMedPrescriptionID.HasValue ? objJMPreOrderHist.JMMedPrescriptionID.Value.ToString() : null;
                        hdnJMPrescriptionOrderID.Value = objJMPreOrderHist.JMPrescriptionOrderID.HasValue ? objJMPreOrderHist.JMPrescriptionOrderID.Value.ToString() : null;
                        hdnOrderNo.Value = objJMPreOrderHist.OrderedNo.HasValue ? objJMPreOrderHist.OrderedNo.Value.ToString() : null;
                        hdnJurisId.Value = objJMPreOrderHist.JurisID.HasValue ? objJMPreOrderHist.JurisID.Value.ToString() : null;
                        hdnOrderNo.Value = objJMPreOrderHist.OrderedNo.HasValue ? objJMPreOrderHist.OrderedNo.Value.ToString() : null;

                        dttmOrderedDate.DateValue               = objJMPreOrderHist.OrderedDttm.HasValue ? objJMPreOrderHist.OrderedDttm.Value : DateTime.MinValue;
                        lupOrderedPF.KPIID                      = objJMPreOrderHist.OrderedPFID.HasValue ? objJMPreOrderHist.OrderedPFID.Value : long.MinValue;
                        txtQuantity.Text                        = objJMPreOrderHist.QtyBalance.HasValue ? objJMPreOrderHist.QtyBalance.Value.ToString() : null;
                        cddOrderAction.KPISelectedCodeValue     = objJMPreOrderHist.OrderAction;
                        cddStorageLocation.KPISelectedCodeValue = objJMPreOrderHist.StorageLocation;
                        cddQuantityType.KPISelectedCodeValue    = objJMPreOrderHist.MedicationType;

                        cddDestroyed.KPISelectedCodeValue = objJMPreOrderHist.HowDestroyed;
                        lupWitness.KPIID = objJMPreOrderHist.WitnessPFID.HasValue ? objJMPreOrderHist.WitnessPFID.Value : long.MinValue;

                        hdnOrderAction.Value = objJMPreOrderHist.OrderAction;
                        hdnQuantity.Value    = objJMPreOrderHist.QtyBalance.HasValue ? objJMPreOrderHist.QtyBalance.Value.ToString() : string.Empty;
                        txtDescription.Text  = string.Empty;
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }