前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >c#展BOM (BAAN的表结构)

c#展BOM (BAAN的表结构)

作者头像
Tony老师
发布2020-03-05 11:33:12
9980
发布2020-03-05 11:33:12
举报
文章被收录于专栏:托老师

前几天在report script写展BOM的程序,怎么也没写出来。回上海后,用C#写了一个。但是还不够完善,希望有兴趣的继续写下去。

using System; using System.Data; using System.Data.Sql; using System.Data.SqlClient; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;

    public partial class _Default : System.Web.UI.Page     {         protected void Page_Load(object sender, EventArgs e)         {

        }         protected void find_Click(object sender, EventArgs e)         {               string connectionstrings = "server=127.0.0.1;UID=sa;PWD=111111;DataBase=ERP";             SqlConnection connection = new SqlConnection(connectionstrings);             string sqltcibd001 = "select * from tcibd001 where tcibd001.item = " + "’" + mpart.Text.Trim() + "’";             SqlDataAdapter tcibd001f = new SqlDataAdapter(sqltcibd001, connection);             DataSet ds = new DataSet();             tcibd001f.Fill(ds, "tcibd001");

            DataRow dr = ds.Tables["tcibd001"].Rows[0];

            if (dr["kitm"].ToString().Trim() == "p")             {                 Response.Write("this is a p part!");                 return;             }             ///@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

            string mpartf = mpart.Text.Trim();             int mqana = 1;

            DataSet dsend = new DataSet();             DataTable p_part = new DataTable("p_part");             dsend.Tables.Add(p_part);             p_part.Columns.Add("FGpart", typeof(string));             p_part.Columns.Add("Ppart", typeof(string));             p_part.Columns.Add("Type", typeof(string));             p_part.Columns.Add("Qana", typeof(int));             ///@@@@@@@@@@@@@@@@@@@@@@@@@@             unbom(mpartf,mqana,p_part);             ///@@@@@@@@@@@@@@@@@@@@@@@@@@             unbomview.DataSource = dsend.Tables["p_part"].DefaultView;             unbomview.DataBind();         }             public string unbom(string xpart,int xqana,DataTable xtable)             {                 string[] m_part_array = new string[100];                 int[] m_qana = new int[100];                 int j = 0;                     string connectionstrings = "server=127.0.0.1;UID=sa;PWD=111111;DataBase=ERP";                     SqlConnection connection = new SqlConnection(connectionstrings);                     string sqltcibd001x = "select tcibd001.item,tcibd001.kitm from tcibd001 where tcibd001.item = " + "’" + xpart + "’";                     SqlDataAdapter tcibd001fx = new SqlDataAdapter(sqltcibd001x, connection);                     DataSet dsx = new DataSet();                     tcibd001fx.Fill(dsx, "tcibd001x");                     DataRow drx = dsx.Tables["tcibd001x"].Rows[0];                     if (drx["kitm"].ToString().Trim() == "p")                     {                         DataRow drp = xtable.NewRow();                         drp["FGpart"] = mpart.Text.Trim();                         drp["Ppart"] = drx["item"].ToString().Trim();                         drp["Type"] = drx["kitm"].ToString().Trim();                         drp["qana"] = xqana;                         xtable.Rows.Add(drp);                         return mpart.Text.Trim();                     }                     else      & nbsp;              {                         m_part_array[j] = drx["item"].ToString().Trim();                         string sqltibom010 = "select * from tibom010 where tibom010.mitm = " + "’" + m_part_array[j] + "’";                         SqlDataAdapter tibom010x = new SqlDataAdapter(sqltibom010, connection);                         tibom010x.Fill(dsx, "tibom010");

                        while (j < (dsx.Tables["tibom010"].Rows.Count))                         {                            m_part_array[j] = dsx.Tables["tibom010"].Rows[j]["sitm"].ToString();                            m_qana[j] =xqana * (Convert.ToInt32(dsx.Tables["tibom010"].Rows[j]["qana"]));

                           unbom(m_part_array[j],m_qana[j],xtable);                            j = j + 1;                         }                         return m_part_array[j];                     }             }

    }

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2008-06-19,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档