📄 storedal.cs
字号:
string commandtext = "OutStoreUp";
SqlParameter xstore_id = new SqlParameter("@Store_id", SqlDbType.Int);
SqlParameter xproduct_id = new SqlParameter("@product_id", SqlDbType.Char, 20);
SqlParameter xstore_color = new SqlParameter("@Store_color", SqlDbType.VarChar, 10);
SqlParameter xstore_size1 = new SqlParameter("@Store_size1", SqlDbType.Int);
SqlParameter xstore_size2 = new SqlParameter("@Store_size2", SqlDbType.Int);
SqlParameter xstore_size3 = new SqlParameter("@Store_size3", SqlDbType.Int);
SqlParameter xstore_size4 = new SqlParameter("@Store_size4", SqlDbType.Int);
SqlParameter xstore_size5 = new SqlParameter("@Store_size5", SqlDbType.Int);
SqlParameter xstore_size6 = new SqlParameter("@Store_size6", SqlDbType.Int);
SqlParameter xstore_size7 = new SqlParameter("@Store_size7", SqlDbType.Int);
SqlParameter xstore_sum = new SqlParameter("@Store_sum", SqlDbType.Int);
xstore_id.Value = storeid;
xproduct_id.Value = product_id.Trim();
xstore_color.Value = store_color.Trim();
xstore_size1.Value = store_size1;
xstore_size2.Value = store_size2;
xstore_size3.Value = store_size3;
xstore_size4.Value = store_size4;
xstore_size5.Value = store_size5;
xstore_size6.Value = store_size6;
xstore_size7.Value = store_size7;
xstore_sum.Value = store_sum;
return SqlHelper.ExecuteNonQuery(SqlHelper.conStr, CommandType.StoredProcedure, commandtext, new SqlParameter[] { xstore_id, xproduct_id, xstore_color, xstore_size1, xstore_size2, xstore_size3, xstore_size4, xstore_size5, xstore_size6, xstore_size7, xstore_sum });
}
#endregion
#region 各种单据入库(无则添加)
public int InsertStoreInto(int storeid, string product_id, string store_color, int store_size1, int store_size2, int store_size3, int store_size4, int store_size5, int store_size6, int store_size7, int store_sum)
{
string commandtext = "InsertStoreInto";
SqlParameter xstore_id = new SqlParameter("@Store_id", SqlDbType.Int);
SqlParameter xproduct_id = new SqlParameter("@product_id", SqlDbType.Char, 20);
SqlParameter xstore_color = new SqlParameter("@Store_color", SqlDbType.VarChar, 10);
SqlParameter xstore_size1 = new SqlParameter("@Store_size1", SqlDbType.Int);
SqlParameter xstore_size2 = new SqlParameter("@Store_size2", SqlDbType.Int);
SqlParameter xstore_size3 = new SqlParameter("@Store_size3", SqlDbType.Int);
SqlParameter xstore_size4 = new SqlParameter("@Store_size4", SqlDbType.Int);
SqlParameter xstore_size5 = new SqlParameter("@Store_size5", SqlDbType.Int);
SqlParameter xstore_size6 = new SqlParameter("@Store_size6", SqlDbType.Int);
SqlParameter xstore_size7 = new SqlParameter("@Store_size7", SqlDbType.Int);
SqlParameter xstore_sum = new SqlParameter("@Store_sum", SqlDbType.Int);
xstore_id.Value = storeid;
xproduct_id.Value = product_id.Trim();
xstore_color.Value = store_color.Trim();
xstore_size1.Value = store_size1;
xstore_size2.Value = store_size2;
xstore_size3.Value = store_size3;
xstore_size4.Value = store_size4;
xstore_size5.Value = store_size5;
xstore_size6.Value = store_size6;
xstore_size7.Value = store_size7;
xstore_sum.Value = store_sum;
return SqlHelper.ExecuteNonQuery(SqlHelper.conStr, CommandType.StoredProcedure, commandtext, new SqlParameter[] { xstore_id, xproduct_id, xstore_color, xstore_size1, xstore_size2, xstore_size3, xstore_size4, xstore_size5, xstore_size6, xstore_size7, xstore_sum });
}
#endregion
#region 查询该仓库有无该商品(商品名称)
public int InsertStoreCheck(string product_id, int store_id, string store_color)
{
string commandtext = "InsertStoreCheck";
SqlParameter xproduct_id = new SqlParameter("@product_id",SqlDbType.Char,20);
SqlParameter xstore_id = new SqlParameter("@Store_id",SqlDbType.Int);
SqlParameter xstore_color = new SqlParameter("@Store_color", SqlDbType.VarChar,10);
xproduct_id.Value = product_id;
xstore_id.Value = store_id;
xstore_color.Value = store_color;
SqlDataReader dr = SqlHelper.ExecuteReader(SqlHelper.conStr, CommandType.StoredProcedure, commandtext, new SqlParameter[] { xproduct_id, xstore_id, xstore_color });
if (dr.Read())
{
dr.Close();
return 1;
}
else
{
dr.Close();
return 0;
}
}
#endregion
#region 通过商品在库存中的编号,颜色以及库存编号查找尺码是否大于所填写的数据
/// <summary>
/// 通过商品在库存中的编号,颜色以及库存编号查找尺码是否大于所填写的数据
/// </summary>
/// <param name="stock_id">库存ID(店铺)</param>
/// <param name="product_id">商品编号</param>
/// <param name="store_color">商品颜色</param>
/// <returns></returns>
public Model.Store.StoreModel SelectStoreByProduct(int stock_id,string product_id,string store_color)
{
string commandtext = "StoreByProduct_Select";
SqlParameter id = new SqlParameter("@Store_id", SqlDbType.Int);
SqlParameter pid = new SqlParameter("@product_id",SqlDbType.VarChar ,10);
SqlParameter color = new SqlParameter("@Store_color",SqlDbType.VarChar ,10);
id.Value = stock_id;
pid.Value = product_id;
color.Value = store_color;
DataSet ds = new DataSet();
SqlHelper.FillDataSet(SqlHelper.conStr, CommandType.StoredProcedure, commandtext, ds, new string[] { }, new SqlParameter[] { id,pid,color });
Model.Store.StoreModel inf = new Model.Store.StoreModel();
foreach (DataRow dr in ds.Tables[0].Rows)
{
inf.store_size1 = (int)dr["Store_size1"];
inf.store_size2 = (int)dr["Store_size2"];
inf.store_size3 = (int)dr["Store_size3"];
inf.store_size4 = (int)dr["Store_size4"];
inf.store_size5 = (int)dr["Store_size5"];
inf.store_size6 = (int)dr["Store_size6"];
inf.store_size7 = (int)dr["Store_size7"];
}
return inf;
}
#endregion
#region 查询仓库所有信息
/// <summary>
/// 查询仓库所有信息
/// </summary>
/// <returns></returns>
public List<Model.Store.StoreModel> SelectStoreAll()
{
string commandtext = "Store_Select";
DataSet ds = new DataSet();
SqlHelper.FillDataSet(SqlHelper.conStr, CommandType.StoredProcedure, commandtext, ds, new string[] { }, null);
List<Model.Store.StoreModel> li = new List<Model.Store.StoreModel>();
foreach (DataRow item in ds.Tables[0].Rows)
{
Model.Store.StoreModel inf = new Model.Store.StoreModel();
inf.store_id = (int)item["Store_id"];
inf.product_id = item["product_id"].ToString();
inf.store_color = item["Store_color"].ToString();
inf.store_size1 = (int)item["Store_size1"];
inf.store_size2 = (int)item["Store_size2"];
inf.store_size3 = (int)item["Store_size3"];
inf.store_size4 = (int)item["Store_size4"];
inf.store_size5 = (int)item["Store_size5"];
inf.store_size6 = (int)item["Store_size6"];
inf.store_size7 = (int)item["Store_size7"];
inf.store_sum = (int)item["Store_sum"];
li.Add(inf);
}
return li;
}
#endregion
#region 获取商品颜色
/// <summary>
/// 获取商品颜色
/// </summary>
/// <returns></returns>
public List<Model.Store.StoreModel> GetProductColor()
{
string commandtext = "GetProductColor";
DataSet ds = new DataSet();
SqlHelper.FillDataSet(SqlHelper.conStr, CommandType.StoredProcedure, commandtext, ds, new string[] { }, null);
List<Model.Store.StoreModel> li = new List<Model.Store.StoreModel>();
foreach (DataRow item in ds.Tables[0].Rows)
{
Model.Store.StoreModel inf = new Model.Store.StoreModel();
inf.store_color = item["ProductType_color"].ToString();
li.Add(inf);
}
return li;
}
#endregion
#region 修改单据状态-调拨(单据号,状态)
/// <summary>
/// 修改单据状态
/// </summary>
/// <param name="remove_id"></param>
/// <param name="remove_state"></param>
/// <returns></returns>
public int Upstate(string remove_id,string remove_state)
{
string commandtext = "Upstate";
SqlParameter xremove_id = new SqlParameter("@remove_id", SqlDbType.Char, 20);
SqlParameter xremove_state = new SqlParameter("@remove_state", SqlDbType.VarChar, 10);
xremove_id.Value = remove_id;
xremove_state.Value = remove_state;
return SqlHelper.ExecuteNonQuery(SqlHelper.conStr, CommandType.StoredProcedure, commandtext, new SqlParameter[] { xremove_id,xremove_state });
}
#endregion
#region 修改单据状态-采购(单据号,状态)
/// <summary>
/// 修改单据状态
/// </summary>
/// <param name="remove_id"></param>
/// <param name="remove_state"></param>
/// <returns></returns>
public int UpstateStock(string StockForm_id,string StockForm_OKText,int Stock_Type_id)
{
string commandtext = "UpstateStock";
SqlParameter xStockForm_id = new SqlParameter("@StockForm_id", SqlDbType.Char, 20);
SqlParameter xStock_Type_id = new SqlParameter("@Stock_Type_id",SqlDbType.Int);
SqlParameter xStockForm_OKText = new SqlParameter("@StockForm_OKText", SqlDbType.Char, 10);
xStockForm_id.Value = StockForm_id;
xStock_Type_id.Value = Stock_Type_id;
xStockForm_OKText.Value = StockForm_OKText;
return SqlHelper.ExecuteNonQuery(SqlHelper.conStr, CommandType.StoredProcedure, commandtext, new SqlParameter[] { xStockForm_id, xStock_Type_id, xStockForm_OKText });
}
#endregion
#region 修改单据状态-总部发退货(单据号,状态)
/// <summary>
/// 修改单据状态
/// </summary>
/// <param name="remove_id"></param>
/// <param name="remove_state"></param>
/// <returns></returns>
public int UpstateInvoice(string invoice_id, string invoice_state)
{
string commandtext = "UpstateInvoice";
SqlParameter xinvoice_id = new SqlParameter("@invoice_id", SqlDbType.Char, 20);
SqlParameter xinvoice_state = new SqlParameter("@invoice_state", SqlDbType.VarChar, 10);
xinvoice_id.Value = invoice_id;
xinvoice_state.Value = invoice_state;
return SqlHelper.ExecuteNonQuery(SqlHelper.conStr, CommandType.StoredProcedure, commandtext, new SqlParameter[] { xinvoice_id, xinvoice_state });
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -