3 Star 9 Fork 3

jiangfan/药库工作站管理系统

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
库存预警 2.31 KB
Copy Edit Raw Blame History
jiangfan authored 2019-01-13 12:48 . 库存预警
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace 药品工作站
{
public partial class 库存报警 : Form
{
public 库存报警()
{
InitializeComponent();
this.StartPosition = FormStartPosition.CenterScreen;
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
BindData();
}
public void BindData()
{
SqlConnection sqlConnection = new SqlConnection();
sqlConnection.ConnectionString =
"Server=(local);Database=药品工作站管理系统;Integrated Security=sspi";
SqlCommand sqlCommand = sqlConnection.CreateCommand();
sqlCommand.CommandText = "SELECT * FROM 药品信息;";
SqlDataAdapter sqlDataAdapter = new SqlDataAdapter();
sqlDataAdapter.SelectCommand = sqlCommand;
sqlDataAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
DataTable Table1 = new DataTable();
sqlConnection.Open();
sqlDataAdapter.Fill(Table1);
sqlConnection.Close();
dgv.DataSource = Table1;
}
private void 库存报警_Load(object sender, EventArgs e)
{
BindData();
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
private void dgv_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
{
try
{
decimal num = Convert.ToDecimal(this.dgv.Rows[e.RowIndex].Cells[9].Value.ToString());
decimal yj = Convert.ToDecimal(txtYJ.Text.Trim());
if (num < yj)
{
this.dgv.Rows[e.RowIndex].Cells[9].Style.ForeColor = Color.Red;
}
}
catch
{
}
}
private void label6_Click(object sender, EventArgs e)
{
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/jiangfan123/ypkcxt.git
git@gitee.com:jiangfan123/ypkcxt.git
jiangfan123
ypkcxt
药库工作站管理系统
master

Search