protected void cmbInstitutionType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.cmbInstitutionType.SelectedItem.ToString() != null)
            {
                try
                {
                    var instTypeId = this.cmbInstitutionType.SelectedValue;

                    var ritypeId = Convert.ToInt32(this.cmbInstitutionType.SelectedValue);
                    if (!String.IsNullOrWhiteSpace(ritypeId.ToString()))
                    {
                        ReturnInstitutions ri = new ReturnInstitutions();
                        ri.GetReturnInstitutionsByTypeId(this.cmbReportingInstitution, ritypeId);
                    }
                    else
                    {
                        divAlert.Visible = true;
                        lblErrorMsg.Text = "Please select an institution type";
                    }
                }
                catch (Exception ex)
                {
                    LogUtitlity.LogToText(ex.ToString());
                }
            }
        }
Example #2
0
        protected void cmbInstitutionType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.cmbInstitutionType.SelectedItem.ToString() != null)
            {
                try
                {
                    var instTypeId   = this.cmbInstitutionType.SelectedValue;
                    var ricodeByType = _riType.GetRICodeByID(instTypeId);
                    #region
                    //
                    //Convert RI type ID to ri code, build up and save the table name to be use in the return adjustment operation
                    //
                    if (instTypeId.Equals("3")) //mbr300 and mbr1000
                    {
                        this.ReturnTableName1           = raHandler.GetAjustmentTable(instTypeId.ToLower(), SharedConst.MBR300_TABLE_SURFIX);
                        this.ReturnTableName2           = raHandler.GetAjustmentTable(instTypeId.ToLower(), SharedConst.MBR1000_TABLE_SURFIX);
                        this.lblTableName300.InnerText  = "MBR 300 Records";
                        this.lblTableName1000.InnerText = "MBR 1000 Records";
                    }
                    else if (instTypeId.Equals("6")) //mdhr300 and mdhr1000
                    {
                        this.ReturnTableName1           = raHandler.GetAjustmentTable(instTypeId.ToLower(), SharedConst.MDHR300_TABLE_SURFIX);
                        this.ReturnTableName2           = raHandler.GetAjustmentTable(instTypeId.ToLower(), SharedConst.MDHR1000_TABLE_SURFIX);
                        this.lblTableName300.InnerText  = "MDHR 300 Records";
                        this.lblTableName1000.InnerText = "MDHR 1000 Records";
                    }
                    else if (instTypeId.Equals("12")) //mnbr300 and mnbr1000
                    {
                        this.ReturnTableName1           = raHandler.GetAjustmentTable(instTypeId.ToLower(), SharedConst.MNBR300_TABLE_SURFIX);
                        this.ReturnTableName2           = raHandler.GetAjustmentTable(instTypeId.ToLower(), SharedConst.MNBR1000_TABLE_SURFIX);
                        this.lblTableName300.InnerText  = "MNBR 300 Records";
                        this.lblTableName1000.InnerText = "MNBR 1000 Records";
                    }
                    else
                    {
                        return;
                    }
                    #endregion

                    //
                    //Save the table name return for adjustment into session
                    //
                    SaveToSession("table1", this.ReturnTableName1);
                    SaveToSession("table2", this.ReturnTableName2);

                    var ritypeId = Convert.ToInt32(this.cmbInstitutionType.SelectedValue);
                    if (!String.IsNullOrWhiteSpace(ritypeId.ToString()))
                    {
                        ReturnInstitutions ri = new ReturnInstitutions();
                        ri.GetReturnInstitutionsByTypeId(this.cmbReportingInstitution, ritypeId);
                    }
                    else
                    {
                        divAlert.Visible = true;
                        lblErrorMsg.Text = "Please select an institution type";
                    }
                }
                catch (Exception ex)
                {
                    divAlert.Visible = true;
                    lblErrorMsg.Text = ex.ToString();
                    LogUtitlity.LogToText(ex.ToString());
                }
            }
        }