Exemple #1
0
        /// <summary>
        /// 提交内容
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void submit_btn_Click(object sender, EventArgs e)
        {
            if (model_cbx.SelectedItem.ToString() == "")
            {
                return;
            }
            if (rInfo.serials.Count <= 0)
            {
                result_lbl.Text = "No data for upload";
                return;
            }
            rInfo.record_id     = uInfo.r_user;
            rInfo.site          = site_txt.Text;
            rInfo.holder_dept   = string.Empty;
            rInfo.holder_emp    = string.Empty;
            rInfo.holder_name   = string.Empty;
            rInfo.register_emp  = uInfo.r_user;
            rInfo.register_date = DateTime.Now;
            rInfo.register_name = uInfo.r_username;
            rInfo.type          = 4;
            rInfo.statue        = "I";


            rInfo.reason = reason_txt.Text;;

            MessageFrm mesFrm = new MessageFrm();

            mesFrm.label1.Text = "是否确认保留品登记!";
            mesFrm.ShowDialog();
            DialogResult = mesFrm.DialogResult;
            bool flag = false;

            if (DialogResult == DialogResult.Yes)
            {
                flag = dbFaci.ExecuteObject(ref rInfo);
            }
            else
            {
                return;
            }
            if (flag == false)
            {
                MessageBox.Show("提交失败!请检查数据是否有误");
                return;
            }
            else
            {
                DialogResult = MessageBox.Show("成功提交!是否打印标签?", "信息提示", MessageBoxButtons.YesNo);
                if (DialogResult == DialogResult.Yes)
                {
                    InfoPrint iPrint = new InfoPrint(rInfo);
                    iPrint.Print();
                }
                rInfo = null;
                this.Close();
            }
        }
        /// <summary>
        /// 提交内容
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void submit_btn_Click(object sender, EventArgs e)
        {
            if (model_cbx.SelectedItem.ToString() == "")
            {
                return;
            }
            if (rInfo.serials.Count <= 0)
            {
                result_lbl.Text = "No data for upload";
                return;
            }
            rInfo.record_id     = uInfo.r_user;
            rInfo.site          = site_txt.Text;
            rInfo.holder_dept   = string.Empty;
            rInfo.holder_emp    = string.Empty;
            rInfo.holder_name   = string.Empty;
            rInfo.register_emp  = uInfo.r_user;
            rInfo.register_date = DateTime.Now;
            rInfo.register_name = uInfo.r_username;
            rInfo.type          = 2;
            //rInfo.statue = "N";

            switch (cbx_reason.SelectedItem.ToString())
            {
            case "正常生产报废":
                rInfo.statue = "G";
                break;

            case "半成品报废":
                rInfo.statue = "H";
                break;

            case "客户返品报废":
                rInfo.statue = "C";
                break;

            case "培训小组报废":
                rInfo.statue = "E";
                break;

            case "制造报废前扫描":
                rInfo.statue = "B";
                break;

            case "实验品保存":
                rInfo.statue = "Q";
                break;

            case "外观不良报废":
                rInfo.statue = "A";
                break;
            }


            rInfo.reason = cbx_reason.SelectedItem.ToString();

            MessageFrm mesFrm = new MessageFrm();

            mesFrm.label1.Text = "是否确认报废处理!";
            mesFrm.ShowDialog();
            DialogResult = mesFrm.DialogResult;
            bool flag = false;

            if (DialogResult == DialogResult.Yes)
            {
                flag = dbFaci.ExecuteObject(ref rInfo);
            }
            else
            {
                return;
            }
            if (flag == false)
            {
                MessageBox.Show("提交失败!请检查数据是否有误");
                return;
            }
            else
            {
                DialogResult = MessageBox.Show("成功提交!是否打印标签?", "信息提示", MessageBoxButtons.YesNo);
                if (DialogResult == DialogResult.Yes)
                {
                    InfoPrint iPrint = new InfoPrint(rInfo);
                    iPrint.Print();
                }
                rInfo = null;
                this.Close();
            }
        }