예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                cmdAdd.Attributes.Add("OnClick", "return fn_ManipulateAllergy();");
                cmdClear.Attributes.Add("OnClick", "return fn_CancelAllergyDetails();");
                cmdSave.Attributes.Add("OnClick", "glbCtrlClicked='Save';");
                cmdReset.Attributes.Add("OnClick", "glbCtrlClicked='Reset';");
                Page.ClientScript.RegisterOnSubmitStatement(Page.GetType(), "OnSubmit", "return fn_ValidateScreen();");
                chkInactive.Attributes.Add("onclick", "return fn_Inactive();");
                AddClientOnLoadScript("fn_Inactive();");
                hdnJurisId.Value   = Request.QueryString.Get("hdnJurisID") == null ? string.Empty : Request.QueryString.Get("hdnJurisID").Trim().ToString();
                hdnBookingID.Value = Request.QueryString.Get("BookingID") == null ? string.Empty : Request.QueryString.Get("BookingID").ToString();
                if (Request.QueryString.Get("Mode") != null && Request.QueryString.Get("Mode") != string.Empty) //CRM#65266 All inmate Booking Status should allow to create Medical Entry
                {
                    hdnMode.Value = Request.QueryString.Get("Mode").ToString();
                }
                if (!IsPostBack)
                {
                    BoundCheckBoxField ChkColumn = (BoundCheckBoxField)this.grdAllergy.Columns.FromKey("Isactive");
                    ChkColumn.ValueConverter = new BoolConverter();


                    JMMAllergy objJMMAllergy = new JMMAllergy();
                    if (!String.IsNullOrEmpty(hdnJurisId.Value))
                    {
                        objJMMAllergy.JurisID = KPIHlp.CVI32(hdnJurisId.Value);
                    }
                    if (!String.IsNullOrEmpty(hdnBookingID.Value))
                    {
                        objJMMAllergy.JMBookingID = KPIHlp.CVI64(hdnBookingID.Value);
                        Inquiry(ref objJMMAllergy);
                    }
                }



                if (KPIHlp.CVI32(hdnJurisId.Value) > 0)
                {
                    hdnSetUserPFID.Value = State.GPV((int)JailAdmissionParams.IsDefaultAllPFFields, KPIHlp.CVI32(hdnJurisId.Value));
                }

                if (hdnJurisId.Value == KPIHlp.CVS(State.sJurisID))
                {
                    hdnLoginPFCode.Value = KPI.Global.Helper.PersonnelHlp.GetPFCode(State.sPFID);
                    hdnLoginPFDesc.Value = KPI.Global.Helper.PersonnelHlp.GetPFFullName(State.sPFID);
                    hdnLoginPFID.Value   = State.sPFID.ToString();
                }
            }
            catch (Exception)
            {
                KPITrace.Debug(TraceWeight.Five, "Calling page load for medical Allergy screen");
                WrtActivityLog(long.MinValue, " Calling page load for medical Allergy screen.");
            }
        }
예제 #2
0
        public void ReadScr(ref JMMMedicalHist objJMMMedicalHist)
        {
            try
            {
                #region Medical Prescription
                JMMAllergy objJMMAllergy = new JMMAllergy();
                objJMMAllergy.Allergy           = String.Format("{0}", string.Join("','", radAllergy.KPISelectedValues));
                objJMMMedicalHist.objJMMAllergy = objJMMAllergy;
                #endregion

                #region Medical Prescription
                JmmMedPrescribe objPrescribe = new JmmMedPrescribe();
                objPrescribe.Drug      = cddDrugs.CodeValue; //CRM#66995
                objPrescribe.MedNameID = NamCtrlSPIN.KPIID;
                objJMMMedicalHist.objJmmMedPrescribe = objPrescribe;
                #endregion

                #region Medical Visit
                JMMMedVisit objMedVist = new JMMMedVisit();
                objMedVist.Diagnosis             = lupDiagnosed.CodeValue;
                objMedVist.Result                = cddTBResults.CodeValue;
                objMedVist.Hospital              = cddAdmMedFacility.CodeValue;
                objMedVist.SpecialMeal           = String.Format("{0}", string.Join("','", radSpecialMealRequired.KPISelectedValues));
                objJMMMedicalHist.objJmmMedVisit = objMedVist;
                #endregion

                #region Medical Flags & Dentist proceedures
                objJMMMedicalHist.DentalProceedure = String.Format("{0}", string.Join("','", radDentProcedure.KPISelectedValues));
                objJMMMedicalHist.MedicalFlags     = String.Format("{0}", string.Join("','", radMedicalFlags.KPISelectedValues));// cddMedicalFlags.CodeValue;
                objJMMMedicalHist.JurisID          = KPIHlp.CVI32(hdnJurisId.Value);
                #endregion

                #region From & To Date

                objJMMMedicalHist.CreatedDttm  = dttmFromDate.DateValue;
                objJMMMedicalHist.ModifiedDttm = dttmToDate.DateValue;

                objJMMMedicalHist.OwnerSubAgencyID = KPIHlp.CVI64(cddSubAgency.CodeValue);



                #endregion
            }
            catch (Exception objError)
            {
                throw objError;
            }
        }
