private void comboBoxYHZC_SelectedIndexChanged(object sender, EventArgs e) { if ("是" == this.comboBoxYHZC.SelectedItem.ToString()) { object[] objArray = ServiceFactory.InvokePubService("Aisino.Fwkp.Bmgl.GetSLV_BY_BM", new object[] { this.comBoxSPFL.Text.Trim() }); if ((objArray != null) && (objArray.Length > 0)) { string[] strArray = (objArray[0] as DataTable).Rows[0]["ZZSTSGL"].ToString().Split(new char[] { ',', '、', ';', ',', ';' }); if (strArray.Length > 0) { this.comboBoxYHZCMC.Items.Clear(); foreach (string str in strArray) { if (Flbm.IsDK() || !str.Contains("1.5%")) { this.comboBoxYHZCMC.Items.Add(str); } } } } this.comboBoxYHZCMC.Enabled = true; } else { this.comboBoxYHZC.Text = "否"; this.comboBoxYHZCMC.Items.Add(""); this.comboBoxYHZCMC.Text = ""; this.comboBoxYHZCMC.Enabled = false; } }
private void AdjustComboBoxYHZC() { if (Flbm.IsYM()) { object[] objArray = ServiceFactory.InvokePubService("Aisino.Fwkp.Bmgl.GetSLV_BY_BM", new object[] { this.comBoxSPFL.Text.Trim() }); if (((objArray == null) || ((objArray[0] as DataTable).Rows.Count <= 0)) || ((objArray[0] as DataTable).Rows[0]["ZZSTSGL"].ToString() == "")) { this.comboBoxYHZC.SelectedIndex = 1; this.comboBoxYHZC.Enabled = false; } else { this.comboBoxYHZC.Enabled = true; if (!Flbm.IsDK()) { string[] strArray = (objArray[0] as DataTable).Rows[0]["ZZSTSGL"].ToString().Split(new char[] { ',', '、', ';', ',', ';' }); if ((strArray.Length == 1) && strArray[0].Contains("1.5%")) { this.comboBoxYHZC.SelectedIndex = 1; this.comboBoxYHZC.Enabled = false; } } } } else { this.comboBoxYHZC.Text = "否"; this.comboBoxYHZCMC.Items.Add(""); this.comboBoxYHZCMC.Text = ""; this.comboBoxYHZCMC.Enabled = false; } }
private void AdjustComboBoxYHZCMC() { if (this.comboBoxYHZC.Enabled && (this.comboBoxYHZC.Text.Trim() == "是")) { this.comboBoxYHZCMC.Enabled = true; object[] objArray = ServiceFactory.InvokePubService("Aisino.Fwkp.Bmgl.GetSLV_BY_BM", new object[] { this.comBoxSPFL.Text.Trim() }); if ((objArray != null) && (objArray.Length > 0)) { string[] strArray = (objArray[0] as DataTable).Rows[0]["ZZSTSGL"].ToString().Split(new char[] { ',', '、', ';', ',', ';' }); if (strArray.Length > 0) { string text = this.comboBoxYHZCMC.Text; this.comboBoxYHZCMC.Items.Clear(); foreach (string str2 in strArray) { if (Flbm.IsDK() || !str2.Contains("1.5%")) { this.comboBoxYHZCMC.Items.Add(str2); if (text == str2) { this.comboBoxYHZCMC.Text = text; } } } } } } else { this.comboBoxYHZCMC.Enabled = false; } }
public void ChooseYHZCMCForFYXM() { DataTable table = new DAL.BMFYXMManager().QueryFYXMYHZCIsAndYHZCMCIsEmpty(); if (table != null) { DAL.BMSPFLManager manager2 = new DAL.BMSPFLManager(); List <string> sqlID = new List <string>(); List <Dictionary <string, object> > param = new List <Dictionary <string, object> >(); for (int i = 0; i < table.Rows.Count; i++) { Dictionary <string, object> item = new Dictionary <string, object>(); string str = GetSafeData.ValidateValue <string>(table.Rows[i], "BM"); string bm = GetSafeData.ValidateValue <string>(table.Rows[i], "SPFL"); string str3 = GetSafeData.ValidateValue <string>(table.Rows[i], "YHZC"); string sPFLMCBYBM = manager2.GetSPFLMCBYBM(bm); string str5 = ""; object[] objArray = ServiceFactory.InvokePubService("Aisino.Fwkp.Bmgl.GetSLV_BY_BM", new object[] { bm }); if ((objArray != null) && (objArray.Length > 0)) { string[] strArray = (objArray[0] as DataTable).Rows[0]["ZZSTSGL"].ToString().Split(new char[] { ',', '、', ';', ',', ';' }); if (strArray.Length > 0) { str5 = strArray[0]; if ((!Flbm.IsDK() && (strArray.Length == 1)) && strArray[0].Contains("1.5%")) { str3 = "否"; str5 = ""; } if ((!Flbm.IsDK() && (strArray.Length > 1)) && strArray[0].Contains("1.5%")) { str5 = strArray[1]; } } else { str3 = "否"; } } else { str3 = "否"; } item.Add("BM", str); item.Add("SPFL", bm); item.Add("SPFLMC", sPFLMCBYBM); item.Add("YHZC", str3); item.Add("YHZCMC", str5); sqlID.Add("aisino.Fwkp.Bmgl.BMSPFL.UpdateFYXMSPFL"); param.Add(item); } new DAL.BMSPFLManager().UpdateSPFLTable(sqlID, param, false); } }
public ImportResult ImportData(string codeFile) { ImportResult result2; try { string[] strArray = File.ReadAllLines(codeFile, ToolUtil.GetEncoding()); if (strArray.Length == 0) { throw new CustomException("此文件没有内容"); } string str = ""; int index = 0; bool flag = true; while (flag) { if (strArray[index].StartsWith("{车辆编码}")) { string str2 = strArray[index]; if (!str2.Contains("\"")) { throw new CustomException("此文件首行车辆编码没有指定分隔符,分隔符使用双引号标注"); } str = str2.Substring(str2.IndexOf("\"")).Trim().Trim(new char[] { '"' }); flag = false; index++; } else { index++; if (index == strArray.Length) { throw new CustomException("此文件不符合车辆编码文本格式"); } } } ImportResult result = new ImportResult(); Stack <lastBMJG> stack = new Stack <lastBMJG>(); string str4 = this.TuiJianBM(""); string str5 = ""; bool flag2 = false; for (int i = index; i < strArray.Length; i++) { BMCLModel model; string lineText = strArray[i].Trim(); if (((lineText.Length == 0) || lineText.StartsWith("//")) || !lineText.Contains(str)) { continue; } string[] strArray2 = GetSafeData.Split(lineText, str); if (strArray2.Length < 3) { throw new CustomException("文本首行指定的分隔符与实际分隔符不一致,\n格式不正确等原因导致不能导入此文件!"); } model = new BMCLModel { BM = strArray2[0], MC = strArray2[1], JM = strArray2[2], }; model.KJM = CommonFunc.GenerateKJM(model.MC); string str7 = ""; string str8 = ""; ResultType none = ResultType.None; if (strArray2.Length > 3) { if (strArray2.Length < 6) { throw new CustomException(string.Format("第{0}行数据不全", i)); } model.WJ = 1; string str9 = ""; if (str == "~~") { str9 = strArray2[3].Replace(",", "\r\n").Replace("#|#", "\r\n"); } else if (str == " ") { str9 = strArray2[3].Replace("#|#", "\r\n"); } else { str9 = strArray2[3]; } model.CPXH = str9; string str10 = ""; if (str == "~~") { str10 = strArray2[4].Replace(",", "\r\n").Replace("#|#", "\r\n"); } else if (str == " ") { str10 = strArray2[4].Replace("#|#", "\r\n"); } else { str10 = strArray2[4]; } model.CD = str10; string str11 = ""; if (str == "~~") { str11 = strArray2[5].Replace(",", "\r\n").Replace("#|#", "\r\n"); } else if (str == " ") { str11 = strArray2[5].Replace("#|#", "\r\n"); } else { str11 = strArray2[5]; } model.SCCJMC = str11; if (Flbm.IsYM() && (strArray2.Length > 6)) { DAL.BMSPFLManager manager = new DAL.BMSPFLManager(); string bm = ""; if (str == "~~") { bm = strArray2[6].Replace(",", "\r\n").Replace("#|#", "\r\n"); } else if (str == " ") { bm = strArray2[6].Replace("#|#", "\r\n"); } else { bm = strArray2[6]; } if (strArray2.Length > 7) { string str13 = ""; if (str == "~~") { str13 = strArray2[7].Replace(",", "\r\n").Replace("#|#", "\r\n"); } else if (str == " ") { str13 = strArray2[7].Replace("#|#", "\r\n"); } else { str13 = strArray2[7]; } if (manager.CanUseThisSPFLBM(bm, false, false)) { model.SPFL = bm; model.SPFLMC = manager.GetSPFLMCBYBM(bm); if (manager.CanUseThisYHZC(bm)) { if ((str13.Trim() == "是") || (str13.Trim() == "否")) { model.YHZC = str13; if (model.YHZC == "否") { model.YHZCMC = ""; } } else { model.YHZC = "否"; model.YHZCMC = ""; } if (strArray2.Length > 9) { bool flag3 = false; if (str13.Trim() == "是") { object[] objArray = ServiceFactory.InvokePubService("Aisino.Fwkp.Bmgl.GetSLV_BY_BM", new object[] { model.SPFL }); if ((objArray != null) && (objArray.Length > 0)) { string[] strArray3 = (objArray[0] as DataTable).Rows[0]["ZZSTSGL"].ToString().Split(new char[] { ',', '、', ';', ',', ';' }); if (strArray3.Length > 0) { foreach (string str14 in strArray3) { if (strArray2[9].Trim() == str14) { model.YHZC = "是"; string str15 = ""; if (str == "~~") { str15 = strArray2[9].Replace(",", "\r\n").Replace("#|#", "\r\n"); } else if (str == " ") { str15 = strArray2[9].Replace("#|#", "\r\n"); } else { str15 = strArray2[9]; } model.YHZCMC = str15; flag3 = true; } if (!Flbm.IsDK() && strArray2[9].Trim().Contains("1.5%")) { model.YHZC = "否"; model.YHZCMC = ""; } } } } if (!flag3) { model.YHZC = "否"; model.YHZCMC = ""; } } else if (str13.Trim() == "否") { model.YHZC = "否"; model.YHZCMC = ""; } else { model.YHZC = "否"; model.YHZCMC = ""; } } } else { model.YHZC = "否"; model.YHZCMC = ""; } } } } } while (stack.Count > 0) { flag2 = false; if (model.BM.Length > stack.Peek().BM.Length) { if (!model.BM.StartsWith(stack.Peek().BM)) { goto Label_07AE; } model.SJBM = stack.Peek().BM; if (stack.Peek().Result == ResultType.Invalid) { str7 = "无效"; str8 = "上级编码无效"; none = ResultType.Invalid; result.Invalid++; } else if (stack.Peek().Result == ResultType.Failed) { str7 = "失败"; str8 = "上级编码失败"; none = ResultType.Failed; result.Failed++; } else { if (stack.Peek().Result != ResultType.Duplicated) { goto Label_07AE; } str5 = this.TuiJianBM(stack.Peek().BM); if (model.BM.Length == str5.Length) { goto Label_07AE; } str7 = "无效"; str8 = "编码长度必须与原有同级编码长度一致"; result.Invalid++; none = ResultType.Invalid; } goto Label_0940; } stack.Pop(); } flag2 = true; Label_07AE: if ((flag2 && (str4 != "001")) && (model.BM.Length != str4.Length)) { str7 = "无效"; str8 = "编码长度必须与原有同级编码长度一致"; result.Invalid++; none = ResultType.Invalid; } else if ("0" != this.CheckCustomer(model)) { str7 = "无效"; str8 = "编码或名称为空"; result.Invalid++; none = ResultType.Invalid; } else if (!Regex.IsMatch(model.BM, "^[0-9a-z]{1,16}$")) { str7 = "无效"; str8 = "编码需小于16位,且仅由数字和小写字母组成"; result.Invalid++; none = ResultType.Invalid; } else if (this.bmclDAL.ExistCustomer(model)) { if (str7.Length == 0) { str7 = "重复"; result.Duplicated++; } if (str8.Length == 0) { str8 = "编码重复"; none = ResultType.Duplicated; } else { str8 = str8 + "且编码重复"; none = ResultType.Invalid; } } else { string[] spellCode = StringUtils.GetSpellCode(model.MC); for (int j = 0; j < spellCode.Length; j++) { string text1 = spellCode[j]; } if (this.bmclDAL.AddCustomer(model) == "0") { str7 = "正确传入"; result.Correct++; none = ResultType.Correct; } else { str7 = "失败"; result.Failed++; none = ResultType.Failed; } } Label_0940 :; result.DtResult.Rows.Add(new object[] { model.BM, model.MC, str7, str8 }); stack.Push(new lastBMJG(model.BM, none)); } result.ImportTable = "车辆编码.DB"; result2 = result; } catch { throw; } return(result2); }