Example #1
0
 //绑定GridView
 private void BindGridView()
 {
     try
     {
         string  sql        = GetsqlDPP();
         string  sortEx     = this.grvDPP.Attributes["SortExpression"];
         string  sortDirect = this.grvDPP.Attributes["SortDirection"];
         string  strSort    = (!string.IsNullOrEmpty(sortEx)) ? sortEx + " " + sortDirect : "";
         DataSet ds         = DPPQuery.GetQueryDPP(sql, strSort, PageControl1.GetPageSize(), PageControl1.GetCurrPage());
         this.grvDPP.DataSource = ds;
         this.grvDPP.DataBind();
         DataSet dsCount = DPPQuery.GetCount(sql);
         if (dsCount != null && dsCount.Tables[0].Rows.Count > 0 && !string.IsNullOrEmpty((dsCount.Tables[0].Rows[0]["HJZL"]).ToString()))
         {
             this.lblSum.Text = dsCount.Tables[0].Rows[0]["countAll"].ToString();
             this.lblSL.Text  = this.GetckdSL().ToString();
             this.lblZL.Text  = Convert.ToDecimal(dsCount.Tables[0].Rows[0]["HJZL"]).ToString("#0.0000");
         }
         else
         {
             this.lblSum.Text = "0";
             this.lblZL.Text  = "0";
             this.lblSL.Text  = "0";
         }
     }
     catch (Exception ex)
     {
         String strEx = ex.Message;
         this.PrintfError("数据访问错误,请重试!");
     }
 }
Example #2
0
    //重量
    private Double GetckdZL()
    {
        Double j   = 0;
        string sql = GetsqlDPP();

        j = DPPQuery.GetzongZL("ZL", "view_dp_qry", sql);
        return(j);
    }
Example #3
0
    private int GetckdSL()
    {
        int    i   = 0;
        string sql = GetsqlDPP();

        i = DPPQuery.GetzongSL("sl", "view_dp_qry", sql);
        return(i);
    }
Example #4
0
    //设置分页控件显示
    private void SetPageCountView()
    {
        //try
        //{
        string sql = GetsqlDPP();
        int    outCount;
        int    pageCount = DPPQuery.GetPageCount(sql, PageControl1.GetPageSize(), out outCount);

        PageControl1.SetInitView(pageCount, outCount);
        //}
        //catch
        //{
        //    this.PrintfError("数据访问错误,请重试!");
        //    return;
        //}
    }
Example #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request["TYPE"]))
        {
            string type = Request["TYPE"];
            switch (type)
            {
            case "1":    //打印完工单
                if (!string.IsNullOrEmpty(Request["QUERYSQL"]))
                {
                    try
                    {
                        DataSet ds      = WGDQuery.QueryWGDExcel(Request["QUERYSQL"]);
                        string  strPrin = this.DGPrint(ds.Tables[0]);
                        Response.Write(strPrin);
                    }
                    catch
                    {
                        return;
                    }
                }
                break;

            case "2":    //打印IC卡信息
                try
                {
                    DataSet ds      = ICParam.GetPrintDS(Request["QUERYSQL"]);
                    string  strPrin = this.DGPrint(ds.Tables[0]);
                    Response.Write(strPrin);
                }

                catch
                {
                    return;
                }
                break;

            case "3":    //打印发运单(进出门管理的查看发运单模块)
                try
                {
                    DataSet ds1      = InDoorParam.GetPrintDS(Request["QUERYSQL"]);
                    string  strPrin1 = this.DGPrint(ds1.Tables[0]);
                    Response.Write(strPrin1);
                }
                catch
                {
                    return;
                }
                break;

            case "4":   //打印发运单(查询)

                break;

            case "5":   //打印转库单(查询)
                try
                {
                    DataSet ds      = ZKDQuery.QueryZKDExcel(Request["QUERYSQL"]);
                    string  strPrin = this.DGPrint(ds.Tables[0]);
                    Response.Write(strPrin);
                }
                catch
                {
                    return;
                }
                break;

            case "6":   //打印移位单(查询)
                try
                {
                    DataSet ds      = YWDQuery.QueryYWDExcel(Request["QUERYSQL"]);
                    string  strPrin = this.DGPrint(ds.Tables[0]);
                    Response.Write(strPrin);
                }
                catch
                {
                    return;
                }
                break;

            case "7":    //打印退货单(查询)
                try
                {
                    DataSet ds      = THDQuery.QueryTHDExcel(Request["QUERYSQL"]);
                    string  strPrin = this.DGPrint(ds.Tables[0]);
                    Response.Write(strPrin);
                }
                catch
                {
                    return;
                }
                break;

            case "8":    //打印待判品查询单(查询)
                try
                {
                    DataSet ds      = DPPQuery.QueryPDDExcel(Request["QUERYSQL"]);
                    string  strPrin = this.DGPrint(ds.Tables[0]);
                    Response.Write(strPrin);
                }
                catch
                {
                    return;
                }
                break;

            case "9":    //打印入库账簿单(查询)
                try
                {
                    DataSet ds      = RKZBQuery.QueryRKZBExcel(Request["QUERYSQL"]);
                    string  strPrin = this.DGPrint(ds.Tables[0]);
                    Response.Write(strPrin);
                }
                catch
                {
                    return;
                }
                break;

            case "10":    //打印出库账簿单(查询)
                try
                {
                    DataSet ds      = CKZBQuery.QueryCKZBExcel(Request["QUERYSQL"]);
                    string  strPrin = this.DGPrint(ds.Tables[0]);
                    Response.Write(strPrin);
                }
                catch
                {
                    return;
                }
                break;
            }
        }
    }
Example #6
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 = DPPQuery.GetCKHID();
                }
                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 = DPPQuery.GetWLHID();
                }
                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
                {
                    string strck = "";
                    if (!string.IsNullOrEmpty(Request.QueryString["ckid"]))
                    {
                        strck = Request.QueryString["ckid"];
                    }

                    ds3 = DPPQuery.GetHWID(strck);
                }
                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 = DPPQuery.GetPCHID();
                }
                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 = DPPQuery.GetSX();
                }
                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 = DPPQuery.GetPH();
                }
                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 = DPPQuery.GetGG();
                }
                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
                {
                    string sqlstr = "";
                    if (!string.IsNullOrEmpty(Request.QueryString["ckh"]))
                    {
                        sqlstr += " and ck='" + Request.QueryString["ckh"] + "'";
                    }
                    if (!string.IsNullOrEmpty(Request.QueryString["pch"]))
                    {
                        sqlstr += " and pch='" + Request.QueryString["pch"] + "'";
                    }
                    if (!string.IsNullOrEmpty(Request.QueryString["sx"]))
                    {
                        sqlstr += " and sx='" + Request.QueryString["sx"] + "'";
                    }
                    if (!string.IsNullOrEmpty(Request.QueryString["wlh"]))
                    {
                        sqlstr += " and wlh='" + Request.QueryString["wlh"] + "'";
                    }
                    if (!string.IsNullOrEmpty(Request.QueryString["hw"]))
                    {
                        sqlstr += " and hw='" + Request.QueryString["hw"] + "'";
                    }
                    ds8 = DPPQuery.GetTSXX(sqlstr);
                }
                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;
            }
        }
    }