コード例 #1
0
ファイル: ViewLogs.aspx.cs プロジェクト: 5l1v3r1/Ploutus-1
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        try
        {
            if (ddlEmailID.SelectedValue == "--Select--")
            {
                lblMsg.Visible = true;
                lblMsg.Text    = "Please Select Email ID";
            }
            else
            {
                lblMsg.Visible = false;
                if (txtToDate.Text == "")
                {
                    txtToDate.Text = txtFromDate.Text;
                }
                DataSet ds = marclass.GetLogsList(ddlEmailID.SelectedValue, txtFromDate.Text, txtToDate.Text);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    gvReports.DataSource = ds.Tables[0];
                    gvReports.DataBind();
                }
                else
                {
                    lblMsg.Visible = true;
                    lblMsg.Text    = "No Data to Display";
                }
            }
        }
        catch (Exception ex)
        {
            lblMsg.Visible = true;
            lblMsg.Text    = "No Data to Display";
        }
    }