四、入庫管理功能的完善

一、數據庫的創建

在fiber_yy數據庫下創建yy_textile表在這里插入圖片描述
在這里插入圖片描述
先隨便添加幾條數據
在這里插入圖片描述

二、頁面的完善

登錄注冊頁面我就不演示了,前幾篇博文也都有介紹

warehousing入庫頁面
在這里插入圖片描述
main_page頁面進行功能完善
在這里插入圖片描述

三、代碼實現

warehousing頁面

using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.Sql;
using System.Data.SqlClient;
namespace fiber_yy
{public partial class warehousing : Form{public string constr = "server=CY-20190824RMES;Initial Catalog=fiber_yy;User ID=sa;pwd=beyond";public warehousing(){InitializeComponent();}private void button2_Click(object sender, EventArgs e){OpenFileDialog ofdlgTest = new OpenFileDialog();//ofdlgTest.Filter = "*.jpg|*.png";   //文件過濾 篩選可以打開的文件ofdlgTest.Filter = "";ofdlgTest.Multiselect = false;    //設置不可以選擇多個文件//顯示文件打開對話框DialogResult result = ofdlgTest.ShowDialog();//選擇打開按鈕的時候,將文件名顯示到文本框中if (result == DialogResult.OK)                   //判斷是否打開文件{this.textBox11.Text = ofdlgTest.FileName;pictureBox1.Image = Image.FromFile(ofdlgTest.FileName);}}private void button1_Click(object sender, EventArgs e){try{string path = textBox11.Text;FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read); //將指定路徑的圖片添加到FileStream類中BinaryReader br = new BinaryReader(fs);//通過FileStream對象實例化BinaryReader對象byte[] imgBytesIn = br.ReadBytes(Convert.ToInt32(fs.Length));//將圖片轉為二進制數據//Save(imgBytesIn);//調用(自己寫的一個方法)SqlConnection conn = new SqlConnection(constr);conn.Open();string name = textBox1.Text;int number = int.Parse(textBox2.Text);float warp_density = float.Parse(textBox3.Text);float weft_density = float.Parse(textBox4.Text);float warp_linear_density = float.Parse(textBox5.Text);float weft_linear_density = float.Parse(textBox6.Text);string material = textBox7.Text;float square_meter_weight = float.Parse(textBox8.Text);float width_of_cloth = float.Parse(textBox9.Text);float horse_length = float.Parse(textBox10.Text);string organization = textBox12.Text;int stock = int.Parse(textBox13.Text);SqlCommand cmd = new SqlCommand("insert into yy_textile (name,number,warp_density,weft_density,warp_linear_density,weft_linear_density,material,square_meter_weight,width_of_cloth,horse_length,picture,organization,stock) " +"values(@name,@number,@warp_density,@weft_density,@warp_linear_density,@weft_linear_density,@material,@square_meter_weight,@width_of_cloth,@horse_length,@picture,@organization,@stock);", conn); //SQL語句cmd.Parameters.Add("@name", SqlDbType.VarChar);cmd.Parameters["@name"].Value = name;cmd.Parameters.Add("@number", SqlDbType.Int);cmd.Parameters["@number"].Value = number;cmd.Parameters.Add("@warp_density", SqlDbType.Float);cmd.Parameters["@warp_density"].Value = warp_density;cmd.Parameters.Add("@weft_density", SqlDbType.Float);cmd.Parameters["@weft_density"].Value = weft_density;cmd.Parameters.Add("@warp_linear_density", SqlDbType.Float);cmd.Parameters["@warp_linear_density"].Value = warp_linear_density;cmd.Parameters.Add("@weft_linear_density", SqlDbType.Float);cmd.Parameters["@weft_linear_density"].Value = weft_linear_density;cmd.Parameters.Add("@material", SqlDbType.VarChar);cmd.Parameters["@material"].Value = material;cmd.Parameters.Add("@square_meter_weight", SqlDbType.Float);cmd.Parameters["@square_meter_weight"].Value = square_meter_weight;cmd.Parameters.Add("@width_of_cloth", SqlDbType.Float);cmd.Parameters["@width_of_cloth"].Value = width_of_cloth;cmd.Parameters.Add("@horse_length", SqlDbType.Float);cmd.Parameters["@horse_length"].Value = horse_length;cmd.Parameters.Add("@picture", SqlDbType.Image);cmd.Parameters["@picture"].Value = imgBytesIn;cmd.Parameters.Add("@organization", SqlDbType.VarChar);cmd.Parameters["@organization"].Value = organization;cmd.Parameters.Add("@stock", SqlDbType.Int);cmd.Parameters["@stock"].Value = stock;cmd.ExecuteNonQuery();conn.Close();MessageBox.Show("圖片上傳成功");}catch {MessageBox.Show("請核對輸入信息");}}private void button3_Click(object sender, EventArgs e){new main_page().Show();this.Hide();}}
}

main_page頁面

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;namespace fiber_yy
{public partial class main_page : Form{public main_page(){InitializeComponent();}private void button1_Click(object sender, EventArgs e){MessageBox.Show("退出成功");this.Close();new Form1().Show();}private void button2_Click(object sender, EventArgs e){this.Close();new warehousing().Show();}private void button3_Click(object sender, EventArgs e){this.Close();new shipment().Show();}private void button4_Click(object sender, EventArgs e){this.Close();new query().Show();}}
}

四、效果演示

程序運行
在這里插入圖片描述
注冊我就不演示了,請參考前幾篇博文
yy_user表中找個賬號密碼,直接用戶登錄
在這里插入圖片描述
在這里插入圖片描述
登錄成功
在這里插入圖片描述
進入系統
在這里插入圖片描述

首先演示下入庫管理功能
在這里插入圖片描述
在這里插入圖片描述

在這里插入圖片描述
入庫
在這里插入圖片描述
在這里插入圖片描述

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

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

相關文章

leetcode 232. 用棧實現隊列 思考分析

題目 請你僅使用兩個棧實現先入先出隊列。隊列應當支持一般隊列的支持的所有操作(push、pop、peek、empty): 實現 MyQueue 類: void push(int x) 將元素 x 推到隊列的末尾 int pop() 從隊列的開頭移除并返回元素 int peek() 返…

YCSB初步介紹

隨著大數據時代的到來和云計算的不斷發展,作為云計算最基礎的設施存儲產品也越來越多,開源分布式存儲系統有BigTable-like系統HBase,dynamo-like系統Cassandra,voldemort,Riak,淘寶開源的OceanBase等。當然…

kotlin實現繼承_Kotlin程序| 繼承的例子

kotlin實現繼承遺產 (Inheritance) Inheritance is a mechanism wherein a new class is derived from an existing class. 繼承是一種機制,其中新類是從現有類派生的。 All Kotlin Classes have a common Superclass Any, it is the Default Superclass with no S…

【C++grammar】動態類型轉換、typeid與RTTI

目錄動態類型轉換1、為何需要動態類型轉換2、dynamic_cast<>();運算符3、向上轉換和向下轉換( Upcasting and Downcasting)4、 基類對象和派生類對象的互操作5、Upcasting/Downcasting與繼承鏈上不同類的對象之間的賦值有什么關系和區別&#xff1f;typeid 運行時查詢類型…

nginx資源定向 css js路徑問題

今天玩玩項目&#xff0c;學學nginx發現還不錯&#xff0c;速度還可以&#xff0c;但是CSS JS確無法使用&#xff0c;原來Iginx配置時需要對不同類型的文件配置規則&#xff0c;真是很郁悶&#xff0c;不過想想也還是很有道理。閑暇之際&#xff0c;把配置貼上來。#user nobody…

五、庫存查詢功能的完善

一、數據庫的建立 由于查詢功能和之前的 入庫管理功能 所用的數據庫都一樣&#xff0c;這里仍使用yy_textile表 在fiber_yy數據庫下創建yy_textile表 初始數據庫信息 二、頁面的完善 登錄注冊頁面我就不演示了&#xff0c;前幾篇博文也都有介紹 query查詢頁面 main_page…

整合ajaxmin 和 less 到VS.net

我用的前端框架是bootstrap_extra, twitter團隊做的&#xff0c;這個是他的一個擴展&#xff0c;首先從上面下載一個。至于ajaxmin&#xff0c;請參考這里1) 從bootstrap_extra的解壓包中&#xff0c;復制build目錄下三個文件到項目中去&#xff0c;這三個文件分別是BatchSubsi…

轉:只能選擇GridView中的一個CheckBox(單選CheckBox)

方法1&#xff1a; protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e){CheckBox cbx e.Row.FindControl("cbID") as CheckBox;try{//綁定選中CheckBox 客戶端IDcbx.Attributes.Add("onclick", "Change(" cbx.Cli…

六、出庫管理功能的實現

一、數據庫的建立 這里仍使用yy_textile表 在fiber_yy數據庫下創建yy_textile表 初始數據庫信息 二、頁面的完善 登錄注冊頁面我就不演示了&#xff0c;前幾篇博文也都有介紹 shipment出庫管理頁面 main_page頁面進行功能完善 三、代碼實現 shipment出庫管理頁面 u…

數學建模:層次分析法實例以及代碼

博主聯系方式&#xff1a; QQ:1540984562 QQ交流群&#xff1a;892023501 群里會有往屆的smarters和電賽選手&#xff0c;群里也會不時分享一些有用的資料&#xff0c;有問題可以在群里多問問。 目錄層次分析法的思想層次分析法步驟具體案例(市政工程項目建設決策)1.問題提出2.…

c 僵尸進程_演示僵尸進程的C程序

c 僵尸進程僵尸進程 (Zombie process) A process which has finished its execution but still has an entry in the process table to report to its parent process is known as a zombie process. 一個已經完成執行但仍在進程表中具有要報告給其父進程的條目的進程稱為僵尸進…

探秘IntelliJ IDEA 13測試版新功能——調試器顯示本地變量

IntelliJ IDEA在業界被公認為最好的Java開發平臺之一&#xff0c;JetBrains公司將在12月正式發布IntelliJ IDEA 13版本。 現在&#xff0c;小編將和大家一起探秘密IntelliJ IDEA 13測試版本新功能——調試器顯示本地變量。這個功能非常強大&#xff0c;調試器可以顯示變量&…

C# Windows Form下的控件的Validator(數據驗證)

由于偶爾的一個想法&#xff0c;謀生了一個做一個windows form下的Validator控件&#xff0c;或者直接說類吧&#xff01; 因為webform下的Validator控件太好用了。哈哈&#xff0c;直接看代碼&#xff01; 下面這個類&#xff0c;主要是一個簡單的驗證類&#xff0c;不過只是起…

七、流水查詢---記錄用戶登錄信息

一、數據庫的建立 在fiber_yy數據庫下創建yy_user_record表 可以先手動填入幾條數據信息 初始數據庫信息 username為用戶賬號 sex為用戶注冊所填寫的性別 phone為用戶手機號 time為用戶登錄該系統的時間 二、頁面的設計 登錄注冊頁面我就不演示了&#xff0c;前幾篇博文…

leetcode 455. 分發餅干 思考分析

目錄題目自己的思路以及AC代碼參考思路題目 假設你是一位很棒的家長&#xff0c;想要給你的孩子們一些小餅干。但是&#xff0c;每個孩子最多只能給一塊餅干。 對每個孩子 i&#xff0c;都有一個胃口值 g[i]&#xff0c;這是能讓孩子們滿足胃口的餅干的最小尺寸&#xff1b;并…

c++ cdi+示例_C ++'not'關鍵字和示例

c cdi示例"not" is an inbuilt keyword that has been around since at least C98. It is an alternative to ! (Logical NOT) operator and it mostly uses with the conditions. “ not”是一個內置關鍵字&#xff0c;至少從C 98起就存在。 它是替代&#xff01; …

【second】Flatten Binary Tree to Linked List

遞歸 void flatten(TreeNode *root) {// Note: The Solution object is instantiated only once and is reused by each test case.flat(root);}TreeNode* flat(TreeNode* root){if(!root)return NULL;TreeNode* left_tail flat(root->left);TreeNode* right_tail flat(ro…

八、流水查詢---記錄紡織品出庫信息

一、數據庫的建立 在fiber_yy數據庫下創建yy_textile_record表 可以先手動填入幾條數據信息 初始數據庫信息 第一條數據的username是空格不是null number為織物的品號(唯一的) stock為出貨量 username為哪個賬號 time為出貨時間 二、頁面的完善 登錄注冊頁面我就不演示…

應用程序欄【WP7學習札記之九】

本節是WP7學習札記的第九篇&#xff0c;講的是系統托盤和應用程序欄&#xff0c;具體內容是系統托盤和應用程序欄的介紹&#xff0c;如何分別使用C#、xaml以及Expression Blend生成應用程序欄&#xff0c;應用程序欄的透明度以及對屏幕方向改變的支持。摘要如下&#xff1a; 系…

橢圓曲線密碼學導論pdf_橢圓曲線密碼學

橢圓曲線密碼學導論pdf歷史 (History) The use of elliptic curves in cryptography was advised independently by Neal Koblitz and Victor S. Miller in 1985. Elliptic curve cryptography algorithms entered large use from 2004 to 2005. 1985年&#xff0c; Neal Kobli…