Exemple #1
0
        private JMMPreOrderHist OldReadScr()
        {
            JMMPreOrderHist objJMPreOrderHist = new JMMPreOrderHist();

            KPITrace.Debug(TraceWeight.Five, "Calling Readscreen for Prescription Order Entry");
            try
            {
                objJMPreOrderHist.JMBookingID         = KPIHlp.CVI64(hdnBookingID.Value);
                objJMPreOrderHist.JMMedPrescriptionID = KPIHlp.CVI64(hdnJMMedPrescriptionID.Value);
                objJMPreOrderHist.JurisID             = KPIHlp.CVI32(hdnJurisId.Value);
                objJMPreOrderHist.Drug = !String.IsNullOrWhiteSpace(hdnDrugID.Value) ? hdnDrugID.Value : null;

                objJMPreOrderHist.JMPrescriptionOrderID = KPIHlp.CVI64(hdnJMPrescriptionOrderID.Value);
                objJMPreOrderHist.JMPreOrderHistID      = KPIHlp.CVI64(hdnJMPreOrderHistID.Value);
                objJMPreOrderHist.OrderedNo             = KPIHlp.CVI64(hdnOrderNo.Value);
                objJMPreOrderHist.JMPreOrderHistNo      = KPIHlp.CVI64(hdnJMPreOrderHistNo.Value);


                objJMPreOrderHist.OrderAction     = cddOrderAction.CodeValue;
                objJMPreOrderHist.StorageLocation = cddStorageLocation.CodeValue;
                if (dttmOrderedDate.DateValue != DateTime.MinValue)
                {
                    objJMPreOrderHist.OrderedDttm = dttmOrderedDate.DateValue;
                }
                if (lupOrderedPF.KPIID > 0)
                {
                    objJMPreOrderHist.OrderedPFID = lupOrderedPF.KPIID;
                }
                if (!String.IsNullOrWhiteSpace(txtQuantity.Text))
                {
                    objJMPreOrderHist.QtyBalance     = KPIHlp.CVI32(txtQuantity.Text);
                    objJMPreOrderHist.MedicationType = cddQuantityType.CodeValue;
                }



                if (txtDescription.Text.Length > txtDescription.MaxLength && txtDescription.MaxLength > 0) //Notes field as a OrderNotes column
                {
                    objJMPreOrderHist.OrderNotes = txtDescription.Text.Substring(0, txtDescription.MaxLength);
                }
                else
                {
                    objJMPreOrderHist.OrderNotes = txtDescription.Text;
                }

                switch (objJMPreOrderHist.OrderAction)
                {
                case "D":
                case "RI":
                    objJMPreOrderHist.CurQuantity  = (-1) * objJMPreOrderHist.QtyBalance;
                    objJMPreOrderHist.HowDestroyed = cddDestroyed.CodeValue;
                    if (lupWitness.KPIID > 0)
                    {
                        objJMPreOrderHist.WitnessPFID = lupWitness.KPIID;
                    }
                    break;

                case "F":
                case "RC":
                    objJMPreOrderHist.CurQuantity = objJMPreOrderHist.QtyBalance;
                    break;

                case "O":
                case "R":
                    break;
                }
            }
            catch (Exception objErr)
            {
                ShowMsg(MsgType.Error, FrwkMsg.PAGE_ERR, objErr);
            }

            return(objJMPreOrderHist);
        }