货号加价编辑功能
This commit is contained in:
1 parent
e4b726fc51
commit
011b909bfc
12 files changed
+1085
-383
No files matched your search
@@ -234,7 +234,7 @@ namespace KJD_Web.BLL
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
|
||||
var id = RegexUtils.GetStringQuery(ref inputData, "db_id");
|
||||
var db_id = RegexUtils.GetStringQuery(ref inputData, "db_id");
|
||||
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"));
|
||||
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code"));
|
||||
string original_price = RegexUtils.GetStringQuery(ref inputData, "original_price");
|
||||
@@ -252,14 +252,24 @@ namespace KJD_Web.BLL
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@markup_times", Value = markup_times.ParseToInt(), });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@extra_price", Value = extra_price.ParseToInt(), });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@db_id", Value = db_id, });
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sqlExist = "select count(ext_code) from kjd.price_markup where ext_code=@ext_code and id!=@db_id";
|
||||
var has = mySql.ExecuteFirst(sqlExist, paramLst.ToArray());
|
||||
if (has != "0")
|
||||
{
|
||||
mySql.Close();
|
||||
return "{\"code\":501,\"msg\":\"货号 " + ext_code + " 价格数据已存在\"}";
|
||||
}
|
||||
|
||||
string sql = "update kjd.price_markup set";
|
||||
if (notes != null)
|
||||
sql += " notes=@notes,";
|
||||
//if (ext_code != null)
|
||||
// sql += " ext_code=@ext_code,";
|
||||
if (ext_code != null)
|
||||
sql += " ext_code=@ext_code,";
|
||||
if (original_price != null)
|
||||
sql += " original_price=@original_price,";
|
||||
if (markup_times != null)
|
||||
@@ -267,9 +277,9 @@ namespace KJD_Web.BLL
|
||||
if (extra_price != null)
|
||||
sql += " extra_price=@extra_price,";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " where id=@id;";
|
||||
sql += " where id=@db_id;";
|
||||
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
|
||||
mySql.Close();
|
||||
if (rst)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user