예제 #3
0
        public void Inquiry(ref JMMAllergy objJmmAllergy)
        {
            DataSet objDS = null;

            try
            {
                objDS = new DataSet();
                objDS = new JMMAllergyBL().Search(ref objJmmAllergy);
                grdAllergy.DataSource = objDS;
                grdAllergy.DataBind();
            }
            catch (Exception objErr)
            {
                ((BasePage)this.Page).ShowMsg(MsgType.Error, FrwkMsg.OP_FAIL, objErr);
                throw;
            }
        }
예제 #4
0
        private bool Save()
        {
            JMMAllergyBL   objJMMAllergyBL   = null;
            JMMAllergyList objJmmAllergyList = null;
            JMMAllergy     objJmmAllergy     = new JMMAllergy();

            try
            {
                objJmmAllergyList = ReadScr();
                objJMMAllergyBL   = new JMMAllergyBL();
                KPITrace.Debug(TraceWeight.Five, "Calling Manage for frmMedAllergy");
                ((BasePage)this.Page).WrtActivityLog(long.MinValue, " Managing frmMedAllergy.", ((HtmlInputHidden)(((BasePage)this.Page).FindControl("hdnMode"))).Value);


                if (objJmmAllergyList == null)
                {
                    return(false);
                }
                else
                {
                    objJMMAllergyBL.ManageAllergy(objJmmAllergyList);

                    if (objJmmAllergyList.Count > 0)
                    {
                        ((BasePage)Page).ShowMsg(MsgType.Success, FrwkMsg.UPD_SUCCESS, null);
                    }
                    objJmmAllergy.JMBookingID = KPIHlp.CVI64(((HtmlInputHidden)(((BasePage)this.Page).FindControl("hdnBookingID"))).Value);
                    objJmmAllergy.JurisID     = KPIHlp.CVI32(((HtmlInputHidden)(((BasePage)this.Page).FindControl("hdnJurisId"))).Value);
                    Inquiry(ref objJmmAllergy);


                    return(true);
                }
            }
            catch (Exception objErr)
            {
                ((BasePage)this.Page).ShowMsg(MsgType.Error, FrwkMsg.OP_FAIL, objErr);
                throw;
            }
            finally
            {
            }
        }
예제 #5
0
        protected void cmdReset_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                AddClientOnLoadScript("fn_CancelAllergyDetails();");

                JMMAllergy objJMMAllergy = new JMMAllergy();
                objJMMAllergy.JMBookingID = KPIHlp.CVI64(((HtmlInputHidden)(((BasePage)this.Page).FindControl("hdnBookingID"))).Value);
                objJMMAllergy.JurisID     = KPIHlp.CVI32(((HtmlInputHidden)(((BasePage)this.Page).FindControl("hdnJurisId"))).Value);

                if (objJMMAllergy.JMBookingID.HasValue && objJMMAllergy.JMBookingID.Value > 0 && objJMMAllergy.JurisID.HasValue && objJMMAllergy.JurisID.Value > 0)
                {
                    Inquiry(ref objJMMAllergy);
                }
            }
            catch (Exception)
            {
                KPITrace.Debug(TraceWeight.Five, "Calling medical Allergy screen Reset Button");
                WrtActivityLog(long.MinValue, " Calling medical Allergy screen Reset Button.");
            }
        }
