private void Bind() { Flag = Request.Params["Flag"]; if (Flag == "Company") { msg = GetTran("000290", "产品仓库明细"); dt = ProductWareHouseDetailsBLL.GetMoreWareHouseProductInfoByProductCode(Session["ProductCode"].ToString()); this.lbl_title.Text = GetTran("001824", "公司"); if (dt.Rows.Count < 1) { this.lbl_message.Text = GetTran("000380", "没有此产品的库存明细信息"); this.lbl_message.Visible = true; } else { this.lbl_message.Visible = false; } this.gvWareHouse.DataSource = dt; this.gvWareHouse.DataBind(); } if (Flag == "Store") { msg = GetTran("000295", "产品店铺明细"); dt = ProductWareHouseDetailsBLL.GetMoreStoreProductInfoByProductCode(Session["ProductCode"].ToString()); this.lbl_title.Text = GetTran("000388", "店铺"); if (dt.Rows.Count < 1) { this.lbl_message.Text = GetTran("000380", "没有此产品的库存明细信息"); this.lbl_message.Visible = true; } else { for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["StoreName"] = Encryption.Encryption.GetDecipherName(Convert.ToString(dt.Rows[i]["StoreName"])); dt.Rows[i]["Name"] = Encryption.Encryption.GetDecipherName(Convert.ToString(dt.Rows[i]["Name"])); } this.lbl_message.Visible = false; } this.gvStore.DataSource = dt; this.gvStore.DataBind(); } }
/// <summary> /// Judge ProductCode whether exists /// </summary> protected bool ProductCodeIsExist(ref string productCode) { bool flag = true; string notexistCode = string.Empty; if (this.txtCondition.Text.Length < 1) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("000301", "请输入产品编码!"))); return(false); } else { Regex rx = new Regex(@"[;|;]", RegexOptions.IgnoreCase); this.txtCondition.Text = rx.Replace(this.txtCondition.Text, ";"); //将中文分号转换成英文分号 productCode = this.txtCondition.Text.Trim(); Regex rx0 = new Regex(@"\w|;]+", RegexOptions.IgnoreCase); if (!rx0.IsMatch(productCode)) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert("多编号查询请用分号隔开!")); return(false); } //Judge ProductCode whether exists string[] productCodes = rx.Split(productCode); foreach (string code in productCodes) { int getCount = 0; getCount = ProductWareHouseDetailsBLL.GetProductCodeCountByProductCode(code); if (getCount < 1) { flag = false; notexistCode += code + ","; } } } if (!flag) { if (notexistCode.IndexOf(",") > 0) { notexistCode = notexistCode.Substring(0, notexistCode.Length - 1); } Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("000304", "对不起,该产品编码不存在!") + "[" + notexistCode + "]")); } return(flag); }