public string UpdateSubNodesSJBM(BMXZQYModel xzqEntity, string YuanBM) { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary.Add("bm", YuanBM); dictionary.Add("bmLike", YuanBM + "%"); this.baseDAO.querySQLDataTable("aisino.Fwkp.Bmgl.BMXZQY.XZQYBMGetSubNode", dictionary); List <string> list = new List <string>(); List <Dictionary <string, object> > list2 = new List <Dictionary <string, object> >(); try { Dictionary <string, object> item = new Dictionary <string, object>(); item.Add("bm", YuanBM); item.Add("afterbm", xzqEntity.BM); item.Add("MC", xzqEntity.MC); list.Add("aisino.Fwkp.Bmgl.BMXZQY.XZQYBMModify"); list2.Add(item); if (this.baseDAO.未确认DAO方法1(list.ToArray(), list2) > 0) { return("0"); } return("errorModify"); } catch (Exception exception) { if (!exception.Message.Contains("UNIQUE constraint failed")) { throw; } return("e1"); } }
protected override object[] doService(object[] param) { if (param.Length < 2) { throw new ArgumentException("参数错误,至少有2个参数"); } string oldBM = (param[0] as string).Trim(); string str2 = (param[1] as string).Trim(); string str3 = (param[2] as string).Trim(); if (str2.Length == 0) { MessageBoxHelper.Show("请输入行政区域编码", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(new object[] { "Cancel" }); } if (str3.Length == 0) { MessageBoxHelper.Show("请输入行政区域名称", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(new object[] { "Cancel" }); } BMXZQYModel xzqEntity = new BMXZQYModel { BM = str2, MC = str3 }; string str4 = this.xzqyManager.ModifyDistrict(xzqEntity, oldBM); if (str4 == "0") { str4 = "OK"; return(new object[] { str4 }); } this.log.Info("修改行政区域失败:" + str4); return(new object[] { "Error:", str4 }); }
public bool ExistDistrict(BMXZQYModel xzqEntity) { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary.Add("bm", xzqEntity.BM); return(this.baseDAO.queryValueSQL <int>("aisino.Fwkp.Bmgl.BMXZQY.XZQYExist", dictionary) > 0); }
public string ModifyDistrict(BMXZQYModel xzqEntity, string OldBM) { string str = this.CheckDistrict(xzqEntity); if (str != "0") { return(str); } return(this.bmkhDAL.ModifyDistrict(xzqEntity, OldBM)); }
public string UpdateSubNodesSJBM(BMXZQYModel xzqEntity, string YuanBM) { string str = this.CheckDistrict(xzqEntity); if (str != "0") { return(str); } return(this.bmkhDAL.UpdateSubNodesSJBM(xzqEntity, YuanBM)); }
public BMXZQY_Edit(string SJBM, BMXZQY Father) { this.khlogical = new BMXZQYManager(); this.xzqyModel = new BMXZQYModel(); this.log = LogUtil.GetLogger <BMXZQY_Edit>(); this._bm = ""; this.SuggestBM = ""; this.Initialize(); this.father = Father; this.Text = "行政区域编码添加"; }
public BMXZQYFenLei(string SJBM, BMXZQY Father) { this.khlogical = new BMXZQYManager(); this.khModel = new BMXZQYModel(); this.bm = ""; this.yuanBM = ""; this.SuggestBM = ""; this.Initialize(); this.father = Father; this.Text = "行政区域分类编码添加"; }
public string AddDistrict(BMXZQYModel xzqEntity) { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary.Add("BM", xzqEntity.BM); dictionary.Add("MC", xzqEntity.MC); if (this.baseDAO.未确认DAO方法2_疑似updateSQL("aisino.Fwkp.Bmgl.BMXZQY.XZQYAdd", dictionary) > 0) { return("0"); } return("e02"); }
public BMXZQY_Edit(string BM, bool Isupdate) { this.khlogical = new BMXZQYManager(); this.xzqyModel = new BMXZQYModel(); this.log = LogUtil.GetLogger <BMXZQY_Edit>(); this._bm = ""; this.SuggestBM = ""; this.Initialize(); this._bm = BM; this.yuanBM = BM; this.isUpdate = Isupdate; this.Text = "行政区域编码编辑"; }
public BMXZQYModel GetModel(string BM) { DataTable bMXZQY = this.bmkhDAL.GetBMXZQY(BM); BMXZQYModel model = new BMXZQYModel(); if (bMXZQY.Rows.Count > 0) { DataRow row = bMXZQY.Rows[0]; model.BM = GetSafeData.ValidateValue <string>(row, "BM"); model.MC = GetSafeData.ValidateValue <string>(row, "MC"); } return(model); }
public BMXZQYFenLei(string BM, bool Isupdate) { this.khlogical = new BMXZQYManager(); this.khModel = new BMXZQYModel(); this.bm = ""; this.yuanBM = ""; this.SuggestBM = ""; this.Initialize(); this.bm = BM; this.yuanBM = BM; this.isUpdate = Isupdate; this.Text = "行政区域分类编码编辑"; }
public string CheckDistrict(BMXZQYModel xzqEntity) { if (xzqEntity == null) { return("e11"); } if ((xzqEntity.BM == null) || (xzqEntity.BM.Length == 0)) { return("e12"); } if ((xzqEntity.MC != null) && (xzqEntity.MC.Length != 0)) { return("0"); } return("e13"); }
public string AddDistrictKP(BMXZQYModel xzqEntity, int Addtype) { string str = this.CheckDistrict(xzqEntity); if (str == "0") { if (this.bmkhDAL.ExistDistrict(xzqEntity)) { MessageManager.ShowMsgBox("INP-235108"); return("编码已存在"); } str = this.bmkhDAL.AddDistrict(xzqEntity); if ((Addtype == 1) && (str == "0")) { MessageManager.ShowMsgBox("INP-235201"); } } return(str); }
protected override object[] doService(object[] param) { if (param.Length < 1) { throw new ArgumentException("参数错误,至少有1个参数"); } string bM = (param[0] as string).Trim(); if (bM.Length == 0) { MessageBoxHelper.Show("请输入行政区域编码", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(new object[] { "Cancel" }); } BMXZQYModel model = this.xzqyManager.GetModel(bM); if (model != null) { return(new object[] { model }); } this.log.Info("获取行政区域失败:"); return(new object[] { "Error: 获取行政区域失败" }); }
public string ModifyDistrict(BMXZQYModel xzqEntity, string OldBM) { try { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary.Add("oldBM", OldBM); dictionary.Add("BM", xzqEntity.BM); dictionary.Add("MC", xzqEntity.MC); if (this.baseDAO.未确认DAO方法2_疑似updateSQL("aisino.Fwkp.Bmgl.BMXZQY.XZQYModify", dictionary) > 0) { return("0"); } return("e31"); } catch (Exception exception) { if (!exception.Message.Contains("UNIQUE constraint failed")) { throw; } return("e1"); } }
public string AddDistrict(BMXZQYModel xzqEntity) { return(this.AddDistrictKP(xzqEntity, 0)); }
public ImportResult ImportDistrict(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>(); this.TuiJianBM(""); for (int i = index; i < strArray.Length; i++) { string lineText = strArray[i].Trim(); if (((lineText.Length != 0) && !lineText.StartsWith("//")) && lineText.Contains(str)) { string[] strArray2 = GetSafeData.Split(lineText, str); if (strArray2.Length < 3) { throw new CustomException("文本首行指定的分隔符与实际分隔符不一致,\n格式不正确等原因导致不能导入此文件!"); } string str5 = ""; string str6 = ""; ResultType none = ResultType.None; BMXZQYModel xzqEntity = new BMXZQYModel { BM = strArray2[0], MC = strArray2[1] }; if (this.bmkhDAL.ExistDistrict(xzqEntity)) { if (str5.Length == 0) { str5 = "重复"; result.Duplicated++; } if (str6.Length == 0) { str6 = "编码重复"; none = ResultType.Duplicated; } else { str6 = str6 + "且编码重复"; none = ResultType.Invalid; } } else if (this.bmkhDAL.AddDistrict(xzqEntity) == "0") { str5 = "正确传入"; result.Correct++; none = ResultType.Correct; } else { str5 = "失败"; result.Failed++; none = ResultType.Failed; } result.DtResult.Rows.Add(new object[] { xzqEntity.BM, xzqEntity.MC, str5, str6 }); stack.Push(new lastBMJG(xzqEntity.BM, none)); } } result.ImportTable = "XZQBM"; result2 = result; } catch { throw; } return(result2); }
private void LoadData(string BM) { this.khModel = this.khlogical.GetModel(BM); this.textBoxBM.Text = this.khModel.BM; this.textBoxWaitMC.Text = this.khModel.MC; }