/// <summary>
 /// 删除
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void tsbtnDel_Click(object sender, EventArgs e)
 {
     try
     {
         dc = new DCQUALITYDataContext();
         idebarJoinU9 ijU9 = dc.idebarJoinU9.Where(n => n.idebarJoinU9_id == currentId).First();
         dc.idebarJoinU9.DeleteOnSubmit(ijU9);
         dc.SubmitChanges();
         MessageBox.Show("操作成功!");
         LoadData("");
     }
     catch (Exception)
     {
         MessageBox.Show("操作失败!");
         return;
     }
 }
        /// <summary>
        /// 不与U9传数据列表修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsbtnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                dc = new DCQUALITYDataContext();
                idebarJoinU9 ijU9 = dc.idebarJoinU9.Where(n => n.idebarJoinU9_id == currentId).First();
                txtPRODID.Text = ijU9.idebarJoinU9_PROD_ID;
                txtRemork.Text = ijU9.idebarJoinU9_remark;
                btnSave.Text   = "修改";

                LoadData("");
            }
            catch (Exception ex)
            {
                MessageBox.Show("请选择数据!");
                return;
            }
        }
        /// <summary>
        /// 添加、修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtPRODID.Text.Trim() == "")
                {
                    MessageBox.Show("货品名称不能为空!");
                    return;
                }

                idebarJoinU9 ij = new idebarJoinU9();
                dc = new DCQUALITYDataContext();
                if (btnSave.Text == "添加")
                {
                    ij.idebarJoinU9_PROD_ID = txtPRODID.Text.Trim();
                    ij.idebarJoinU9_remark  = txtRemork.Text.Trim();
                    dc = new DCQUALITYDataContext();
                    dc.idebarJoinU9.InsertOnSubmit(ij);
                    dc.SubmitChanges();
                    MessageBox.Show("操作成功!", "提示");
                }
                else if (btnSave.Text == "修改" && currentId > 0)
                {
                    ij = dc.idebarJoinU9.Where(n => n.idebarJoinU9_id == currentId).First();
                    ij.idebarJoinU9_PROD_ID = txtPRODID.Text.Trim();
                    ij.idebarJoinU9_remark  = txtRemork.Text.Trim();
                    dc.SubmitChanges();
                    MessageBox.Show("操作成功!", "提示");
                }
                btnSave.Text = "添加";

                txtPRODID.Text = "";
                txtRemork.Text = "";
                LoadData("");
            }
            catch (Exception ex)
            {
                MessageBox.Show("操作失败!", "提示");
                return;
            }
        }