Example #1
0
    protected override void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Request["FunctionId"] != null)
            {
                if (Request["FunctionId"].ToString() == "GetHealthDataList")
                {
                    if (Request["par0"] != null && Request["par0"].ToString() != string.Empty)
                    {
                        GenerateHealthDataRow(Convert.ToInt32(Request["par0"]));
                    }
                }
            }
            else
            {
                if (!Page.IsPostBack)
                {
                    FillHealthDataCombo();
                    if (DropDownListHealthData.SelectedValue != "")
                    {
                        GenerateHealthDataRow(Convert.ToInt32(DropDownListHealthData.SelectedValue));
                    }

                    TextBoxDate.Text = DateTime.Now.ToString("MM/dd/yyyy");
                    if (Session["HealthDataList"] != null)
                    {
                        DataRow[] drHealthData = ((DataSet)Session["HealthDataList"]).Tables[0].Select("HealthDataId=" + Convert.ToUInt32(Request.QueryString["HealthDataId"]));
                        if (drHealthData.Length > 0)
                        {
                            TextBoxDate.Text = ((DateTime)drHealthData[0]["DateRecorded"]).ToString("MM/dd/yyyy");
                        }
                    }

                    if (Request["DropDownObject"] != null)
                    {
                        HiddenDropDownObject.Value = Request["DropDownObject"].ToString();
                    }
                    if (Request["PanelHealthDataList"] != null)
                    {
                        HiddenPanelHealthDataList.Value = Request["PanelHealthDataList"].ToString();
                    }
                    DropDownListHealthData.Attributes.Add("onchange", "FillHealthDataList();");
                    ButtonSave.Attributes.Add("onclick", "SaveHealthData(" + Convert.ToString(Request.QueryString["HealthDataId"]) + ");");
                }
            }
            DropDownListHealthData.Focus();
        }
        catch (Exception ex)
        {
            throw;
        }
    }
Example #2
0
    /// <summary>
    /// Mohit
    /// Fills the HealthCategoryData combo
    /// Nov-20-2009
    /// </summary>
    private void FillHealthDataCombo()
    {
        DataSet DataSetHealthCategoryData = null;

        Streamline.UserBusinessServices.SharedTables objectSharedTables = null;
        objectSharedTables = new Streamline.UserBusinessServices.SharedTables();
        try
        {
            DataSetHealthCategoryData = objectSharedTables.getHealthCategoryData();
            CommonFunctions.Event_Trap(this);
            DataView dataViewHealthData = DataSetHealthCategoryData.Tables[0].DefaultView;
            dataViewHealthData.Sort               = "CategoryName ASC";
            DropDownListHealthData.DataSource     = dataViewHealthData;
            DropDownListHealthData.DataTextField  = "CategoryName";
            DropDownListHealthData.DataValueField = "HealthDataCategoryId";
            DropDownListHealthData.DataBind();
            //drpData.Items.Insert(0, new ListItem("........Select Data........", "0"));
            if (Request.QueryString["HealthDataCategoryId"] != null)
            {
                DropDownListHealthData.SelectedValue = Convert.ToString(Request.QueryString["HealthDataCategoryId"]);
            }
            else
            {
                DropDownListHealthData.SelectedIndex = 0;
            }
            Session["dataSetHealthData"] = DataSetHealthCategoryData;
        }
        catch (Exception ex)
        {
            if (ex.Data["CustomExceptionInformation"] == null)
            {
                ex.Data["CustomExceptionInformation"] = CommonFunctions.Event_FormatString("###Source Function Name - getHealthCategoryData(),ParameterCount 0 - ###");
            }
            else
            {
                ex.Data["CustomExceptionInformation"] = CommonFunctions.Event_FormatString(ex.Data["CustomExceptionInformation"].ToString());
            }
            if (ex.Data["DatasetInfo"] == null)
            {
                ex.Data["DatasetInfo"] = null;
            }
            Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this);
        }
        finally
        {
        }
    }