public void AddStandardRecord(StandardRecordInfo standardRecord) { SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@productID", SqlDbType.Int), new SqlParameter("@standardIDList", SqlDbType.NVarChar), new SqlParameter("@valueList", SqlDbType.NVarChar), new SqlParameter("@groupTag", SqlDbType.NVarChar) }; pt[0].Value = standardRecord.ProductID; pt[1].Value = standardRecord.StandardIDList; pt[2].Value = standardRecord.ValueList; pt[3].Value = standardRecord.GroupTag; ShopMssqlHelper.ExecuteNonQuery(ShopMssqlHelper.TablePrefix + "AddStandardRecord", pt); }
public void PrepareStandardRecordModel(SqlDataReader dr, List <StandardRecordInfo> standardRecordList) { while (dr.Read()) { StandardRecordInfo item = new StandardRecordInfo(); item.ProductID = dr.GetInt32(0); item.StandardIDList = dr[1].ToString(); item.ValueList = dr[2].ToString(); item.GroupTag = dr[3].ToString(); standardRecordList.Add(item); } }
protected void HanderProductStandard(ProductInfo product) { string strID = string.Empty; if (product.StandardType == 2) { strID = ("," + RequestHelper.GetForm <string>("Product") + ",").Replace(",0,", "," + product.ID.ToString() + ","); strID = strID.Substring(1, strID.Length - 2); } ProductBLL.UpdateProductStandardType(strID, product.StandardType, product.ID); if (product.ID > 0) { StandardRecordBLL.DeleteStandardRecordByProductID(product.ID.ToString()); } if (product.StandardType != 0) { int form = RequestHelper.GetForm <int>("recordCount"); string str2 = RequestHelper.GetForm <string>("StandardIDList"); if (str2 != string.Empty) { string[] strArray = strID.Split(new char[] { ',' }); int index = 0; for (int i = 0; i < form; i++) { if (base.Request.Form["Standard" + i] != null) { StandardRecordInfo standardRecord = new StandardRecordInfo(); standardRecord.StandardIDList = str2; standardRecord.ValueList = RequestHelper.GetForm <string>("Standard" + i); if (product.StandardType == 2) { standardRecord.GroupTag = strID; standardRecord.ProductID = Convert.ToInt32(strArray[index]); } else { standardRecord.ProductID = product.ID; } StandardRecordBLL.AddStandardRecord(standardRecord); index++; } } } } }
public static void AddStandardRecord(StandardRecordInfo standardRecord) { dal.AddStandardRecord(standardRecord); }