private bool Save() { try { JMMMedPrescription objJMMMedPrescription = new JMMMedPrescriptionBL().Select(KPIHlp.CVI64(hdnPrescriptionID.Value)); JMMMedPrescriptionHist objJMMMedPrescriptionHist = ReadScr(ref objJMMMedPrescription); objJMMMedPrescription.JMMedPrescriptionID = KPIHlp.CVI64(hdnPrescriptionID.Value); if (objJMMMedPrescriptionHist != null && objJMMMedPrescription != null) { if (Request.QueryString.Get("Flag") != null && Request.QueryString.Get("Flag") != string.Empty) { if (hdnMode.Value == UIMode.ADD.ToString()) { new JMMMedPrescriptionHistBL().Manage(objJMMMedPrescriptionHist); ShowMsg(MsgType.Success, FrwkMsg.ADD_SUCCESS); hdnMedPresHisID.Value = objJMMMedPrescriptionHist.JMMedPrescriptionHistID.Value.ToString(); AutoUpdateParent(); } else { ShowMsg(MsgType.Success, FrwkMsg.UPD_SUCCESS); } hdnMode.Value = UIMode.INQ.ToString(); blnForceModeChange = true; } else { if (hdnMode.Value == UIMode.ADD.ToString()) { new JMMMedPrescriptionHistBL().Manage(objJMMMedPrescriptionHist); ShowMsg(MsgType.Success, FrwkMsg.ADD_SUCCESS); hdnMedPresHisID.Value = string.Empty; //objJMMMedPrescriptionHist.JMMedPrescriptionHistID.Value.ToString(); ClearData(); cddDrug.DropDown.Items.Clear(); cddDrug.DropDown.DataTextField = "Description"; cddDrug.DropDown.DataValueField = "ID"; cddDrug.DropDown.DataBind(); ListItem objItem1 = new ListItem("--", ""); cddDrug.DropDown.Items.Insert(0, objItem1); AddClientOnLoadScript("fn_ClearData();"); } } } } catch (KPIException objKPIError) { ShowMsg(MsgType.Error, FrwkMsg.OP_FAIL, objKPIError); } return(true); }
private DataSet BindMedicalPrescriptionGrid(ref JMMMedPrescription objJMMedPrescription) { DataSet objDS = null; try { objDS = new JMMMedPrescriptionBL().GetPrescriptionDetails(ref objJMMedPrescription); DataRelation objDR = new DataRelation("MasterDetails1", objDS.Tables[0].Columns["JMMedPrescriptionID"], objDS.Tables[1].Columns["JMMedPrescriptionID"], true); objDS.Relations.Add(objDR); grdPrescription.GridView.GroupedRows.Clear(); grdPrescription.Rows.Clear(); grdPrescription.GridView.Rows.Clear(); grdPrescription.GridView.ClearDataSource(); grdPrescription.DataSource = objDS; grdPrescription.DataBind(); } catch (Exception) { throw; } return(objDS); }
protected void Inquiry(ref JMMPrescriptionSchdule objJMPrescriptionSchdule) { DataSet ds = new DataSet(); JMMPrescriptionSchduleBL objJMPrescriptionSchduleBL = new JMMPrescriptionSchduleBL(); try { objJMPrescriptionSchdule.JMMedPrescriptionID = KPIHlp.CVI64(hdnMedPrescribeID.Value); JMMMedPrescription objJMMMedPrescription = new JMMMedPrescriptionBL().Select(objJMPrescriptionSchdule.JMMedPrescriptionID.Value); cddDrug.CodeValue = objJMMMedPrescription.Drug; txtDosage.Text = objJMMMedPrescription.Dosage; if (chkInactive.Checked) { objJMPrescriptionSchdule.IsActive = 1; } else { objJMPrescriptionSchdule.IsActive = 0; } ds = objJMPrescriptionSchduleBL.GetSchedule(ref objJMPrescriptionSchdule); if (ds.Tables[0].Rows.Count > 0) { hdnMode.Value = UIMode.CHG.ToString(); } grdSchedule.DataSource = ds; grdSchedule.DataBind(); } catch (Exception objError) { ShowMsg(MsgType.Error, FrwkMsg.OP_FAIL, objError); } }
protected void LoadData() { JMMMedVisit objMedVisit = new JMMMedVisit(); string strhdnMode = UIMode.ADD.ToString(); long NameID, JMBookingID; try { if (Request.QueryString.Get("JMMedPrescriptionID") != null && Request.QueryString.Get("JMMedPrescriptionID") != string.Empty) { hdnPrescriptionID.Value = Request.QueryString.Get("JMMedPrescriptionID").Trim(); } //hdnSchID.Value = Request.QueryString.Get("JMPrescriptionSchduleID") == null ? string.Empty : Request.QueryString.Get("JMPrescriptionSchduleID").Trim(); NameID = Request.QueryString.Get("NameID") == null ? long.MinValue : KPIHlp.CVI64(Request.QueryString.Get("NameID").Trim()); if (Request.QueryString.Get("JMMedPrescriptionHistID") != null && Request.QueryString.Get("JMMedPrescriptionHistID") != string.Empty) { hdnMedPresHisID.Value = Request.QueryString.Get("JMMedPrescriptionHistID").Trim(); hdnMode.Value = UIMode.INQ.ToString(); } hdnJMMScheduleEventsID.Value = Request.QueryString.Get("JMMScheduleEventsID") == null ? string.Empty : Request.QueryString.Get("JMMScheduleEventsID").Trim(); hdnJurisId.Value = Request.QueryString.Get("JurisID") == null?GetPageJuris().ToString() : Request.QueryString.Get("JurisID").Trim(); try { if (NameID > 0) { NamCtrlSPIN.KPIID = NameID; imgFrontView.GenerateImage(true, ImgType.FrontView, ImgRefType.Names, NameID, short.MinValue); } } catch (KPIException objKPIError) { throw objKPIError; } } catch (Exception objError) { ShowMsg(MsgType.Error, FrwkMsg.OP_FAIL, objError); } if (hdnMode.Value == UIMode.INQ.ToString()) //Added by jeyaganesh { blnForceModeChange = true; JMMMedPrescription objJMMMedPrescription = new JMMMedPrescription(); JMMMedPrescriptionBL objJMMMedPrescriptionBL = new JMMMedPrescriptionBL(); JMMMedPrescriptionHist objJMMMedPrescriptionHist = new JMMMedPrescriptionHist(); KPITxtBL objKPITxtBL = new KPITxtBL(); try { objJMMMedPrescriptionHist = new JMMMedPrescriptionHistBL().Select(KPIHlp.CVI64(hdnMedPresHisID.Value)); if (objJMMMedPrescriptionHist != null && objJMMMedPrescriptionHist.JMMedPrescriptionHistID.HasValue) { txtNotes.Text = objKPITxtBL.GetDisplayText(objJMMMedPrescriptionHist.JMMedPrescriptionHistID.Value, TxtType.JmMed_MedHisCmnts); txtDrug.Text = new CodedBL().GetCodeDescription(6007, objJMMMedPrescriptionHist.Drug, objJMMMedPrescriptionHist.JurisID.Value); txtDosage.Text = objJMMMedPrescriptionHist.Dosage; txtBalance.Text = objJMMMedPrescriptionHist.CurQuantity.HasValue ? objJMMMedPrescriptionHist.CurQuantity.Value.ToString() : string.Empty; if (!String.IsNullOrWhiteSpace(txtBalance.Text) && KPIHlp.CVI32(txtBalance.Text) <= 5) { txtBalance.ForeColor = System.Drawing.Color.Red; tdComments.Attributes.Add("class", "req"); } imgMedSignature.Style.Add("pointer-events", "none"); if (objJMMMedPrescriptionHist.Dispense.HasValue && objJMMMedPrescriptionHist.Dispense.Value > 0) { txtDispense.Text = objJMMMedPrescriptionHist.Dispense.HasValue ? objJMMMedPrescriptionHist.Dispense.Value.ToString() : String.Empty; } else { txtDispense.Text = string.Empty; } cddDispense.KPISelectedCodeValue = objJMMMedPrescriptionHist.MedicationType; if (objJMMMedPrescriptionHist.LastAdministeredDttm.HasValue) { dttmLstAdministered.DateValue = objJMMMedPrescriptionHist.LastAdministeredDttm.Value; } else { if (dttmLstAdministered.DateValue == DateTime.MinValue) { dttmLstAdministered.DateValue = new JMMMedPrescriptionHistBL().GetLastAdministeredDttm(ref objJMMMedPrescriptionHist); } } if (objJMMMedPrescriptionHist.ActivityDttm.HasValue) { dttmDateTime.DateValue = objJMMMedPrescriptionHist.ActivityDttm.Value; } if (objJMMMedPrescriptionHist.MarPFID.HasValue) { lupPFNo.KPIID = objJMMMedPrescriptionHist.MarPFID.Value; } cddMethodAdmin.KPISelectedCodeValue = objJMMMedPrescriptionHist.MethodAdministered; cddStatus.KPISelectedCodeValue = objJMMMedPrescriptionHist.Status; if (objJMMMedPrescriptionHist.MarPFSignID.HasValue) { hdnMarSignId.Value = objJMMMedPrescriptionHist.MarPFSignID.ToString(); imgMedSignature.GenerateImage(true, ImgType.Signature, ImgRefType.JMMMarInmateOfficer, objJMMMedPrescriptionHist.MarPFSignID.Value, short.MinValue); } else { hdnMarSignId.Value = string.Empty; } txtInstructions.Text = objJMMMedPrescriptionHist.Instructions; } } catch (Exception objError) { ShowMsg(MsgType.Error, FrwkMsg.OP_FAIL, objError); } } else { hdnMode.Value = UIMode.ADD.ToString(); txtDrug.Text = Request.QueryString.Get("Drug") == null ? string.Empty : Request.QueryString.Get("Drug").Trim(); if (!String.IsNullOrWhiteSpace(txtDrug.Text)) { txtDrug.Text = new CodedBL().GetCodeDescription(6007, txtDrug.Text, KPIHlp.CVI32(hdnJurisId.Value)); } txtDosage.Text = Request.QueryString.Get("Dosage") == null?string.Empty: Request.QueryString.Get("Dosage").Trim(); //txtBalance.Text = Request.QueryString.Get("CurQuantity") == null ? string.Empty : Request.QueryString.Get("CurQuantity").Trim(); JMMMedPrescriptionHist objJMMMedPrescriptionHist = new JMMMedPrescriptionHist(); objJMMMedPrescriptionHist.JMMedPrescriptionID = KPIHlp.CVI64(hdnPrescriptionID.Value); txtBalance.Text = new JMMMedPrescriptionHistBL().GetMedicationBalance(ref objJMMMedPrescriptionHist).ToString(); hdnPrescriptionID.Value = Request.QueryString.Get("JMMedPrescriptionID") == null ? string.Empty : Request.QueryString.Get("JMMedPrescriptionID").Trim(); JMBookingID = Request.QueryString.Get("JMBookingID") == null ? long.MinValue : KPIHlp.CVI64(Request.QueryString.Get("JMBookingID").Trim()); lupPFNo.KPIID = State.sPFID; ReadAddMode(); } }