十一、紡織面料下架功能的實現

一、數據庫

數據庫仍用yy_textile表,前幾篇博文都敘述過這里就不再敘述
在fiber_yy數據庫下創建yy_textile表在這里插入圖片描述
在這里插入圖片描述
初始數據庫信息
在這里插入圖片描述

二、頁面

admin_undercarriage
在這里插入圖片描述

三、代碼實現

admin_undercarriage

using System;
using System.IO;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
using System.Data.SqlClient;namespace yy_Textile_fabric_inventory_management_system
{public partial class admin_undercarriage : Form{string str_conn = "server=CY-20190824RMES;Initial Catalog=fiber_yy;User ID=sa;pwd=beyond";//string str_conn = "";DataSet dsall;SqlDataAdapter mDataAdapter;public admin_undercarriage(){InitializeComponent();/*connect yy = new connect();string str = yy.str_conn();str_conn = str;*/// MessageBox.Show(str_conn);}private void button1_Click(object sender, EventArgs e){try{SqlConnection conn = new SqlConnection(str_conn);conn = new SqlConnection(str_conn);conn.Open();mDataAdapter = new SqlDataAdapter("SELECT name AS '面料名稱',number AS '面料品號',warp_density AS '經密度' ,weft_density AS '緯密度',warp_linear_density AS '經紗線密度',weft_linear_density AS '緯紗線密度',material AS '原料成分',square_meter_weight AS '平方米重量',width_of_cloth AS '幅寬',horse_length AS '匹長',organization AS '所用組織',stock AS '庫存量' FROM yy_textile", conn);dsall = new DataSet();mDataAdapter.Fill(dsall, "all_fiber");dataGridView1.DataSource = dsall.Tables["all_fiber"];conn.Close();}catch (Exception ex){MessageBox.Show(ex.Message);}}private void button2_Click(object sender, EventArgs e){try{string number = textBox1.Text;if (number.Length == 0) {MessageBox.Show("請輸入紡織面料品號");}else{byte[] MyData = new byte[0];string sql = "SELECT stock FROM yy_textile WHERE number='" + number + "'";SqlConnection conn = new SqlConnection(str_conn);SqlCommand cmd = new SqlCommand(sql, conn);conn.Open();string account = cmd.ExecuteScalar().ToString();//MessageBox.Show(account);//int a = int.Parse(account);SqlConnection conn2 = new SqlConnection(str_conn);conn2 = new SqlConnection(str_conn);mDataAdapter = new SqlDataAdapter("SELECT name AS '面料名稱',number AS '面料編號',warp_density AS '經密度' ,weft_density AS '緯密度',warp_linear_density AS '經紗線密度',weft_linear_density AS '緯紗線密度',material AS '原料成分',square_meter_weight AS '平方米重量',width_of_cloth AS '幅寬',horse_length AS '匹長',organization AS '所用組織',stock AS '庫存量' FROM yy_textile  where number='" + number + "'", conn);dsall = new DataSet();mDataAdapter.Fill(dsall, "fiber");dataGridView1.DataSource = dsall.Tables["fiber"];SqlConnection conn1 = new SqlConnection(str_conn);conn1.Open();SqlCommand cmd1 = new SqlCommand();cmd1.Connection = conn1;cmd1.CommandText = "select * from yy_textile where number='" + number + "'";SqlDataReader sdr = cmd1.ExecuteReader();sdr.Read();object o = sdr["picture"];MyData = (byte[])sdr["picture"];//讀取第一個圖片的位流MemoryStream memoryStream = null;memoryStream = new MemoryStream(MyData);pictureBox1.Image = Image.FromStream(memoryStream);//將圖片賦給pictureBox1控件MessageBox.Show("讀取成功");}}catch{MessageBox.Show("讀取失敗 over");}}private void button3_Click(object sender, EventArgs e){string number = textBox1.Text;string sql = "delete from yy_textile WHERE number='" + number + "'";SqlConnection conn = new SqlConnection(str_conn);SqlCommand cmd = new SqlCommand(sql, conn);conn.Open();int count = cmd.ExecuteNonQuery();//MessageBox.Show(count.ToString());if (count != 0){MessageBox.Show("下架成功");textBox1.Text="";}else {MessageBox.Show("下架失敗");}}private void button4_Click(object sender, EventArgs e){new user_mainpage().Show();this.Close();}}
}

四、運行效果

檢索功能
在這里插入圖片描述
根據紡織面料品號查詢詳細信息
在這里插入圖片描述
下架
在這里插入圖片描述
重新檢索
在這里插入圖片描述
1014品號紡織面料已被下架
在這里插入圖片描述

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/377661.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/377661.shtml
英文地址,請注明出處:http://en.pswp.cn/news/377661.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

svg和canvas的應用場景分析【轉載】

原文地址:http://blogs.msdn.com/b/weizhong/archive/2011/07/16/canvas-svg.aspx 思考什么時候使用Canvas 和SVG wzhong 15 Jul 2011 9:07 PM 0HTML5 Canvas 和 SVG 是 IE9 中引入的兩項令人激動的圖形功能。上周在拉斯維加斯舉辦的 MIX11 大會對這兩個功能進行了介…

【C++grammar】文件系統以及path類使用

目錄1.文件系統概述1、關于路徑2、如何將某個路徑下的所有文件遞歸地找出來?2.路徑類及操作1、path類的成員函數2、path類的非成員函數示例1:展示C17中的path對象的用法示例2:展示Path類中用于分解路徑成分的函數示例3:展示path相…

scala hashmap_如何在Scala中將Hashmap轉換為Map?

scala hashmapLets first understand what are maps and hashmaps? 首先讓我們了解什么是map和hashmap ? map in Scala is a collection that stores its elements as key-value pairs, like a dictionary. Scala中的map是一個集合,將其元素存儲為鍵值…

十二、所有功能實現效果演示

一、系統項目架構 Ⅰ,fiber_yy數據庫下有五張表 yy_admin:管理員登錄賬號和密碼 yy_textile:紡織面料數據信息 yy_textile_record:用戶購買紡織面料信息所存儲的面料流水信息 yy_user:用戶登錄注冊信息 yy_user_reco…

行業軟件之PTV微觀軟件VISSIM4.3 5.0 5.1 5.2 5.3 5.4下載和相關資料

他是干什么的:http://baike.baidu.com/view/3656765.htm 中國代理銷售的公司的網址:辟途威交通科技(上海)有限公司 官網:http://www.ptvchina.cn/ 看看視頻中軟件的運行效果:http://v.youku.com/v_show/id_XMzExMjg1MDEy.html 如何…

一、單個神經元網絡構建

一、本人使用編譯器為Jupyter Notebook,tensorflow版本為1.13.1 import tensorflow as tf print(tf.__version__) """ 1.13.1 """二、訓練單個神經元網絡 x為-1.0, 0.0, 1.0, 2.0, 3.0, 4.0 y為-3.0, -1.0, 1.0, 3.0, 5.0, 7.0 人用…

ruby 生成隨機字符串_Ruby程序生成隨機數

ruby 生成隨機字符串產生隨機數 (Generating random number) The task is to generate and print random number. 任務是生成并打印隨機數。 Generating random numbers means that any number can be provided to you which is not dependent on any pre-specified condition…

leetcode 322. 零錢兌換 思考分析

目錄1、題目2、思路分析3、參考鏈接1、題目 給定不同面額的硬幣 coins 和一個總金額 amount。編寫一個函數來計算可以湊成總金額所需的最少的硬幣個數。如果沒有任何一種硬幣組合能組成總金額,返回 -1。 你可以認為每種硬幣的數量是無限的。 提示: 1 …

linux上的英文字體monospace可以在windows用嗎?

linux的字體都是開源的,應該可以官方下載本地下載轉載于:https://www.cnblogs.com/52linux/archive/2012/03/14/2396103.html

Flash Builder 創建CSS

1.global 選擇器將樣式應用于所有控件 在 Flash Builder 中創建新MXML 文件并切換到設計模式 屬性視圖右側的外觀視圖可更改外觀 Flash Builder 自動創建CSS 文件 CSS 文件有2 個命名空間: s 指 Spark 組件 mx 指 MX 組件 1. Global 與Application 選擇器 global …

ruby打印_Ruby程序打印數字的力量

ruby打印Ruby中數字的冪 (Power of a number in Ruby) The task to develop a program that prints power of a number in Ruby programming language. 開發可以用Ruby編程語言打印數字冪的程序的任務。 If we want to calculate the power of a number manually then we have…

二、訓練fashion_mnist數據集

一、加載fashion_mnist數據集 fashion_mnist數據集中數據為28*28大小的10分類衣物數據集 其中訓練集60000張,測試集10000張 from tensorflow import keras import tensorflow as tf import matplotlib.pyplot as plt import numpy as npfashion_mnist keras.data…

jquerymobile 切換頁面時候閃爍問題

https://github.com/jquery/jquery-mobile/commit/acbec71e29b6acec6cd2087e84e8434fecc0053f 可以修改css好像是個bug -4,9 4,10 * Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses.*/.spin {--webkit-animation-name: spin;--webkit-an…

二分法:兩個有序數組長度為N,找到第N、N+1大的數

題目 兩個有序數組長度為N,找到第N、N1大的數 思路1:雙指針,O(N)復雜度 簡述思路: 如果當前A指針指向的數組A的內容小于B指針指向的數組B的內容,那么A指針往右移動,然后nums(當前已經遍歷過的數字個數)也…

Javascript -- In

http://www.caveofprogramming.com/articles/javascript-2/javascript-in-using-the-in-operator-to-iterate-through-arrays-and-objects/ http://msdn.microsoft.com/en-us/library/ie/9k25hbz2(vvs.94).aspx轉載于:https://www.cnblogs.com/daishuguang/p/3392310.html

三、自動終止訓練

有時候,當模型損失函數值預期的效果時,就可以結束訓練了,一方面節約時間,另一方面防止過擬合 此時,設置損失函數值小于0.4,訓練停止 from tensorflow import keras import tensorflow as tf import matplo…

矩陣形狀| 使用Python的線性代數

Prerequisite: Linear Algebra | Defining a Matrix 先決條件: 線性代數| 定義矩陣 In the python code, we will add two Matrices. We can add two Matrices only and only if both the matrices have the same dimensions. Therefore, knowing the dimensions o…

[數據庫]oracle客戶端連服務器錯誤

昨天晚上和今天上午用11g客戶端連同事10g服務器,報錯: The Network Adapter could not establish the connection 檢查嘗試了好多次都沒好。 用程序連,依舊是報這個錯,所以一查就解決了! 參考:http://apps…

ASP.NET 抓取網頁內容

(轉)ASP.NET 抓取網頁內容 ASP.NET 抓取網頁內容-文字 ASP.NET 中抓取網頁內容是非常方便的,而其中更是解決了 ASP 中困擾我們的編碼問題。 需要三個類:WebRequest、WebResponse、StreamReader。 WebRequest、WebRespo…

leetcode 53. 最大子序和 動態規劃解法、貪心法以及二分法

題目 給定一個整數數組 nums ,找到一個具有最大和的連續子數組(子數組最少包含一個元素),返回其最大和。 示例: 輸入: [-2,1,-3,4,-1,2,1,-5,4] 輸出: 6 解釋: 連續子數組 [4,-1,2,1] 的和最大,為 6。 進階: 如果你…