1微信店铺切换登录 20% 2过滤筛选备注改为全等于 3数据库数据拉回逻辑优化

This commit is contained in:
wule committed 2026-03-13 16:21:15 +08:00
1 parent dc83334c59
commit 860b4408ef
37 files changed
+2520 -274

No files matched your search

@@ -1127,6 +1127,7 @@ namespace TemuKJD.WXForms.ProductForms
this.cmbSourceType.Items.AddRange(new object[] {
"",
"厂商直采",
"微信店采",
"店铺采集",
"机会商品",
"以图搜品",
@@ -54,6 +54,8 @@ namespace TemuKJD.WXForms.ProductForms
"顶级", "之王", "二手", "亏本", "冲量", "白菜价", "跳楼价", "xxx", "xx", "最大", "最小", "低价", "降价", "成本", "赔钱", "甩卖",
"真丝", "蚕丝", "香云纱", "羊绒", "羊毛", "羊羔绒", "羊羔毛", "羽绒", "皮草"
};
string DefaultAdultBrandId = "";
public WXDBProdUploadForm()
{
InitializeComponent();
@@ -484,7 +486,7 @@ namespace TemuKJD.WXForms.ProductForms
Invoke(new Action(() =>
{
if (cmbSourceType.Text != "厂商直采")
if (cmbSourceType.Text.Trim() != "厂商直采" && cmbSourceType.Text.Trim() != "微信店采")
{
fillPddCate();
}
@@ -1323,8 +1325,21 @@ namespace TemuKJD.WXForms.ProductForms
}
#endregion
WXGetEditProductInfoLite wxEditProdInfo = null;
if (dbProd.product_get_type_text == "微信店采")
{
try
{
wxEditProdInfo = JsonHelper.DeserializeJsonToObject<WXGetEditProductInfoLite>(dbProd.product_json);
}
catch (Exception ex)
{
return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"微信商品格式获取失败" + ex.Message + "\"}";
}
}
#region 将聚水潭产品数据格式进行转换成pdd格式统一上传,匹配加密的spuCode和skuCoke 微信小店的货号spuCode和外部商品编号outProductId/out_product_id对应加密的聚水潭goodsId
if (dbProd.sku_secret_json != null && dbProd.sku_secret_json.Contains("goodsId"))
if (dbProd.product_get_type_text == "厂商直采" && dbProd.sku_secret_json != null && dbProd.sku_secret_json.Contains("goodsId"))
{
string convertRst = "";
var ob = new PDDProdFormConverter().JstPddProdToPddConvert(out convertRst, dbProd);
@@ -1333,6 +1348,16 @@ namespace TemuKJD.WXForms.ProductForms
}
#endregion
#region 微信格式转换
if (dbProd.product_get_type_text == "微信店采")
{
string convertRst = "";
var ob = new PDDProdFormConverter().WXProdToPddConvert(out convertRst, dbProd);
if (!string.IsNullOrEmpty(convertRst))
return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"商品查询错误 " + convertRst + "\"}";
}
#endregion
#region 将产品数据初始化成微信小店支持的参数
JObject prodJObj = new JObject();
try
@@ -1511,7 +1536,6 @@ namespace TemuKJD.WXForms.ProductForms
}
#endregion
WXGetEditProductInfoLite wxEditProdInfo = null;
if (BaseClass.UserAuthority.ParseToString().Contains("微信回采") && chkUseWXComplateProd.Checked && dbProd.has_wx_format == "1")
{
string errMsg = "";
@@ -1704,6 +1728,13 @@ namespace TemuKJD.WXForms.ProductForms
{
try
{
if (dbProd.product_get_type_text == "微信店采")
{
upProdInitParam.product.info.headImg.Add(gallery_item.url);
upProdParam.product.info.headImg.Add(gallery_item.url);
continue;
}
// 获取缓存盗链 主图
if (wxImgMapDic.ContainsKey(BaseClass.GetMd5(gallery_item.url)))
{
@@ -1920,9 +1951,10 @@ namespace TemuKJD.WXForms.ProductForms
}));
}
List<long> aiCateIdLst = new List<long>();
// 聚水潭商品已识别类目使用类目缓存
// 微信商品使用类目缓存
if (!dbProd.wx_cat_leaf.IsNullOrZero())
{
// 聚水潭商品已识别类目使用类目缓存
if (!dbProd.wx_cat_1.IsNullOrZero())
aiCateIdLst.Add(dbProd.wx_cat_1.ParseToLong());
if (!dbProd.wx_cat_2.IsNullOrZero())
@@ -2195,7 +2227,8 @@ namespace TemuKJD.WXForms.ProductForms
var afterSaleAddress = "";
var afterSaleDetail = "";
if (dbProd.wx_cat_leaf != null)
// 厂商直采获取售后地址用于处理售后单
if (dbProd.product_get_type_text == "厂商直采" && dbProd.wx_cat_leaf != null)
{
var urlAfterSale = BaseClass.BuildObjString("product/wx_get_after_sale");
@@ -2301,8 +2334,8 @@ namespace TemuKJD.WXForms.ProductForms
upProdParam.product.info.afterSaleInfo.afterSaleAddressId = BaseRegex.GetStringJson(ref addressRst, "addressId");
#endregion
// 厂商直采获取推单运费模板
#region 获取推单运费模板,计算运费加价。
if (cell != null)
{
Invoke(new Action(() =>
@@ -2314,7 +2347,7 @@ namespace TemuKJD.WXForms.ProductForms
var shippingTemplateJson = "";
var shipPrice = 0;
if (dbProd.wx_cat_leaf != null)
if (dbProd.product_get_type_text == "厂商直采" && dbProd.wx_cat_leaf != null)
{
var urlShipping = BaseClass.BuildObjString("product/wx_get_shipping_template");
var dataShipping = Work.UserLogin.GetSignaturex() +
@@ -2437,6 +2470,12 @@ namespace TemuKJD.WXForms.ProductForms
{
try
{
if (dbProd.product_get_type_text == "微信店采")
{
upProdParam.product.info.detail.detailImg.Add(gallery_item.url);
continue;
}
// 获取缓存盗链 详情图
if (wxImgMapDic.ContainsKey(BaseClass.GetMd5(gallery_item.url)))
{
@@ -2584,26 +2623,37 @@ namespace TemuKJD.WXForms.ProductForms
upProdParam.product.info.param = new List<wxPropParam>(); // 商品属性值
var productAttr = upProdParam.product.info.category.LastOrDefault().catInfo.productAttr;
// 直接转换微信回采
if (BaseClass.UserAuthority.ParseToString().Contains("微信回采") && chkUseWXComplateProd.Checked && dbProd.has_wx_format == "1" && wxEditProdInfo != null)
{
foreach(var wxEditPropParam in wxEditProdInfo.product.info.param)
{
var wxPropParam = new wxPropParam();
upProdParam.product.info.param.Add(wxPropParam);
//var wxCategoryParam1 = new categoryPropParam()
//{
// catType = 7,
// name = attr.name,
// catInfo = new catInfoParam() { inputType = attr.normalRelease.ruleType, isRequired = attr.isRequired == true ? 1 : 0, isCustomize = 0 }
//};
//var wxCategoryParam2 = new categoryPropParam()
//{
// catType = 7,
// name = attrValue,
// catInfo = new catInfoParam() { inputType = attr.normalRelease.ruleType, isRequired = attr.isRequired == true ? 1 : 0, isCustomize = 0 }
//};
//wxPropParam.categorys.Add(wxCategoryParam1);
//wxPropParam.categorys.Add(wxCategoryParam2);
foreach (var wxEditCategoryParam in wxEditPropParam.categorys)
{
var wxCategoryParam = new categoryPropParam()
{
catType = wxEditCategoryParam.catType,
name = wxEditCategoryParam.name,
catInfo = new catInfoParam()
{
inputType = wxEditCategoryParam.catInfo.inputType,
isRequired = wxEditCategoryParam.catInfo.isRequired,
isCustomize = wxEditCategoryParam.catInfo.isCustomize,
}
};
wxPropParam.categorys.Add(wxCategoryParam);
}
}
}
// 直接转换微信店采
else if (dbProd.product_get_type_text == "微信店采")
{
foreach (var wxEditPropParam in wxEditProdInfo.product.info.param)
{
var wxPropParam = new wxPropParam();
upProdParam.product.info.param.Add(wxPropParam);
foreach (var wxEditCategoryParam in wxEditPropParam.categorys)
{
var wxCategoryParam = new categoryPropParam()
@@ -3011,6 +3061,12 @@ namespace TemuKJD.WXForms.ProductForms
var spec = sku.spec[0];
if (!attrParam.items.Any(it => it.value == spec.spec_name) && !string.IsNullOrEmpty(sku.thumb_url))
{
if (dbProd.product_get_type_text == "微信店采")
{
attrParam.items.Add(new productSaleAttrItemParam() { value = spec.spec_name, imgUrl = sku.thumb_url, });
continue;
}
// 获取缓存盗链 sku图
if (wxImgMapDic.ContainsKey(BaseClass.GetMd5(sku.thumb_url)))
{
@@ -3295,6 +3351,7 @@ namespace TemuKJD.WXForms.ProductForms
#endregion
// 资质信息
// 微信回采直接复制
if (BaseClass.UserAuthority.ParseToString().Contains("微信回采") && chkUseWXComplateProd.Checked && dbProd.has_wx_format == "1" && wxEditProdInfo != null)
{
upProdParam.product.info.qualificationList.Clear();
@@ -3312,7 +3369,34 @@ namespace TemuKJD.WXForms.ProductForms
if (upProdParam.product.info.category.FirstOrDefault()?.name == "成人用品" && upProdParam.product.info.category[1].name != "情趣内衣")
{
upProdParam.product.info.brandId = wxEditProdInfo.product.info.brandId.ParseToLong();
if (wxEditProdInfo.product.info.brandId.ParseToLong() > 0)
DefaultAdultBrandId = wxEditProdInfo.product.info.brandId;
if (wxEditProdInfo.product.info.brandId.ParseToLong() > 0)
upProdParam.product.info.brandId = wxEditProdInfo.product.info.brandId.ParseToLong();
}
}
// 微信店采直接复制
else if (dbProd.product_get_type_text == "微信店采")
{
upProdParam.product.info.qualificationList.Clear();
if (wxEditProdInfo.product?.info?.qualificationList?.Count > 0)
{
foreach (var editQualification in wxEditProdInfo.product.info.qualificationList)
{
upProdParam.product.info.qualificationList.Add(new qualificationParam()
{
qualificationId = editQualification.qualificationId,
qualificationUrl = editQualification.qualificationUrl,
});
}
}
if (upProdParam.product.info.category.FirstOrDefault()?.name == "成人用品" && upProdParam.product.info.category[1].name != "情趣内衣")
{
if (wxEditProdInfo.product.info.brandId.ParseToLong() > 0)
DefaultAdultBrandId = wxEditProdInfo.product.info.brandId;
if (wxEditProdInfo.product.info.brandId.ParseToLong() > 0)
upProdParam.product.info.brandId = wxEditProdInfo.product.info.brandId.ParseToLong();
}
}
else
@@ -3574,6 +3658,14 @@ namespace TemuKJD.WXForms.ProductForms
#endregion
}
// 直接使用微信回采情趣商品品牌
if (BaseClass.UserAuthority.ParseToString().Contains("微信回采") && chkUseWXComplateProd.Checked &&
upProdParam.product.info.category.FirstOrDefault()?.name == "成人用品" && upProdParam.product.info.category[1].name != "情趣内衣")
{
if (DefaultAdultBrandId.ParseToLong() > 0)
upProdParam.product.info.brandId = DefaultAdultBrandId.ParseToLong();
}
// 情趣内衣类禁止设置运费险
if (upProdParam.product.info.category[1].name == "情趣内衣")
{
upProdParam.product.info.extraService.freightInsurance = 0;
@@ -4079,7 +4171,7 @@ namespace TemuKJD.WXForms.ProductForms
data += "&in_ext_codes=" + txtExtCodeFilter.Text;
data += "&in_spu_ids=" + txtIdFilter.Text;
data += "&in_groups=" + cmbGroupFilter.Text;
if (cmbSourceType.Text != "厂商直采")
if (cmbSourceType.Text != "厂商直采" && cmbSourceType.Text != "微信店采")
data += "&in_cates=" + cmbCateFilter1.Text;
else
{
@@ -4444,7 +4536,7 @@ namespace TemuKJD.WXForms.ProductForms
private void cmbSourceType_SelectedIndexChanged(object sender, EventArgs e)
{
if (cmbSourceType.Text != "厂商直采")
if (cmbSourceType.Text != "厂商直采" && cmbSourceType.Text != "微信店采")
fillPddCate();
else
fillWxCate();
@@ -4457,7 +4549,7 @@ namespace TemuKJD.WXForms.ProductForms
private void cmbCateFilter1_SelectedIndexChanged(object sender, EventArgs e)
{
if (cmbSourceType.Text != "厂商直采")
if (cmbSourceType.Text != "厂商直采" && cmbSourceType.Text != "微信店采")
return;
cmbCateFilter2.Text = "";
@@ -4473,7 +4565,7 @@ namespace TemuKJD.WXForms.ProductForms
private void cmbCateFilter2_SelectedIndexChanged(object sender, EventArgs e)
{
if (cmbSourceType.Text != "厂商直采")
if (cmbSourceType.Text != "厂商直采" && cmbSourceType.Text != "微信店采")
return;
cmbCateFilter3.Text = "";
@@ -4515,7 +4607,7 @@ namespace TemuKJD.WXForms.ProductForms
string notes = cmbFilterShopNotes.Text.Trim().Trim(';');
if (notes == "全部")
notes = "";
List<string> notesLst = notes.Split(new string[] { ";", ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries).ToList();
List<string> notesLst = notes.Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
if (!row.Cells["colShopName"].Value.ParseToString().Contains(txtFilterShopName.Text.Trim()))
{
@@ -4523,7 +4615,7 @@ namespace TemuKJD.WXForms.ProductForms
row.Cells["colSelect"].Value = false;
continue;
}
if (!row.Cells["colShopNotes"].Value.ParseToString().Contains(notes) && !notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString()))
if (!string.IsNullOrWhiteSpace(notes) && !notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString()))
{
row.Visible = false;
row.Cells["colSelect"].Value = false;
@@ -4554,14 +4646,14 @@ namespace TemuKJD.WXForms.ProductForms
string notes = cmbFilterShopNotes.Text.Trim().Trim(';');
if (notes == "全部")
notes = "";
List<string> notesLst = notes.Split(new string[] { ";", ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries).ToList();
List<string> notesLst = notes.Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (row.Visible == true)
{
if (row.Cells["colShopName"].Value.ParseToString().Contains(txtFilterShopName.Text.Trim()) &&
(row.Cells["colShopNotes"].Value.ParseToString().Contains(notes) || notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString())))
(string.IsNullOrWhiteSpace(notes) || notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString())))
{
row.Cells["colSelect"].Value = true;
}
@@ -4574,14 +4666,14 @@ namespace TemuKJD.WXForms.ProductForms
string notes = cmbFilterShopNotes.Text.Trim().Trim(';');
if (notes == "全部")
notes = "";
List<string> notesLst = notes.Split(new string[] { ";", ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries).ToList();
List<string> notesLst = notes.Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (row.Visible == true)
{
if (row.Cells["colShopName"].Value.ParseToString().Contains(txtFilterShopName.Text.Trim()) &&
(row.Cells["colShopNotes"].Value.ParseToString().Contains(notes) || notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString())))
(string.IsNullOrWhiteSpace(notes) || notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString())))
{
row.Cells["colSelect"].Value = false;
}
@@ -4825,6 +4917,15 @@ Content-Type: image/jpeg
return result;
}
public static string getAddressById(ShopLoginInfo shop, string AddressId)
{
string url = "https://store.weixin.qq.com/shop-faas/mmchannelstradeexpress/cgi/getAddress?offset=0&limit=20&includeBlock=1&addressId=" + AddressId +
"&token=&lang=zh_CN";
string referer = "https://store.weixin.qq.com/shop/address/expressAddressMgmt";
var result = WXHttpResponseBLL.WeiXinGetResponse(shop, url, referer);
return result;
}
public static string uploadProductDraft(ShopLoginInfo shop, WXUploadProductParam prodParam)
{
string url = "https://store.weixin.qq.com/shop-faas/mmecnodeproductupload/common/cgi/goods/uploadProductDraft?token=&lang=zh_CN";
@@ -956,7 +956,7 @@ namespace TemuKJD.WXForms.ProductForms
string notes = cmbFilterShopNotes.Text.Trim().Trim(';');
if (notes == "全部")
notes = "";
List<string> notesLst = notes.Split(new string[] { ";", ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries).ToList();
List<string> notesLst = notes.Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
if (!row.Cells["colShopName"].Value.ParseToString().Contains(txtFilterShopName.Text.Trim()))
{
@@ -964,7 +964,7 @@ namespace TemuKJD.WXForms.ProductForms
row.Cells["colSelect"].Value = false;
continue;
}
if (!row.Cells["colShopNotes"].Value.ParseToString().Contains(notes) && !notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString()))
if (!string.IsNullOrWhiteSpace(notes) && !notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString()))
{
row.Visible = false;
row.Cells["colSelect"].Value = false;
@@ -995,14 +995,14 @@ namespace TemuKJD.WXForms.ProductForms
string notes = cmbFilterShopNotes.Text.Trim().Trim(';');
if (notes == "全部")
notes = "";
List<string> notesLst = notes.Split(new string[] { ";", ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries).ToList();
List<string> notesLst = notes.Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (row.Visible == true)
{
if (row.Cells["colShopName"].Value.ParseToString().Contains(txtFilterShopName.Text.Trim()) &&
(row.Cells["colShopNotes"].Value.ParseToString().Contains(notes) || notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString())))
(string.IsNullOrWhiteSpace(notes) || notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString())))
{
row.Cells["colSelect"].Value = true;
}
@@ -1015,14 +1015,14 @@ namespace TemuKJD.WXForms.ProductForms
string notes = cmbFilterShopNotes.Text.Trim().Trim(';');
if (notes == "全部")
notes = "";
List<string> notesLst = notes.Split(new string[] { ";", ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries).ToList();
List<string> notesLst = notes.Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (row.Visible == true)
{
if (row.Cells["colShopName"].Value.ParseToString().Contains(txtFilterShopName.Text.Trim()) &&
(row.Cells["colShopNotes"].Value.ParseToString().Contains(notes) || notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString())))
(string.IsNullOrWhiteSpace(notes) || notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString())))
{
row.Cells["colSelect"].Value = false;
}
@@ -954,7 +954,7 @@ namespace TemuKJD.WXForms.ProductForms
string notes = cmbFilterShopNotes.Text.Trim().Trim(';');
if (notes == "全部")
notes = "";
List<string> notesLst = notes.Split(new string[] { ";", ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries).ToList();
List<string> notesLst = notes.Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
if (!row.Cells["colShopName"].Value.ParseToString().Contains(txtFilterShopName.Text.Trim()))
{
@@ -962,7 +962,7 @@ namespace TemuKJD.WXForms.ProductForms
row.Cells["colSelect"].Value = false;
continue;
}
if (!row.Cells["colShopNotes"].Value.ParseToString().Contains(notes) && !notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString()))
if (!string.IsNullOrWhiteSpace(notes) && !notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString()))
{
row.Visible = false;
row.Cells["colSelect"].Value = false;
@@ -993,14 +993,14 @@ namespace TemuKJD.WXForms.ProductForms
string notes = cmbFilterShopNotes.Text.Trim().Trim(';');
if (notes == "全部")
notes = "";
List<string> notesLst = notes.Split(new string[] { ";", ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries).ToList();
List<string> notesLst = notes.Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (row.Visible == true)
{
if (row.Cells["colShopName"].Value.ParseToString().Contains(txtFilterShopName.Text.Trim()) &&
(row.Cells["colShopNotes"].Value.ParseToString().Contains(notes) || notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString())))
(string.IsNullOrWhiteSpace(notes) || notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString())))
{
row.Cells["colSelect"].Value = true;
}
@@ -1013,14 +1013,14 @@ namespace TemuKJD.WXForms.ProductForms
string notes = cmbFilterShopNotes.Text.Trim().Trim(';');
if (notes == "全部")
notes = "";
List<string> notesLst = notes.Split(new string[] { ";", ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries).ToList();
List<string> notesLst = notes.Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (row.Visible == true)
{
if (row.Cells["colShopName"].Value.ParseToString().Contains(txtFilterShopName.Text.Trim()) &&
(row.Cells["colShopNotes"].Value.ParseToString().Contains(notes) || notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString())))
(string.IsNullOrWhiteSpace(notes) || notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString())))
{
row.Cells["colSelect"].Value = false;
}
@@ -696,7 +696,7 @@ namespace TemuKJD.WXForms.ProductForms
string notes = cmbFilterShopNotes.Text.Trim().Trim(';');
if (notes == "全部")
notes = "";
List<string> notesLst = notes.Split(new string[] { ";", ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries).ToList();
List<string> notesLst = notes.Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
if (!row.Cells["colShopName"].Value.ParseToString().Contains(txtFilterShopName.Text.Trim()))
{
@@ -704,7 +704,7 @@ namespace TemuKJD.WXForms.ProductForms
row.Cells["colSelect"].Value = false;
continue;
}
if (!row.Cells["colShopNotes"].Value.ParseToString().Contains(notes) && !notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString()))
if (!string.IsNullOrWhiteSpace(notes) && !notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString()))
{
row.Visible = false;
row.Cells["colSelect"].Value = false;
@@ -735,14 +735,14 @@ namespace TemuKJD.WXForms.ProductForms
string notes = cmbFilterShopNotes.Text.Trim().Trim(';');
if (notes == "全部")
notes = "";
List<string> notesLst = notes.Split(new string[] { ";", ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries).ToList();
List<string> notesLst = notes.Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (row.Visible == true)
{
if (row.Cells["colShopName"].Value.ParseToString().Contains(txtFilterShopName.Text.Trim()) &&
(row.Cells["colShopNotes"].Value.ParseToString().Contains(notes) || notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString())))
(string.IsNullOrWhiteSpace(notes) || notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString())))
{
row.Cells["colSelect"].Value = true;
}
@@ -755,14 +755,14 @@ namespace TemuKJD.WXForms.ProductForms
string notes = cmbFilterShopNotes.Text.Trim().Trim(';');
if (notes == "全部")
notes = "";
List<string> notesLst = notes.Split(new string[] { ";", ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries).ToList();
List<string> notesLst = notes.Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (row.Visible == true)
{
if (row.Cells["colShopName"].Value.ParseToString().Contains(txtFilterShopName.Text.Trim()) &&
(row.Cells["colShopNotes"].Value.ParseToString().Contains(notes) || notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString())))
(string.IsNullOrWhiteSpace(notes) || notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString())))
{
row.Cells["colSelect"].Value = false;
}