| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Runtime.InteropServices;
- using System.Security.Cryptography.X509Certificates;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Windows.Forms;
- using System.Windows.Forms.DataVisualization.Charting;
- using UAS_MES.CustomControl.DataGrid_View;
- using UAS_MES.DataOperate;
- using UAS_MES.PublicForm;
- using UAS_MES.PublicMethod;
- namespace UAS_MES
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- [DllImport("kernel32.dll")]
- public static extern bool d(int freq, int duration);
- private void button3_Click(object sender, EventArgs e)
- {
- d(800, 600);
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- DataGridViewCheckBoxColumn checkboxCol = new DataGridViewCheckBoxColumn();
- checkboxCol.Name = "全选";
- //创建复选框列头单元格
- DataGridViewCheckBoxHeaderCell ch = new DataGridViewCheckBoxHeaderCell(TestDGV, checkboxCol);
- //设置复选框那列的单元格为复选框
- checkboxCol.HeaderCell = ch;
- this.TestDGV.Columns.Add(checkboxCol);
- blurSearch1.TableName = "Make";
- blurSearch1.Field = "ma_code";
- DataHelper dh = new DataHelper();
- ViewChart((DataTable)dh.ExecuteSql("select nvl(ms_nextstepcode ,'已完工')ms_nextstepcode ,count(*) from makeserial left join makecraftdetail on ms_makecode=mcd_macode and ms_nextstepcode =mcd_nextstepcode where ms_makecode='MB17050022' group by ms_nextstepcode", "select"), "TExt");
- }
- private void ViewChart(DataTable _dt, string _title)
- {
- List<string> xData = new List<string>();
- List<int> yData = new List<int>();
- for (int i = 0; i < _dt.Rows.Count; i++)
- {
- xData.Add(_dt.Rows[i]["ms_nextstepcode"].ToString());
- yData.Add(int.Parse(_dt.Rows[i]["count(*)"].ToString()));
- }
- ct_coll.Series[0]["PieLineColor"] = "Red";//绘制黑色的连线。
- this.ct_coll.Series[0].ToolTip = "#VAL{D}件";//鼠标移动到上面显示的文字
- this.ct_coll.Series[0].BackSecondaryColor = Color.DarkCyan;
- this.ct_coll.Series[0].BorderColor = Color.DarkOliveGreen;
- this.ct_coll.Series[0].LabelBackColor = Color.Transparent;
- ct_coll.ChartAreas[0].Area3DStyle.Enable3D = true;
- ct_coll.Series[0].Points.DataBindXY(xData, yData);
- }
- private void normalButton2_Click(object sender, EventArgs e)
- {
- //DataHelper dh = new DataHelper();
- //string[] TestData = new string[3] {"Test","1321","213" };
- //dh.CallProcedure("TestPro",ref TestData);
- //for (int i = 0; i < TestData.Length; i++)
- //{
- // Console.WriteLine(TestData[i]);
- //}
- enterTextBox2.Text = "13132";
- }
- private void normalButton3_Click(object sender, EventArgs e)
- {
- DataHelper dh = new DataHelper();
- DataTable dt=(DataTable) dh.ExecuteSql("select sn_id,sn_caller from cs$sysnavation","select");
- string[] dd = new string[dt.Rows.Count];
- string[] dd1 = new string[dd.Length];
- for (int i = 0; i < dd.Length; i++)
- {
- string data = dt.Rows[i]["sn_caller"].ToString();
- string module = data.Split('!')[0];
- dd[i] = module+"."+ data.Replace("!","_");
- dd1[i] = dt.Rows[i]["sn_id"].ToString();
- }
- dh.BatchInsert("update cs$sysnavation set sn_classname=:dd where sn_id=:dd1",new string[] { "dd", "dd1"},dd,dd1);
- }
- }
- }
|