예제 #1
0
    protected void SearchData()
    {
        String dat = txt_contractStartDate.Text;
        //String tim = txt_happen_Time.Text;

        Staff _operator = new Staff("Company");
        string condition = " WHERE 1=1";
        if (txt_Query_Reason.Text != "") 
        {
            condition += " AND MaterialName  like '%" + txt_Query_Reason.Text.Trim() + "%' ";
        }
        if (dat != "" ) 
        {
            condition += " AND (RelnventoryDate BETWEEN '" + dat + " 00:00:00' AND '" + dat + " 23:59:59')";
        }
        //condition += query_company;
        DataSet ds = _operator.SelectSQL("SELECT *  FROM [MROS].[dbo].[ICS_ReInventory] " + condition + " ORDER BY  [RelnventoryDate] DESC ");
        Session["DS_INT"] = ds;
        if (ds.Tables[0].Rows.Count == 0)
        {
            ShowMsg2(UpdatePanel1, "查詢無資料");
        }
       
            gv.DataSource = ds;
            gv.DataBind();
        
    }
예제 #2
0
    protected void SearchData()
    {

        Staff _operator = new Staff("Company");
        string conditionName = ddlst_SearchType.SelectedValue;
        string condition = (txt_Query_Reason.Text.Trim().Length > 0 ? " WHERE  " + conditionName + " like '%" + txt_Query_Reason.Text.Trim() + "%' " : "");
        //condition += query_company;
        DataSet ds = _operator.SelectSQL("SELECT [MaterialID],[MaterialName],[Quantity],[MaterialCost]  FROM [View_ICS_Inventory] " + condition + " ");
        Session["DS_INT"] = ds;
        gv.DataSource = ds;
        gv.DataBind();
        if (ds.Tables[0].Rows.Count == 0)
        {
            ShowMsg2(UpdatePanel1, "查詢無資料");
        }

    }