Exemplo n.º 1
0
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        //--- Multi Select List Box Values --
        string strPartyName = string.Empty;

        foreach (ListItem item in lbPartyName.Items)
        {
            if (item.Selected)
            {
                strPartyName += "'" + item.Text + "'";
                strPartyName += ",";
            }
        }
        //--- Multi Select List Box Values --
        string strItemName = string.Empty;

        foreach (ListItem item in lbItemName.Items)
        {
            if (item.Selected)
            {
                strItemName += "'" + item.Text + "'";
                strItemName += ",";
            }
        }

        LeadTime_Search repParamSearch = new LeadTime_Search();

        if (lbPartyName.SelectedIndex > 0)
        {
            repParamSearch.PartyName = strPartyName.Remove(strPartyName.Length - 1, 1);// Remove last ,
        }

        if (lbItemName.SelectedIndex > 0)
        {
            repParamSearch.ItemName = strItemName.Remove(strItemName.Length - 1, 1);// Remove last ,// lbItemName.SelectedItem.Text;
        }
        //repParamSearch.ItemName = lbItemName.SelectedItem.Text;

        repParamSearch.StartDate_PO = Page.Request.Form["_dtFromDate_PO"].ToString();
        repParamSearch.EndtDate_PO  = Page.Request.Form["_dtToDate_PO"].ToString();

        repParamSearch.StartDate_GRN = Page.Request.Form["_dtFromDate_GRN"].ToString();
        repParamSearch.EndtDate_GRN  = Page.Request.Form["_dtToDate_GRN"].ToString();

        repParamSearch.StartDate_Invoice = Page.Request.Form["_dtFromDate_Invoice"].ToString();
        repParamSearch.EndtDate_Invoice  = Page.Request.Form["_dtToDate_Invoice"].ToString();

        bool blncontinue = true;

        if (blncontinue)
        {
            GenerateRDLCReport(repParamSearch);
        }
    }
Exemplo n.º 2
0
    protected void btnReset_Click(object sender, EventArgs e)
    {
        LeadTime_Search repParamSearch = new LeadTime_Search();

        GenerateRDLCReport(repParamSearch);
        string PODateFrom = Request.Form["dtFromDate_PO"];

        lbItemName.SelectedIndex  = -1;
        lbPartyName.SelectedIndex = -1;
        //--- Set Current Date in Date Fileds Input Box

        lblmsg.Text = "";
    }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            PopulateSearchDropdowns();

            //applyrole();
            //generate report
            LeadTime_Search repParamSearch = new LeadTime_Search();
            //repParamSearch.StartDate_PO = "mad";

            GenerateRDLCReport(repParamSearch);
        }
    }
Exemplo n.º 4
0
    private void GenerateRDLCReport(LeadTime_Search repParamSearch)
    {
        ReportViewer1.ProcessingMode         = ProcessingMode.Local;
        ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/rdlcs/Report_LeadTime.rdlc");

        DataSet dt = (new Report_DL()).GetLeadTimeReportData(repParamSearch);

        if (dt != null)
        {
            ReportViewer1.LocalReport.DataSources.Clear();
            ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource()
            {
                Name  = "dsLeadTime",
                Value = dt.Tables[0]
            });
            ReportViewer1.LocalReport.Refresh();
        }
    }
Exemplo n.º 5
0
    public DataSet GetLeadTimeReportData(LeadTime_Search repParamSearch)
    {
        try
        {
            LeadTime_Report_List lstLeadTimeReport = new LeadTime_Report_List();
            Common.OpenConnection();
            String strSQL    = "select * from View_Report_LeadTime";
            string WhSQL     = "";
            string strconcat = "";

            if (repParamSearch.PartyName != null && repParamSearch.PartyName != "" && repParamSearch.PartyName != "select")
            {
                WhSQL     = WhSQL + strconcat + "popartyname In (" + repParamSearch.PartyName + ")";
                strconcat = " and ";
            }

            if (repParamSearch.ItemName != null && repParamSearch.ItemName != "" && repParamSearch.ItemName != "select")
            {
                WhSQL     = WhSQL + strconcat + "POStockItemName In (" + repParamSearch.ItemName + ")";
                strconcat = " and ";
            }
            //--------------- PO Date -------------------
            if (repParamSearch.StartDate_PO != null && repParamSearch.StartDate_PO != "")
            {
                WhSQL     = WhSQL + strconcat + " PODate>='" + repParamSearch.StartDate_PO + "'";
                strconcat = " and ";
            }
            if (repParamSearch.EndtDate_PO != null && repParamSearch.EndtDate_PO != "")
            {
                WhSQL     = WhSQL + strconcat + " PODate<='" + repParamSearch.EndtDate_PO + "'";
                strconcat = " and ";
            }
            //--------------- GRN Date -------------------
            if (repParamSearch.StartDate_GRN != null && repParamSearch.StartDate_GRN != "")
            {
                WhSQL     = WhSQL + strconcat + " GRNDate>='" + repParamSearch.StartDate_GRN + "'";
                strconcat = " and ";
            }
            if (repParamSearch.EndtDate_GRN != null && repParamSearch.EndtDate_GRN != "")
            {
                WhSQL     = WhSQL + strconcat + " GRNDate<='" + repParamSearch.EndtDate_GRN + "'";
                strconcat = " and ";
            }
            //--------------- Invoice Date -------------------
            if (repParamSearch.StartDate_Invoice != null && repParamSearch.StartDate_Invoice != "")
            {
                WhSQL     = WhSQL + strconcat + " PurchaseDate>='" + repParamSearch.StartDate_Invoice + "'";
                strconcat = " and ";
            }
            if (repParamSearch.EndtDate_Invoice != null && repParamSearch.EndtDate_Invoice != "")
            {
                WhSQL     = WhSQL + strconcat + " PurchaseDate<='" + repParamSearch.EndtDate_Invoice + "'";
                strconcat = " and ";
            }

            if (WhSQL != null && WhSQL != "")
            {
                strSQL = strSQL + " where " + WhSQL;
            }

            strSQL += " Order by podate, popartyname, POStockItemName";

            SqlCommand cmd        = new SqlCommand(strSQL, Common.conn);
            DataSet    dsLeadTime = new DataSet();
            using (SqlDataAdapter sda = new SqlDataAdapter())
            {
                sda.SelectCommand = cmd;
                sda.Fill(dsLeadTime, "rpt_LeadTime");
            }
            return(dsLeadTime);
        }
        catch (Exception ex)
        {
            return(null);
        }
    }