예제 #6
0
        public JMMAllergyList ReadScr()
        {
            try
            {
                JMMAllergyList objJMMAllergyList = new JMMAllergyList();
                for (int iRowCnt = 0; iRowCnt < grdAllergy.Rows.Count; iRowCnt++)
                {
                    if (grdAllergy.IsActiveRow(iRowCnt))
                    {
                        JMMAllergy objJmmAllergy = new JMMAllergy();
                        objJmmAllergy.JMBookingID = KPIHlp.CVI64(((HtmlInputHidden)(((BasePage)this.Page).FindControl("hdnBookingID"))).Value);
                        objJmmAllergy.JurisID     = KPIHlp.CVI32(((HtmlInputHidden)(((BasePage)this.Page).FindControl("hdnJurisId"))).Value);

                        long JMAllergID = grdAllergy.GetLong(iRowCnt, "KPIID");
                        if (JMAllergID != long.MinValue && JMAllergID > 0)
                        {
                            objJmmAllergy.JMMAllergyID = JMAllergID;
                            objJmmAllergy.cMode        = grdAllergy.GetChar(iRowCnt, "KPIMode");
                        }
                        else
                        {
                            objJmmAllergy.JMMAllergyID = KPICounter.GetCounterID(objJmmAllergy.JurisID.Value);
                            objJmmAllergy.cMode        = 'A';
                        }
                        if (grdAllergy.GetDateTime(iRowCnt, "AllergyDttm") != DateTime.MinValue)
                        {
                            objJmmAllergy.AllergyDttm = grdAllergy.GetDateTime(iRowCnt, "AllergyDttm");
                        }

                        objJmmAllergy.Allergy          = String.IsNullOrEmpty(grdAllergy.GetString(iRowCnt, "Allergy")) ? null : grdAllergy.GetString(iRowCnt, "Allergy");
                        objJmmAllergy.AllergyReactions = String.IsNullOrEmpty(grdAllergy.GetString(iRowCnt, "AllergyReactionNotes")) ? null : System.Web.HttpUtility.HtmlDecode(grdAllergy.GetString(iRowCnt, "AllergyReactionNotes"));
                        objJmmAllergy.AllergyNotes     = String.IsNullOrEmpty(grdAllergy.GetString(iRowCnt, "AllergyNotes")) ? null : System.Web.HttpUtility.HtmlDecode(grdAllergy.GetString(iRowCnt, "AllergyNotes"));

                        if (!String.IsNullOrEmpty(objJmmAllergy.AllergyReactions))
                        {
                            if (objJmmAllergy.AllergyReactions.Length <= 254)
                            {
                                objJmmAllergy.AllergyReactions = objJmmAllergy.AllergyReactions.Substring(0, objJmmAllergy.AllergyReactions.Length);
                            }
                            else
                            {
                                objJmmAllergy.AllergyReactions = objJmmAllergy.AllergyReactions.Substring(0, txtReactions.MaxLength);
                            }
                        }

                        if (!String.IsNullOrEmpty(objJmmAllergy.AllergyNotes))
                        {
                            if (objJmmAllergy.AllergyNotes.Length <= 400)
                            {
                                objJmmAllergy.AllergyNotes = objJmmAllergy.AllergyNotes.Substring(0, objJmmAllergy.AllergyNotes.Length);
                            }
                            else
                            {
                                objJmmAllergy.AllergyNotes = objJmmAllergy.AllergyNotes.Substring(0, txtNotes.MaxLength);
                            }
                        }



                        objJmmAllergy.IsActive = grdAllergy.GetShort(iRowCnt, "Isactive");
                        if (objJmmAllergy.IsActive == 1)
                        {
                            objJmmAllergy.InactiveDttm = grdAllergy.GetDateTime(iRowCnt, "InactiveDttm");
                            if (grdAllergy.GetLong(iRowCnt, "InactivePFID") != long.MinValue)
                            {
                                objJmmAllergy.InactivePFID = grdAllergy.GetLong(iRowCnt, "InactivePFID");
                            }
                        }
                        else
                        {
                            objJmmAllergy.IsActive     = null;
                            objJmmAllergy.InactiveDttm = null;
                            objJmmAllergy.InactivePFID = null;
                        }

                        objJMMAllergyList.Add(objJmmAllergy);
                    }
                }
                return(objJMMAllergyList);
            }
            catch (Exception objErr)
            {
                ((BasePage)this.Page).ShowMsg(MsgType.Error, FrwkMsg.OP_FAIL, objErr);
                throw;
            }
        }