Exemplo n.º 1
0
    protected void btnExport_Click(object sender, EventArgs e)
    {
        try
        {

            ErrorMsgLabel.Text = "";

            if (this.slpStAcceptDate.Text.Trim()=="")
            {
                ErrorMsgLabel.Text = "請輸入門市進貨日";
                return;
            }

            if (this.slpRouteS.Text.Trim()=="")
            {
                ErrorMsgLabel.Text = "請輸入路線起";
                return;
            }

            if (this.slpRouteE.Text.Trim()=="")
            {
                ErrorMsgLabel.Text = "請輸入路線迄";
                return;
            }

            VDS_IVM35_BCO BCO = new VDS_IVM35_BCO(ConntionDB);
            
            ArrayList ParameterList = new ArrayList();
            ParameterList.Clear();
            ParameterList.Add(BCO.GetValueSetParameter(slpStAcceptDate.Text,"date",false));
            ParameterList.Add(this.slpRouteS.Text);
            ParameterList.Add(this.slpRouteE.Text);
            ParameterList.Add(Session["UID"].ToString());

            DataTable dtTemp = BCO.QueryData(ParameterList);
            if (dtTemp.Rows.Count == 0)
            {
                ErrorMsgLabel.Text = "查無可匯出之資料";
            }
            else
            {

                Export_Excel(GetResultData(dtTemp));
            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        finally { }
    }
Exemplo n.º 2
0
    protected void btnQuery_Click(object sender, EventArgs e)
    {
        try
        {
            ErrorMsgLabel.Text = "";

            if (this.slpStAcceptDate.Text.Trim() == "")
            {
                ErrorMsgLabel.Text = "請輸入門市進貨日";
                return;
            }

            if (this.slpRouteS.Text.Trim() == "")
            {
                ErrorMsgLabel.Text = "請輸入路線起";
                return;
            }

            if (this.slpRouteE.Text.Trim() == "")
            {
                ErrorMsgLabel.Text = "請輸入路線訖";
                return;
            }

            VDS_IVM35_BCO BCO = new VDS_IVM35_BCO(ConntionDB);

            ArrayList ParameterList = new ArrayList();
            ParameterList.Clear();
            ParameterList.Add(BCO.GetValueSetParameter(slpStAcceptDate.Text, "date", false));
            ParameterList.Add(this.slpRouteS.Text);
            ParameterList.Add(this.slpRouteE.Text);
            ParameterList.Add(Session["UID"].ToString());

            DataTable dtTemp = BCO.QueryData(ParameterList);
            if (dtTemp.Rows.Count == 0)
            {
                PanelG1.Visible = false;

                ErrorMsgLabel.Text = "查無資料";
                Repeater1.DataSource = null;
                Repeater1.DataBind();
            }
            else
            {
                PanelG1.Visible = true;
                Repeater1.DataSource = GetResultData(dtTemp);
                Repeater1.DataBind();
            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        finally { }
    }