贴标角度设置.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using UAS_LabelMachine.Entity;
  10. using UAS_LabelMachine.PublicMethod;
  11. namespace UAS_LabelMachine
  12. {
  13. public partial class 贴标角度设置 : Form
  14. {
  15. DataHelper dh = SystemInf.dh;
  16. string custcode;
  17. public 贴标角度设置(string CustCode)
  18. {
  19. custcode = CustCode;
  20. InitializeComponent();
  21. }
  22. private void 附件内容打印_Load(object sender, EventArgs e)
  23. {
  24. DataTable dt = (DataTable)dh.ExecuteSql("select * from PRINTXY where px_custcode='" + custcode + "' ", "select");
  25. if (dt.Rows.Count > 0)
  26. {
  27. X.Text = dt.Rows[0]["px_x"].ToString();
  28. Y.Text = dt.Rows[0]["px_y"].ToString();
  29. angle.Text = dt.Rows[0]["px_angle"].ToString();
  30. }
  31. }
  32. private void Confirm_Click(object sender, EventArgs e)
  33. {
  34. if (dh.CheckExist("PRINTXY", "px_custcode='" + custcode + "'"))
  35. {
  36. dh.ExecuteSql("update PRINTXY set px_x='"+X.Text+"',px_y='"+Y.Text+"',px_angle='"+angle.Text+"' and px_custcode='"+custcode+"'", "update");
  37. }
  38. else {
  39. dh.ExecuteSql("insert into PRINTXY (px_x,px_y,px_angle,px_custcode)values('" + X.Text + "','" + Y.Text + "','" + angle.Text + "','"+custcode+"')", "insert");
  40. }
  41. LogManager.DoCommandLog(custcode, User.UserCode, "保持贴标角度成功", "成功");
  42. MessageBox.Show("保存成功");
  43. Close();
  44. }
  45. }
  46. }