📄 order.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
/// <summary>
/// order 的摘要说明
/// </summary>
public class order
{
public int supplycheck(string strname)
{//检查供应商是否存在,如果存在的话有所提示
SqlConnection conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.AppSettings["ConnectionString"];
conn.Open();
SqlCommand cmd = new SqlCommand("supplycheck", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
SqlParameter para = new SqlParameter("@supply_Name", SqlDbType.NVarChar, 50);
para.Value = strname;
cmd.Parameters.Add(para);
cmd.ExecuteNonQuery();
int iReturn = Convert.ToInt16(cmd.Parameters[0].Value);
conn.Close();
conn.Dispose();
return iReturn;
conn.Close();
conn.Dispose();
}
public void insertsupply(string strsupply,string strname,string strphnum,string strgdnum,string strfax)
{//添加供应商
SqlConnection conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.AppSettings["ConnectionString"];
conn.Open();
SqlCommand cmd = new SqlCommand("supplyinsert", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parasupply = new SqlParameter("@supply_Name", SqlDbType.NVarChar, 50);
parasupply.Value = strsupply;
cmd.Parameters.Add(parasupply);
SqlParameter paraname = new SqlParameter("@supply_Lxr", SqlDbType.NVarChar, 50);
paraname.Value = strname;
cmd.Parameters.Add(paraname);
SqlParameter paraphnum = new SqlParameter("@supply_Pho", SqlDbType.NVarChar, 50);
paraphnum.Value = strphnum;
cmd.Parameters.Add(paraphnum);
SqlParameter paragdnum = new SqlParameter("supply_Tel", SqlDbType.NVarChar, 50);
paragdnum.Value = strgdnum;
cmd.Parameters.Add(paragdnum);
SqlParameter parafax = new SqlParameter("supply_fax", SqlDbType.NVarChar, 50);
parafax.Value = strfax;
cmd.Parameters.Add(parafax);
try
{
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{ }
conn.Close();
conn.Dispose();
}
public DataSet selectsupply()
{//供应商绑定
SqlConnection conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.AppSettings["ConnectionString"];
SqlCommand cmd = new SqlCommand("supplyselect", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter adpt = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
adpt.Fill(ds, "supply");
return ds;
}
public void updatesupply(string name,string strLxr,string strphone,string strggnum,string strfax)
{
SqlConnection conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.AppSettings["ConnectionString"];
conn.Open();
SqlCommand cmd = new SqlCommand("supplyupdate", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter paraid = new SqlParameter("@supply_Name", SqlDbType.NVarChar, 50);
paraid.Value = name;
cmd.Parameters.Add(paraid);
SqlParameter paraLxr = new SqlParameter("@supply_Lxr", SqlDbType.NVarChar, 50);
paraLxr.Value = strLxr;
cmd.Parameters.Add(paraLxr);
SqlParameter paraphone = new SqlParameter("@supply_Pho", SqlDbType.NVarChar, 50);
paraphone.Value = strphone;
cmd.Parameters.Add(paraphone);
SqlParameter paratel= new SqlParameter("@supply_Tel", SqlDbType.NVarChar, 50);
paratel.Value = strggnum;
cmd.Parameters.Add(paratel);
SqlParameter parafax = new SqlParameter("@supply_fax", SqlDbType.NVarChar, 50);
parafax.Value = strfax;
cmd.Parameters.Add(parafax);
cmd.ExecuteNonQuery();
conn.Close();
conn.Dispose();
}
public int leibiecheck(string strname)
{//检查类别是否存在,如果存在的话有所提示
SqlConnection conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.AppSettings["ConnectionString"];
conn.Open();
SqlCommand cmd = new SqlCommand("leibiecheck", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
SqlParameter para = new SqlParameter("@leibie_name", SqlDbType.NVarChar, 50);
para.Value = strname;
cmd.Parameters.Add(para);
cmd.ExecuteNonQuery();
int iReturn = Convert.ToInt16(cmd.Parameters[0].Value);
conn.Close();
conn.Dispose();
return iReturn;
conn.Close();
conn.Dispose();
}
public void leibieadd(string strname)
{//添加类别
SqlConnection conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.AppSettings["ConnectionString"];
conn.Open();
SqlCommand cmd = new SqlCommand("leibieadd", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter paraname = new SqlParameter("@leibie_name", SqlDbType.NVarChar, 50);
paraname.Value = strname;
cmd.Parameters.Add(paraname);
cmd.ExecuteNonQuery();
conn.Close();
conn.Dispose();
}
public DataSet leibieBind()
{
//绑定类别
SqlConnection conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.AppSettings["ConnectionString"];
SqlCommand cmd = new SqlCommand("leibiebind", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter adpt = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
adpt.Fill(ds, "leibie");
return ds;
}
public void leibiedelete(string strname)
{//删除类别
SqlConnection conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.AppSettings["ConnectionString"];
conn.Open();
SqlCommand cmd = new SqlCommand("leibiedelete", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter paraname = new SqlParameter("@leibie_name", SqlDbType.NVarChar, 50);
paraname.Value = strname;
cmd.Parameters.Add(paraname);
cmd.ExecuteNonQuery();
conn.Close();
conn.Dispose();
}
public int pinmincheck(string strname)
{//检查品名是否存在,如果存在的话有所提示
SqlConnection conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.AppSettings["ConnectionString"];
conn.Open();
SqlCommand cmd = new SqlCommand("pinmincheck", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
SqlParameter para = new SqlParameter("@order_PM", SqlDbType.NVarChar, 50);
para.Value = strname;
cmd.Parameters.Add(para);
cmd.ExecuteNonQuery();
int iReturn = Convert.ToInt16(cmd.Parameters[0].Value);
conn.Close();
conn.Dispose();
return iReturn;
conn.Close();
conn.Dispose();
}
public void addpinmin(string strname, string strsupply, string strGG, string strleibie, string strnature, string strprice,string strsuoxie, string strpath)
{//添加品名
SqlConnection conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.AppSettings["ConnectionString"];
conn.Open();
SqlCommand cmd = new SqlCommand("addpinmin", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter paraname = new SqlParameter("@order_PM", SqlDbType.NVarChar, 50);
paraname.Value = strname;
cmd.Parameters.Add(paraname);
SqlParameter parasupply = new SqlParameter("order_Supply", SqlDbType.NVarChar, 50);
parasupply.Value = strsupply;
cmd.Parameters.Add(parasupply);
SqlParameter paraGG = new SqlParameter("@order_GG", SqlDbType.NVarChar, 50);
paraGG.Value = strGG;
cmd.Parameters.Add(paraGG);
SqlParameter paraleibie = new SqlParameter("@order_Type", SqlDbType.NVarChar, 50);
paraleibie.Value = strleibie;
cmd.Parameters.Add(paraleibie);
SqlParameter paranature = new SqlParameter("@order_Nature", SqlDbType.NVarChar, 50);
paranature.Value = strnature;
cmd.Parameters.Add(paranature);
SqlParameter paraprice = new SqlParameter("@order_Price", SqlDbType.NVarChar, 50);
paraprice.Value = strprice;
cmd.Parameters.Add(paraprice);
SqlParameter parasuoxie = new SqlParameter("@order_Suoxie", SqlDbType.NVarChar, 50);
parasuoxie.Value = strsuoxie;
cmd.Parameters.Add(parasuoxie);
SqlParameter parapath = new SqlParameter("@order_Image", SqlDbType.NVarChar, 50);
parapath.Value = strpath;
cmd.Parameters.Add(parapath);
try
{
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
}
conn.Close();
conn.Dispose();
}
public DataSet selectpinmin(string strleibie,string strnature)
{
//获得指定类别的品名
SqlConnection conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.AppSettings["ConnectionString"];
SqlCommand cmd = new SqlCommand("selectpinmin", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter para = new SqlParameter("@order_Type", SqlDbType.NVarChar, 50);
para.Value = strleibie;
cmd.Parameters.Add(para);
SqlParameter paranature = new SqlParameter("@order_Nature", SqlDbType.NVarChar, 50);
paranature.Value = strnature;
cmd.Parameters.Add(paranature);
SqlDataAdapter adpt = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
adpt.Fill(ds, "orderthing");
return ds;
}
public string countleibie()
{//统计类别
SqlConnection conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.AppSettings["ConnectionString"];
conn.Open();
SqlCommand cmd = new SqlCommand("countleibie", conn);
cmd.CommandType = CommandType.StoredProcedure;
string count =cmd.ExecuteScalar().ToString();
conn.Close();
conn.Dispose();
return count;
}
public string countpinmin()
{//统计物品品项
SqlConnection conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.AppSettings["ConnectionString"];
conn.Open();
SqlCommand cmd = new SqlCommand("countpinmin", conn);
cmd.CommandType = CommandType.StoredProcedure;
string count =cmd.ExecuteScalar().ToString();
conn.Close();
conn.Dispose();
return count;
}
public void updateorderthing(string id,string strsupply,string strGG,string strtype,string strnature,string strprice,string strsuoxie)
{
//更新orderthing表中的数据
SqlConnection conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.AppSettings["ConnectionString"];
conn.Open();
SqlCommand cmd = new SqlCommand("updateorderthing", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter paraname = new SqlParameter("order_ID", SqlDbType.NVarChar, 50);
paraname.Value = id;
cmd.Parameters.Add(paraname);
SqlParameter parasupply = new SqlParameter("order_Supply", SqlDbType.NVarChar, 50);
parasupply.Value = strsupply;
cmd.Parameters.Add(parasupply);
SqlParameter paraGG = new SqlParameter("order_GG", SqlDbType.NVarChar, 50);
paraGG.Value = strGG;
cmd.Parameters.Add(paraGG);
SqlParameter paraType = new SqlParameter("order_Type", SqlDbType.NVarChar, 50);
paraType.Value = strtype;
cmd.Parameters.Add(paraType);
SqlParameter paranature = new SqlParameter("order_Nature", SqlDbType.NVarChar, 50);
paranature.Value = strnature;
cmd.Parameters.Add(paranature);
SqlParameter paraprice = new SqlParameter("order_Price", SqlDbType.NVarChar, 50);
paraprice.Value = strprice;
cmd.Parameters.Add(paraprice);
SqlParameter parasuoxie = new SqlParameter("order_Suoxie", SqlDbType.NVarChar, 50);
parasuoxie.Value = strsuoxie;
cmd.Parameters.Add(parasuoxie);
try
{
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
}
cmd.Dispose();
conn.Close();
conn.Dispose();
}
public void deletePM(string strpinmin)
{
SqlConnection conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.AppSettings["ConnectionString"];
conn.Open();
SqlCommand cmd = new SqlCommand("deletepinmin", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parapinmin = new SqlParameter("@order_PM", SqlDbType.NVarChar, 50);
parapinmin.Value = strpinmin;
cmd.Parameters.Add(parapinmin);
cmd.ExecuteNonQuery();
cmd.Dispose();
conn.Close();
conn.Dispose();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -