1 现货信息发送#region 现货信息发送
2 [WebMethod(true)]
3 public string CreatePrice(string productid, string PLprice, string PHprice,string marketid)
4 {
5 string revalue = "0";
6 string[] _pidList = productid.Split(',');
7 string[] _plprice = PLprice.Split(',');
8 string[] _phprice = PHprice.Split(',');
9 DataSet ds = SmsProductEntityAction.Get_SmsProductAll(marketid);
10 DataTable tb;
11 string marketname = MarketEntityAction.Get_MarketModel(marketid).MarketName;
12 string msg = "";
13 if (ds.Tables.Count >= 1)
14 {
15 for (int i = 0; i < _pidList.Length; i++)
16 {
17 if (_plprice.Trim() != "")
18 {
19 DataRow[] row = ds.Tables[0].Select("ProductId='" + _pidList + "'");
20 if (row.Length >= 1)
21 {
22 string _AttId = row[0]["AttributeID"].ToString();
23 msg += PriceGroup.AlertPriceEntity(int.Parse(_AttId), _plprice.ToString(), _phprice.ToString(), row[0]["ProductName"].ToString());
24 }
25 }
26 }
27 if (msg == "")
28 {
29 tb = PriceGroup.CreateDataTable();
30 ArrayList al = new ArrayList(200);
31 for (int i = 0; i < _pidList.Length; i++)
32 {
33 string lp = _plprice.ToString();
34 string hp = _phprice.ToString();
35 string pid = _pidList.ToString();
36 if (lp.Trim() != "")
37 {
38 DataRow[] row = ds.Tables[0].Select("ProductId='" + pid + "'");
39 if (row.Length >= 1)
40 {
41 string AttId = row[0]["AttributeID"].ToString();
42 PriceEntity _Pe = PriceGroup.SetPriceEntity(int.Parse(AttId), lp, hp, pid, marketid);
43 PriceGroup.ConvertToDataTable(tb, _Pe);
44 }
45 al.Add(pid);
46 }
47 }
48 int _flag = PriceEntityAction.create_Price(tb);
49 if (_flag != 0)
50 {
51 revalue = "数据没有正确存储,请重新提交!";
52 //MessageBox.MsgShow(this, "数据没有正确存储请重新提交!");
53 }
54 else
55 {
56 Guid gi = Guid.NewGuid();
57 Session[gi.ToString()] = al;
58 revalue = "index.aspx?Subid=31&marketname=" + marketname + "&marketid=" + marketid + "&guid=" + gi.ToString();
59 //HttpContext.Current.Response.Redirect("index.aspx?Subid=31&marketname=" + marketname + "&marketid=" + marketid + "&guid=" + gi.ToString() + "");
60 }
61 }
62 else
63 {
64 revalue = msg + "\n请查检您的输入是否正确!\n";
65 //msg += "\\r\\n请查检您的输入是否正确!\\n";
66 //MessageBox.MsgShow(this, msg);
67 }
68 }
69 return revalue;
70 }
71 #endregion