Files
FG2608061/CODE/20230901/SA17168/AGVSystem Ver2.0/Point_loc_Set.cs
T

58 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace AGVSystem
{
public partial class Point_loc_Set : Form
{
private ClsDBConn_sql db = new ClsDBConn_sql();
public Point_loc_Set()
{
InitializeComponent();
}
public Point_loc_Set(int x, int y)
{
InitializeComponent();
num1.Value = x;
num2.Value = y;
}
private void button1_Click(object sender, EventArgs e)
{
if (cmb.SelectedIndex > 0)
{
string sqlstr = "UPDATE [LandMarkInfo] " +
" SET[Loc_X] =" + num1.Value +
" ,[Loc_Y] = " + num2.Value +
" ,[Binding] = " + cmb.SelectedIndex +
" WHERE[Loc_ID]=" + num.Value + " And Assembly_Line=" + cmb_linelist.Text.Split('.')[0];
if ("1" == db.Command(sqlstr))
this.Close();
}
}
private void Point_loc_Set_Load(object sender, EventArgs e)
{
DataSet ds = db.connDt("select CONVERT( VARCHAR(10),id) +' . '+ line_name as info from Assembly_Line order by id");
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
cmb_linelist.Items.Add("");
foreach (DataRow dr in ds.Tables[0].Rows)
{
cmb_linelist.Items.Add(dr[0].ToString());
}
}
}
ds.Tables.Clear();
}
}
}