コード例 #1
0
ファイル: RunningRecord.cs プロジェクト: warmkid/mitcpro
        public RunningRecord(mySystem.MainForm mainform, int id)
            : base(mainform)
        {
            InitializeComponent();
            getPeople();
            setUserState();
            getOtherData();
            addDataEventHandler();

            string         asql = "select * from 制袋机组运行记录 where ID=" + id;
            SqlCommand     comm = new SqlCommand(asql, mySystem.Parameter.conn);
            SqlDataAdapter da   = new SqlDataAdapter(comm);

            DataTable tempdt = new DataTable();

            da.Fill(tempdt);
            instrid = (int)tempdt.Rows[0]["生产指令ID"];
            date    = DateTime.Parse(tempdt.Rows[0]["生产日期"].ToString());
            // instrcode = Parameter.csbagInstruction;

            readOuterData(instrid);
            outerBind();

            readInnerData((int)dt_out.Rows[0]["ID"]);
            innerBind();

            setFormState();
            setEnableReadOnly();
        }
コード例 #2
0
ファイル: RunningRecord.cs プロジェクト: warmkid/mitcpro
 public RunningRecord(mySystem.MainForm mainform)
     : base(mainform)
 {
     InitializeComponent();
     getPeople();
     setUserState();
     getOtherData();
     addDataEventHandler();
     instrcode = mySystem.Parameter.csbagInstruction;
     instrid   = mySystem.Parameter.csbagInstruID;
     readOuterData(mySystem.Parameter.csbagInstruID);
     //outerBind();
     if (dt_out.Rows.Count == 0)
     {
         DataRow dr = dt_out.NewRow();
         dr = writeOuterDefault(dr);
         dt_out.Rows.Add(dr);
         da_out.Update(dt_out);
         readOuterData(mySystem.Parameter.csbagInstruID);
     }
     _id = (int)dt_out.Rows[0]["ID"];
     outerBind();
     readInnerData(_id);
     innerBind();
     setFormState();
     setEnableReadOnly();
     //foreach (Control c in this.Controls)
     //    c.Enabled = false;
     //dataGridView1.Enabled = true;
     //dataGridView1.ReadOnly = true;
     //dtp生产日期.Enabled = true;
     //bt插入查询.Enabled = true;
 }