Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string type = "";
            if (Request["TYPE"] == null)
            {
                return;
            }
            type = Request["TYPE"];
            switch (type)
            {
            case "1":    //获取仓库
                DataSet ds = null;
                try
                {
                    ds = THDQuery.GetTHDCKID();
                }
                catch (Exception ex)
                {
                    string a = ex.Message;
                    Response.Write("ERROR");
                }
                if (ds != null)
                {
                    try
                    {
                        XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding);
                        writer.Formatting  = Formatting.Indented;
                        writer.Indentation = 4;
                        writer.IndentChar  = ' ';
                        ds.WriteXml(writer);
                        writer.Flush();
                        writer.Close();
                        Response.End();
                    }
                    catch
                    { }
                }
                break;

            case "2":    //制单人
                DataSet ds2 = null;
                try
                {
                    ds2 = THDQuery.GetTHDZDR();
                }
                catch (Exception ex)
                {
                    string a = ex.Message;
                    Response.Write("ERROR");
                }
                if (ds2 != null)
                {
                    try
                    {
                        XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding);
                        writer.Formatting  = Formatting.Indented;
                        writer.Indentation = 4;
                        writer.IndentChar  = ' ';
                        ds2.WriteXml(writer);
                        writer.Flush();
                        writer.Close();
                        Response.End();
                    }
                    catch
                    { }
                }
                break;

            case "3":
                DataSet ds3 = null;
                try
                {
                    ds3 = THDQuery.GetTHDFYDH();
                }
                catch (Exception ex)
                {
                    string a = ex.Message;
                    Response.Write("ERROR");
                }
                if (ds3 != null)
                {
                    try
                    {
                        XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding);
                        writer.Formatting  = Formatting.Indented;
                        writer.Indentation = 4;
                        writer.IndentChar  = ' ';
                        ds3.WriteXml(writer);
                        writer.Flush();
                        writer.Close();
                        Response.End();
                    }
                    catch
                    { }
                }
                break;

            case "4":
                DataSet ds4 = null;
                try
                {
                    ds4 = THDQuery.GetTHDNCBM();
                }
                catch (Exception ex)
                {
                    string a = ex.Message;
                    Response.Write("ERROR");
                }
                if (ds4 != null)
                {
                    try
                    {
                        XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding);
                        writer.Formatting  = Formatting.Indented;
                        writer.Indentation = 4;
                        writer.IndentChar  = ' ';
                        ds4.WriteXml(writer);
                        writer.Flush();
                        writer.Close();
                        Response.End();
                    }
                    catch
                    { }
                }
                break;

            case "5":
                DataSet ds5 = null;
                try
                {
                    ds5 = THDQuery.GetTHDH();
                }
                catch (Exception ex)
                {
                    string a = ex.Message;
                    Response.Write("ERROR");
                }
                if (ds5 != null)
                {
                    try
                    {
                        XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding);
                        writer.Formatting  = Formatting.Indented;
                        writer.Indentation = 4;
                        writer.IndentChar  = ' ';
                        ds5.WriteXml(writer);
                        writer.Flush();
                        writer.Close();
                        Response.End();
                    }
                    catch
                    { }
                }
                break;

            case "6":
                DataSet ds6 = null;
                try
                {
                    ds6 = THDQuery.GetTHDPH();
                }
                catch (Exception ex)
                {
                    string a = ex.Message;
                    Response.Write("ERROR");
                }
                if (ds6 != null)
                {
                    try
                    {
                        XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding);
                        writer.Formatting  = Formatting.Indented;
                        writer.Indentation = 4;
                        writer.IndentChar  = ' ';
                        ds6.WriteXml(writer);
                        writer.Flush();
                        writer.Close();
                        Response.End();
                    }
                    catch
                    { }
                }
                break;

            case "7":
                DataSet ds7 = null;
                try
                {
                    ds7 = THDQuery.GetTHDWLH();
                }
                catch (Exception ex)
                {
                    string a = ex.Message;
                    Response.Write("ERROR");
                }
                if (ds7 != null)
                {
                    try
                    {
                        XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding);
                        writer.Formatting  = Formatting.Indented;
                        writer.Indentation = 4;
                        writer.IndentChar  = ' ';
                        ds7.WriteXml(writer);
                        writer.Flush();
                        writer.Close();
                        Response.End();
                    }
                    catch
                    { }
                }
                break;

            case "8":
                DataSet ds8 = null;
                try
                {
                    ds8 = THDQuery.GetTHDGG();
                }
                catch (Exception ex)
                {
                    string a = ex.Message;
                    Response.Write("ERROR");
                }
                if (ds8 != null)
                {
                    try
                    {
                        XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding);
                        writer.Formatting  = Formatting.Indented;
                        writer.Indentation = 4;
                        writer.IndentChar  = ' ';
                        ds8.WriteXml(writer);
                        writer.Flush();
                        writer.Close();
                        Response.End();
                    }
                    catch
                    { }
                }
                break;

            case "9":
                DataSet ds9 = null;
                try
                {
                    ds9 = THDQuery.GetTHDSX();
                }
                catch (Exception ex)
                {
                    string a = ex.Message;
                    Response.Write("ERROR");
                }
                if (ds9 != null)
                {
                    try
                    {
                        XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding);
                        writer.Formatting  = Formatting.Indented;
                        writer.Indentation = 4;
                        writer.IndentChar  = ' ';
                        ds9.WriteXml(writer);
                        writer.Flush();
                        writer.Close();
                        Response.End();
                    }
                    catch
                    { }
                }
                break;

            case "10":
                DataSet ds10 = null;
                try
                {
                    ds10 = THDQuery.GetTHDKHH();
                }
                catch (Exception ex)
                {
                    string a = ex.Message;
                    Response.Write("ERROR");
                }
                if (ds10 != null)
                {
                    try
                    {
                        XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding);
                        writer.Formatting  = Formatting.Indented;
                        writer.Indentation = 4;
                        writer.IndentChar  = ' ';
                        ds10.WriteXml(writer);
                        writer.Flush();
                        writer.Close();
                        Response.End();
                    }
                    catch
                    { }
                }
                break;
            }
        }
    }