Ejemplo n.º 1
0
    public void BindProID()
    {
        DataSet dsProID = CTMFunction.GetProID();

        cobProID.DataSource = dsProID.Tables[0];
        cobProID.TextField  = "PRODUCT_CODE";
        cobProID.ValueField = "PRODUCT_CODE";
        cobProID.DataBind();
        cobProID.Items.Insert(0, new ListEditItem("ALL", "ALL"));
        cobProID.SelectedIndex = 0;
    }
Ejemplo n.º 2
0
    public void BindFactory()
    {
        DataSet dsFactory = CTMFunction.GetFactoryWorkPlace();

        cobFactory.DataSource = dsFactory.Tables[0];
        cobFactory.TextField  = "LOCATION_NAME";
        cobFactory.ValueField = "LOCATION_KEY";
        cobFactory.DataBind();
        cobFactory.Items.Insert(0, new ListEditItem("ALL", "ALL"));
        cobFactory.SelectedIndex = 0;
    }
Ejemplo n.º 3
0
    public void BindWO()
    {
        DataSet dsWO = CTMFunction.GetWO();
        //cobWO.DataSource = dsWO.Tables[0];
        //cobWO.TextField = "ORDER_NUMBER";
        //cobWO.ValueField = "ORDER_NUMBER";
        //cobWO.DataBind();
        //cobWO.Items.Insert(0,new ListEditItem("ALL","ALL"));
        //cobWO.SelectedIndex = 0;

        ASPxListBox lstWO = this.ddeWO.FindControl("lstWO") as ASPxListBox;

        if (lstWO != null)
        {
            lstWO.DataSource = dsWO.Tables[0];
            lstWO.TextField  = "ORDER_NUMBER";
            lstWO.ValueField = "ORDER_NUMBER";
            lstWO.DataBind();
            lstWO.Items.Insert(0, new ListEditItem("ALL", "ALL"));
        }
    }
Ejemplo n.º 4
0
    protected void btnQuery_Click(object sender, EventArgs e)
    {
        string sFactoryKey, sProID, sWO, sStartSN, sEndSN, sStartDate, sEndDate, sDeviceNo, sDefault;

        sFactoryKey = Convert.ToString(cobFactory.Value);
        sProID      = Convert.ToString(cobProID.Value);
        //sWO = Convert.ToString(cobWO.Value);
        sWO        = ddeWO.Text.Trim();
        sStartSN   = txtStartSN.Text.Trim();
        sEndSN     = txtEndSN.Text.Trim();
        sStartDate = dStartDate.Text;
        sEndDate   = dEndDate.Text;
        sDeviceNo  = txtDeviceNo.Text.Trim();
        if (sFactoryKey == "ALL")
        {
            sFactoryKey = "";
        }
        if (sProID == "ALL")
        {
            sProID = "";
        }
        if (!string.IsNullOrEmpty(sStartDate))
        {
            sStartDate = Convert.ToDateTime(sStartDate).ToString("yyy-MM-dd") + " 00:00:00";
        }
        if (!string.IsNullOrEmpty(sEndDate))
        {
            sEndDate = Convert.ToDateTime(sEndDate).ToString("yyyy-MM-dd") + " 23:59:59";
        }
        if (chDefault.Checked == true)
        {
            sDefault = "1";
        }
        else
        {
            sDefault = "0";
        }
        string partNumber = this.txtPartNumber.Text;

        if (partNumber.ToUpper() == "ALL")
        {
            partNumber = string.Empty;
        }
        if (sFactoryKey == "" && sProID == "" && sWO == "" && sStartSN == "" && sEndSN == "" && sStartDate == "" && sEndDate == "" && sDeviceNo == "")
        {
            base.ShowMessageBox(this.Page, "查询参数不能都为空!");
            return;
        }
        try
        {
            CTMFunction ctmFunction = new CTMFunction();
            DataSet     dsCTM       = ctmFunction.GetCTMListData(sFactoryKey, sProID, sWO, partNumber, sStartSN, sEndSN, sStartDate, sEndDate, sDeviceNo, sDefault);
            Cache[Session.SessionID + "CTM"] = dsCTM.Tables[0];

            this.gvCTMRport.Columns.Clear();
            this.gvCTMRport.AutoGenerateColumns = true;
            this.gvCTMRport.DataSource          = dsCTM.Tables[0];
            this.gvCTMRport.DataBind();
            this.gvCTMRport.AutoGenerateColumns = false;

            this.UpdatePanelResult.Update();
        }
        catch (Exception ex)
        {
            base.ShowMessageBox(this.Page, "错误:" + ex.Message);
            return;
        }
    }