📄 goodsout.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
namespace FORU_SMS_.BaseClass
{
public class GoodsOut
{
DataConn Dconn = new DataConn();
DataClass Dclass = new DataClass();
public string _GoodsID;
public string _GoodsName;
public string _SupName;
public string _SpecName;
public string _UnitName;
public int _GoodsNum;
public double _GoodsPrice;
public double _GoodsAPrice;
public string _UpGoodsPeople;
public string _GoodsPeople;
public string _GoodsDep;
public string _GoodsRemarks;
public string GoodsID
{
set { _GoodsID = value; }
get { return _GoodsID; }
}
public string GoodsName
{
set { _GoodsName = value; }
get { return _GoodsName; }
}
public string SupName
{
set { _SupName = value; }
get { return _SupName; }
}
public string SpecName
{
set { _SpecName = value; }
get { return _SpecName; }
}
public string UnitName
{
set { _UnitName = value; }
get { return _UnitName; }
}
public int GoodsNum
{
set { _GoodsNum = value; }
get { return _GoodsNum; }
}
public double GoodsPrice
{
set { _GoodsPrice = value; }
get { return _GoodsPrice; }
}
public double GoodsAPrice
{
set { _GoodsAPrice = value; }
get { return _GoodsAPrice; }
}
public string UpGoodsPeople
{
set { _UpGoodsPeople = value; }
get { return _UpGoodsPeople; }
}
public string GoodsPeople
{
set { _GoodsPeople = value; }
get { return _GoodsPeople; }
}
public string GoodsDep
{
set { _GoodsDep = value; }
get { return _GoodsDep; }
}
public string GoodsRemarks
{
set { _GoodsRemarks = value; }
get { return _GoodsRemarks; }
}
public void OutGoods()
{
string sql = "";
sql = sql + "insert into SMS_GoodsOut(GoodsID,GoodsName,SupName,SpecName,UnitName,GoodsNum,GoodsPrice,GoodsAPrice,UpGoodsPeople,GoodsPeople,GoodsDep,GoodsRemarks) values "
+ "(@GoodsID,@GoodsName,@SupName,@SpecName,@UnitName,@GoodsNum,@GoodsPrice,@GoodsAPrice,@UpGoodsPeople,@GoodsPeople,@GoodsDep,@GoodsRemarks)";
sql = sql + ";";
//sql = sql + "delete from SMS_Goods where GoodsID='" + this.GoodsID + "'";
sql = sql + "update SMS_Goods set GoodsNum=GoodsNum-@GoodsNum where GoodsID=@GoodsID";
SqlCommand sqlcom = new SqlCommand(sql, Dconn.OpenConn());
SqlDataAdapter dapter = new SqlDataAdapter();
dapter.SelectCommand = sqlcom;
sqlcom.Parameters.Add("@GoodsID", SqlDbType.VarChar, 20, "GoodsID").Value = this.GoodsID;
sqlcom.Parameters.Add("@GoodsName", SqlDbType.VarChar, 50, "GoodsName").Value = this.GoodsName;
sqlcom.Parameters.Add("@SupName", SqlDbType.VarChar, 50, "SupName").Value = this.SupName;
sqlcom.Parameters.Add("@SpecName", SqlDbType.VarChar, 50, "SpecName").Value = this.SpecName;
sqlcom.Parameters.Add("@UnitName", SqlDbType.VarChar, 10, "UnitName").Value = this.UnitName;
sqlcom.Parameters.Add("@GoodsNum", SqlDbType.Int, 4, "GoodsNum").Value = this.GoodsNum;
sqlcom.Parameters.Add("@GoodsPrice", SqlDbType.Float, 8, "GoodsPrice").Value = this.GoodsPrice;
sqlcom.Parameters.Add("@GoodsAPrice", SqlDbType.Float, 8, "GoodsAPrice").Value = this.GoodsAPrice;
sqlcom.Parameters.Add("@UpGoodsPeople", SqlDbType.VarChar, 20, "UpGoodsPeople").Value = this.UpGoodsPeople;
sqlcom.Parameters.Add("@GoodsPeople", SqlDbType.VarChar, 20, "GoodsPeople").Value = this.GoodsPeople;
sqlcom.Parameters.Add("@GoodsDep", SqlDbType.VarChar, 20, "GoodsDep").Value = this.GoodsDep;
sqlcom.Parameters.Add("@GoodsRemarks", SqlDbType.VarChar, 1000, "GoodsRemarks").Value = this.GoodsRemarks;
try
{
sqlcom.ExecuteNonQuery();
}
catch (Exception) { }
finally
{
Dconn.CloseConn();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -