public QC_Reports() { InitializeComponent(); AppHelper AH = new AppHelper(); IsInOANet IsOANet = new IsInOANet(); string Url = AH.ReadConfig("appSettings", "NetCheck"); if (IsOANet.IsCanConnect(Url)) { string CamText = AH.ReadConfig("appSettings", "Data_for_QCReports"); DataSet ds = new DataSet(); ds = Func.DBbind(CamText); // ds = Func.DBbind("select '甲' as name,50 as value union all select '乙',60 union all select '丙',70 union all select '丁',80"); Func.DrawingChart("品質不良報表", this.panel1, ds, ChartType.Histogram, 0, 100, 10, ""); } else { MessageBox.Show("無法連接到OA 網絡請檢查網絡連接", "系統提示", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Close(); } }
static void Main() { int count=0; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //Application.Run(new Input_Output()); Application.Run(new Fly_Form()); // Application.Run(new Main_From()); foreach (Process p in Process.GetProcesses()) { if (p.ProcessName == "IMES_Reports") { count++; } } if (count < 2) { AppHelper AH = new AppHelper(); AH.WriteConfig("IsOpen", "NO"); } }
void Init_FlashForm() { this.button1.Visible = false; this.BT_QC.Visible = false; this.button3.Visible = false; this.button4.Visible = false; AppHelper AH = new AppHelper(); if (AH.Buttun_Check("Btn_For_Delivery")) { this.button1.Visible = true; } else { this.button1.Visible = false; } if (AH.Buttun_Check("Btn_For_QC")) { this.BT_QC.Visible = true; if (!AH.Buttun_Check("Btn_For_Delivery")) { this.BT_QC.Location = new System.Drawing.Point(36, 25); this.button3.Location = new System.Drawing.Point(133, 25); this.button4.Location = new System.Drawing.Point(238, 25); } else { this.button1.Location = new System.Drawing.Point(36, 25); this.BT_QC.Location = new System.Drawing.Point(133, 25); this.button3.Location = new System.Drawing.Point(238, 25); this.button4.Location = new System.Drawing.Point(347, 25); } } else { this.BT_QC.Visible = false; } if (AH.Buttun_Check("Btn_For_Product")) { this.button3.Visible = true; if (!AH.Buttun_Check("Btn_For_Delivery") && !AH.Buttun_Check("Btn_For_QC")) { this.button3.Location = new System.Drawing.Point(36, 25); // this.button4.Location = new System.Drawing.Point(133, 25); //this.button4.Location = new System.Drawing.Point(238, 25); } else if (!AH.Buttun_Check("Btn_For_Delivery")) { // this.BT_QC.Location = new System.Drawing.Point(36, 25); this.button3.Location = new System.Drawing.Point(133, 25); //this.button4.Location = new System.Drawing.Point(238, 25); } else if (!AH.Buttun_Check("Btn_For_QC")) { //this.button3.Location = new System.Drawing.Point(36, 25); this.button3.Location = new System.Drawing.Point(133, 25); // this.button4.Location = new System.Drawing.Point(238, 25); } //else //{ // this.button1.Location = new System.Drawing.Point(36, 25); // this.BT_QC.Location = new System.Drawing.Point(133, 25); // this.button3.Location = new System.Drawing.Point(238, 25); // this.button4.Location = new System.Drawing.Point(347, 25); //} } else { this.button3.Visible = false; } if (AH.Buttun_Check("Btn_For_WIP")) { this.button4.Visible = true; if (!AH.Buttun_Check("Btn_For_Delivery") && !AH.Buttun_Check("Btn_For_QC") && !AH.Buttun_Check("Btn_For_Product")) { this.button4.Location = new System.Drawing.Point(36, 25); //this.button4.Location = new System.Drawing.Point(133, 25); //this.button4.Location = new System.Drawing.Point(238, 25); } else if (!AH.Buttun_Check("Btn_For_Delivery") && !AH.Buttun_Check("Btn_For_QC")) { //this.button3.Location = new System.Drawing.Point(36, 25); this.button4.Location = new System.Drawing.Point(133, 25); //this.button4.Location = new System.Drawing.Point(238, 25); } else if (!AH.Buttun_Check("Btn_For_Delivery") && !AH.Buttun_Check("Btn_For_Product")) { // this.button4.Location = new System.Drawing.Point(36, 25); this.button4.Location = new System.Drawing.Point(133, 25); //this.button4.Location = new System.Drawing.Point(238, 25); } else if (!AH.Buttun_Check("Btn_For_QC") && !AH.Buttun_Check("Btn_For_Product")) { // this.button4.Location = new System.Drawing.Point(36, 25); this.button4.Location = new System.Drawing.Point(133, 25); // this.button4.Location = new System.Drawing.Point(238, 25); } else if (!AH.Buttun_Check("Btn_For_QC") || !AH.Buttun_Check("Btn_For_Product") || !AH.Buttun_Check("Btn_For_Delivery")) { // this.button4.Location = new System.Drawing.Point(36, 25); //this.button4.Location = new System.Drawing.Point(133, 25); this.button4.Location = new System.Drawing.Point(238, 25); } //else //{ // this.button1.Location = new System.Drawing.Point(36, 25); // this.BT_QC.Location = new System.Drawing.Point(133, 25); // this.button3.Location = new System.Drawing.Point(238, 25); // this.button4.Location = new System.Drawing.Point(347, 25); //} } else { this.button4.Visible = false; } }
//public string GetRNum(string Input) //{ // string Check=""; // if (Input.Length==0) { // Check = ""; // } // if (Code_Check(Input)) // { // Check = Input; // } // return Check; //} //public string Code_Check() //{ // bool IsExist=false; // AppHelper app=new AppHelper(); // app.ReadConfig("appSettings", "connectionstring"); // Data_Factory df = new Data_Factory(); // return IsExist; //} public bool Code_Check() { bool IsExist = false; AppHelper app = new AppHelper(); app.ReadConfig("appSettings", "connectionstring"); Data_Factory df = new Data_Factory(); return IsExist; }