Beispiel #1
0
        /// <summary>
        /// 确认保存终检缺陷
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                Bll.T_CheckResult t_CheckResult = new T_CheckResult();
                string            masterBarCode = Model.UserAnswerQuestions.BarCode;


                if (this.bigPic.Controls.Count == 0)
                {
                    SendRelease();
                }
                else if (this.bigPic.Controls.Count <= dic.Keys.Count)
                {
                    SendRelease();

                    foreach (var item in dic)
                    {
                        t_CheckResult.SaveZJFlawSaved(masterBarCode, item.Value.AndoridServerPicPath, item.Value.ZJPartConfigName, item.Value.ZJFlawName, item.Value.Remark);
                    }
                }
                else
                {
                    MessageBox.Show("请添加缺陷或备注");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #2
0
        /// <summary>
        /// 保存每个终检的缺陷
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void save_Click(object sender, EventArgs e)
        {
            try
            {
                string barCode = Model.UserAnswerQuestions.BarCode;
                string picPath = this.label1.Text;
                string part1   = this.part1.SelectedItem.ToString();
                string part3   = this.part3.SelectedItem.ToString();
                string remark  = this.remark.Text;

                Bll.T_CheckResult t_CheckResult = new T_CheckResult();
                DataTable         dt            = t_CheckResult.GetZJFlawSaved(picPath);

                if (dt != null)
                {
                    if (dt.Rows.Count > 0)
                    {
                        t_CheckResult.UpdateZJFlawSaved(barCode, picPath, part1, part3, remark);
                        MessageBox.Show("修改成功");
                    }
                    else
                    {
                        if (part3 == "" || this.remark.Text == "")
                        {
                            MessageBox.Show("请选择缺陷或输入备注");
                        }
                        else
                        {
                            t_CheckResult.SaveZJFlawSaved(barCode, picPath, part1, part3, remark);
                            MessageBox.Show("保存成功");
                        }
                    }
                }
                else
                {
                    t_CheckResult.SaveZJFlawSaved(barCode, picPath, part1, part3, remark);
                    MessageBox.Show("保存成功");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("保存失败" + ex.Message);
            }
        }