Esempio n. 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 Print_btn_Click(object sender, EventArgs e)
 {
     if (Carton_txt.Text != "" && sumNum != 0)
     {
         DataTable dt = new DataTable();
         dt.Columns.Add("carton_id");
         dt.Columns.Add("date");
         dt.Columns.Add("type");
         dt.Columns.Add("model");
         dt.Columns.Add("owner");
         dt.Columns.Add("qty");
         DataRow dr = dt.NewRow();
         dr["carton_id"] = Carton_txt.Text.ToUpper();
         dr["date"]      = registerDate.ToString("yyyy/MM/dd");
         dr["type"]      = "报废";
         dr["model"]     = model_txt.Text;
         dr["owner"]     = uInfo.r_username;
         dr["qty"]       = sumNum.ToString();
         dt.Rows.Add(dr);
         iPrint.Print(ref dt);
         Record_txt.Enabled = false;
     }
 }
Esempio n. 3
0
        private void submit_btn_Click(object sender, EventArgs e)
        {
            InfoPrint iPrint = new InfoPrint(rInfo);

            iPrint.Print();
        }
Esempio n. 4
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          = 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();
            }
        }
 /// <summary>
 /// 点击打印操作
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Print_Click(object sender, EventArgs e)
 {
     iPrint = new InfoPrint(rInfo);
     iPrint.Print();
 }