Пример #1
0
        /// <summary>
        /// 更新批次
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void label_freg_Click(object sender, EventArgs e)
        {
            string ret = CheckTimeRule();

            if (ret != "")
            {
                MessageBox.Show(ret);
                return;
            }
            else
            {
                foreach (Control c in panel1.Controls)
                {
                    if (c is TimeRow)
                    {
                        TimeRow tr = (TimeRow)c;
                        update.UpdateTimeRule(tr.label1.Text, tr.Start_Time.Text, tr.End_Time.Text, false);
                    }
                }
            }

            StringBuilder mrg = new StringBuilder();

            dt = sel.getDFreg().Tables[0];
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                checkSubRule(i);
                string[] time = dt.Rows[i][4].ToString().Split('_');
                if (time.Length > 0)
                {
                    for (int j = 0; j < time.Length; j++)
                    {
                        if (sel.getOrderID(time[j]).Tables[0].Rows.Count > 0)
                        {
                            string order = sel.getOrderID(time[j]).Tables[0].Rows[0][0].ToString();
                            codeid = dt.Rows[i][0].ToString() + (j + 1);
                            update.updateFreqRule(time[j], order, dt.Rows[i][0].ToString(), codeid);
                        }
                        else
                        {
                            mrg.Append("找不到" + time[j] + "的批次" + "\n");
                        }
                    }
                }
            }
            MessageBox.Show("更新成功");
            if (mrg.ToString() != "")
            {
                MessageBox.Show(mrg.ToString(), "请到时间规则维护");
            }
        }
Пример #2
0
 /// <summary>
 /// 加载界面
 /// </summary>
 private void addcontrols()
 {
     dt = new DataTable();
     dt = sel.getDFreg().Tables[0];
     showrow(dt);
 }