/// <summary> /// 加入黑名单 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Add_blackList_Click(object sender, EventArgs e) { //验证用户填写黑名单区域管辖 string country = CountryCity1.Country; string p = CountryCity1.Province; string city = CountryCity1.City; string xian = CountryCity1.Xian; if (!this.CountryCity1.CheckFill()) { ScriptHelper.SetAlert(out msg, GetTran("000886", "必须提供有效的区域")); CountryCity1.SelectCountry(country, p, city, xian); return; } string area = country + "," + p + "," + city + "," + xian; area = area.Replace(" ", ""); string[] areas = area.Split(','); if (areas.Length != 4) { ScriptHelper.SetAlert(out msg, GetTran("000887", "必须提供有效的区域!")); CountryCity1.SelectCountry(country, p, city, xian); return; } //判断是否已经存在该黑名单区域管辖 3代表区域管辖类型 string cpcode = CommonDataDAL.GetCPCCode(country, p, city, xian); if (BlackGroupBLL.HasBlackGroup(cpcode, 3)) { //提示已经存在,无需填写 ScriptHelper.SetAlert(out msg, GetTran("000890", "指定的黑名单区域已经存在,无法增加!")); CountryCity1.SelectCountry(country, p, city, xian); return; } BlackGroupModel blackGroup = new BlackGroupModel(); //区域管辖类型 blackGroup.IntGroupType = 3; blackGroup.IntGroupValue = cpcode; string operateIP = Request.UserHostAddress.ToString(); string operateNum = Session["Company"].ToString(); switch (BlackGroupBLL.AddBlackGroup(blackGroup, operateIP, operateNum)) { case 1: ScriptHelper.SetAlert(out msg, GetTran("000891", "添加成功!")); PageSet(); break; default: ScriptHelper.SetAlert(out msg, GetTran("000893", "执行发生错误")); break; } }
/// <summary> /// 加入黑名单 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Add_blackList_Click(object sender, EventArgs e) { string storeId = txtStoreID.Text.Trim(); //验证用户填写黑名单店铺管辖 if (storeId == "") { //提示用户填写 ScriptHelper.SetAlert(out msg, GetTran("001417", "必须提供管辖店铺编号!")); this.txtStoreID.Focus(); return; } //验证黑名单店铺管辖合法性 if (BlackListBLL.CheckStoreID(storeId)) { //提示无效 ScriptHelper.SetAlert(out msg, GetTran("001415", "必须提供有效的管辖店铺编号!")); this.txtStoreID.Text = ""; this.txtStoreID.Focus(); return; } //判断是否已经存在该黑名单店铺管辖 3代表店铺管辖类型 if (BlackGroupBLL.HasBlackGroup(storeId, 4)) { //提示已经存在,无需填写 ScriptHelper.SetAlert(out msg, GetTran("001412", "指定的管辖店铺已经存在,无法增加!")); this.txtStoreID.Text = ""; return; } BlackGroupModel blackGroup = new BlackGroupModel(); //店铺管辖类型 blackGroup.IntGroupType = 4; blackGroup.IntGroupValue = storeId; string operateIP = Request.UserHostAddress.ToString(); string operateNum = Session["Company"].ToString(); switch (BlackGroupBLL.AddBlackGroup(blackGroup, operateIP, operateNum)) { case 1: ScriptHelper.SetAlert(out msg, GetTran("000891", "添加成功!")); break; default: ScriptHelper.SetAlert(out msg, GetTran("001087", "执行发生错误")); break; } this.txtStoreID.Text = ""; PageSet(); Translations(); }
/// <summary> /// 加入黑名单 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Add_blackList_Click(object sender, EventArgs e) { //验证用户填写黑名单网络团队 if (txtNumber.Text == "") { //提示用户填写 ScriptHelper.SetAlert(out msg, GetTran("001343", "必须提供网络关系编号!")); this.txtNumber.Focus(); return; } //验证黑名单网络团队合法性 if (registermemeberBLL.CheckNumberTwice(txtNumber.Text) == null) { //提示无效 ScriptHelper.SetAlert(out msg, GetTran("001347", "必须提供有效的网络关系编号!")); this.txtNumber.Text = ""; this.txtNumber.Focus(); return; } //判断是否已经存在该黑名单网络团队 3代表网络团队类型 if (BlackGroupBLL.HasBlackGroup(txtNumber.Text, (this.radlnetWorkType.SelectedIndex == 0?5:6))) { //提示已经存在,无需填写 ScriptHelper.SetAlert(out msg, GetTran("001350", "指定的网络关系已经存在,无法增加!")); this.txtNumber.Text = ""; return; } BlackGroupModel blackGroup = new BlackGroupModel(); //网络团队类型 blackGroup.IntGroupType = (this.radlnetWorkType.SelectedIndex == 0 ? 5 : 6); blackGroup.IntGroupValue = txtNumber.Text; string operateIP = Request.UserHostAddress.ToString(); string operateNum = Session["Company"].ToString(); switch (BlackGroupBLL.AddBlackGroup(blackGroup, operateIP, operateNum)) { case 1: ScriptHelper.SetAlert(out msg, GetTran("000006", "添加成功!")); break; default: ScriptHelper.SetAlert(out msg, GetTran("001087", "执行发生错误")); break; } this.txtNumber.Text = ""; PageSet(); Translations(); }