public void Save_LineInfo_LineStatus(Line line, string lineID, DataTable tbl) { //Update datatable with new info foreach (DataRow row in tbl.Rows) { string LineID = row["LineID"].ToString(); string sql_cmd; int x, y, w, h; //Get the information of object and update to the table if (line.Get_WST_LocationAndSize(LineID, out x, out y, out w, out h)) { row["Line_x"] = x; row["Line_y"] = y; row["Line_width"] = w; row["Line_height"] = h; sql_cmd = "update [R_009_Line_Status] set [Line_x] = '" + x + "', Line_y = '" + y + "', Line_width = '" + w + "', Line_height = '" + h + "'"; sql_cmd += " where LineID = '" + LineID + "'"; sqlObj.Execute_SQL_CMD(sql_cmd); sqlObj.Save_My_Data(); } } return; }
public void Save_LineInfo(Line line) { string lineID = FindLineID(line.LineName); DataTable tbl = Load_FullLineInfo(lineID); //Update datatable with new info foreach (DataRow row in tbl.Rows) { string WST_ID = row["WST_ID"].ToString(); int x, y, w, h; //Get the information of object and update to the table if (line.Get_WST_LocationAndSize(WST_ID,out x, out y, out w, out h)) { row["WST_x"] = x; row["WST_y"] = y; row["WST_width"] = w; row["WST_heigh"] = h; } } Update_SQL_Data(List_Line_da, tbl); return; }