protected void printButton_Click(object sender, EventArgs e)
    {
        StringBuilder sbQuery = new StringBuilder();

        sbQuery.Append("SELECT * FROM PRICE_REFIX WHERE 1=1 ");
        if (fundNameDropDownList.SelectedValue != "0")
        {
            sbQuery.Append(" AND FUND_CD='" + fundNameDropDownList.SelectedValue.ToString() + "'");
        }

        if (refixationDateFromDropDownList.SelectedValue != "0" && refixationDateToDropDownList.SelectedValue == "0")
        {
            sbQuery.Append("AND REFIX_DT>='" + refixationDateFromDropDownList.SelectedItem.Text.ToString() + "'");
        }
        else if (refixationDateFromDropDownList.SelectedValue == "0" && refixationDateToDropDownList.SelectedValue != "0")
        {
            sbQuery.Append("AND REFIX_DT<='" + refixationDateToDropDownList.SelectedItem.Text.ToString() + "'");
        }
        else if (refixationDateFromDropDownList.SelectedValue != "0" && refixationDateToDropDownList.SelectedValue != "0")
        {
            sbQuery.Append("AND REFIX_DT BETWEEN '" + refixationDateFromDropDownList.SelectedItem.Text.ToString() + "' AND  '" + refixationDateToDropDownList.SelectedItem.Text.ToString() + "'");
        }


        if (effectiveDateFromDropDownList.SelectedValue != "0" && effectiveDateToDropDownList.SelectedValue == "0")
        {
            sbQuery.Append("AND REFIX_DT>='" + effectiveDateFromDropDownList.SelectedItem.Text.ToString() + "'");
        }
        else if (effectiveDateFromDropDownList.SelectedValue == "0" && effectiveDateToDropDownList.SelectedValue != "0")
        {
            sbQuery.Append("AND REFIX_DT<='" + effectiveDateToDropDownList.SelectedItem.Text.ToString() + "'");
        }
        else if (effectiveDateFromDropDownList.SelectedValue != "0" && effectiveDateToDropDownList.SelectedValue != "0")
        {
            sbQuery.Append("AND REFIX_DT BETWEEN '" + effectiveDateFromDropDownList.SelectedItem.Text.ToString() + "' AND  '" + effectiveDateToDropDownList.SelectedItem.Text.ToString() + "'");
        }


        sbQuery.Append(" ORDER BY REFIX_DT DESC, EFFECTIVE_DATE DESC");

        DataTable dtPriceInfo = commonGatewayObj.Select(sbQuery.ToString());

        if (dtPriceInfo.Rows.Count > 0)
        {
            dtPriceInfo.TableName = "dtPriceInfo";
            //  dtPriceInfo.WriteXmlSchema(@"F:\GITHUB_AMCL\DOTNET2015\AMCL.OPENMF\AMCL.REPORT\XMLSCHEMAS\dtPriceRefixation.xsd");
            CR_PriceRefixation.Refresh();
            CR_PriceRefixation.SetDataSource(dtPriceInfo);
            //CR_PriceRefixation.SetParameterValue("user_name", DtUserInfo.Rows[0]["USER_NM"].ToString());
            //CR_PriceRefixation.SetParameterValue("fundName", dtMneyReceiptDetails.Rows[0]["FUND_NM"].ToString());
            //CR_PriceRefixation.SetParameterValue("total_units_word", numberToEnglisObj.changeNumericToWords(Convert.ToDecimal(dtMneyReceiptDetails.Rows[0]["UNIT_QTY"].ToString())).ToString());
            //CR_PriceRefixation.SetParameterValue("totalAmount", totalAmount);
            //CR_PriceRefixation.SetParameterValue("TotalAmountInWord", numberToEnglisObj.changeNumericToWords(totalAmount).ToString());
            //CR_PriceRefixation.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, "SaleMoneyReceipt" + DateTime.Now + ".pdf");
        }
        else
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Popup", "alert('No Data Found');", true);
        }
    }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (BaseContent.IsSessionExpired())
        {
            Response.Redirect("../../Default.aspx");
            return;
        }
        bcContent = (BaseClass)Session["BCContent"];

        DataTable dtReportStatement = (DataTable)Session["dtPriceInfo"];
        string    fundCode          = (string)Session["fundCode"];

        if (dtReportStatement.Rows.Count > 0)
        {
            // dtReportStatement.WriteXmlSchema(@"D:\Project\Web\AMCL.OPENMF\AMCL.REPORT\XMLSCHEMAS\dtPriceRefixation.xsd");
            CR_PRICE.Refresh();
            CR_PRICE.SetDataSource(dtReportStatement);
            CR_PRICE.SetParameterValue("fudnName", opendMFDAO.GetFundName(fundCode.ToString()));
            CrystalReportViewer1.ReportSource = CR_PRICE;
        }
        else
        {
            Response.Write("No data found");
        }
    }