public string ModifyGoodsTax(BMSPSMModel spsmEntity, string OldSZ, string OldBM) { try { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary.Add("oldBM", OldBM); dictionary.Add("oldSZ", OldSZ); dictionary.Add("SZ", spsmEntity.SZ); dictionary.Add("BM", spsmEntity.BM); dictionary.Add("MC", spsmEntity.MC); dictionary.Add("SLV", spsmEntity.SLV); dictionary.Add("ZSL", spsmEntity.ZSL); dictionary.Add("SLJS", spsmEntity.SLJS); dictionary.Add("JSDW", spsmEntity.JSDW); dictionary.Add("SE", spsmEntity.SE); dictionary.Add("MDXS", spsmEntity.MDXS); dictionary.Add("FHDBZ", spsmEntity.FHDBZ); if (this.baseDAO.未确认DAO方法2_疑似updateSQL("aisino.Fwkp.Bmgl.BMSPSM.SPSMModify", dictionary) > 0) { return("0"); } return("e31"); } catch (Exception exception) { if (!exception.Message.Contains("UNIQUE constraint failed")) { throw; } return("e1"); } }
public BMSPSMModel GetModel(string BM, string SZ = "") { DataTable bMSPSM = this.bmkhDAL.GetBMSPSM(BM, SZ); BMSPSMModel model = new BMSPSMModel(); if (bMSPSM.Rows.Count > 0) { DataRow row = bMSPSM.Rows[0]; string str = string.Empty; str = GetSafeData.ValidateValue <string>(row, "SZ"); model.SZ = (str == null) ? "" : str; str = GetSafeData.ValidateValue <string>(row, "MC"); model.MC = (str == null) ? "" : str; str = GetSafeData.ValidateValue <string>(row, "BM"); model.BM = (str == null) ? "" : str; model.SLV = GetSafeData.ValidateValue <double>(row, "SLV"); model.ZSL = GetSafeData.ValidateValue <double>(row, "ZSL"); model.SLJS = GetSafeData.ValidateValue <byte>(row, "SLJS"); str = GetSafeData.ValidateValue <string>(row, "JSDW"); model.JSDW = (str == null) ? "" : str; model.SE = GetSafeData.ValidateValue <double>(row, "SE"); model.FHDBZ = GetSafeData.ValidateValue <bool>(row, "FHDBZ"); model.MDXS = GetSafeData.ValidateValue <double>(row, "MDXS"); } return(model); }
public bool ExistGoodsTax(BMSPSMModel spsmEntity) { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary.Add("bm", spsmEntity.BM); dictionary.Add("sz", spsmEntity.SZ); return(this.baseDAO.queryValueSQL <int>("aisino.Fwkp.Bmgl.BMSPSM.SPSMExist", dictionary) > 0); }
public string ModifyGoodsTax(BMSPSMModel spsmEntity, string OldSZ, string OldBM) { string str = this.CheckGoodsTax(spsmEntity); if (str != "0") { return(str); } return(this.bmkhDAL.ModifyGoodsTax(spsmEntity, OldSZ, OldBM)); }
public string UpdateSubNodesSJBM(BMSPSMModel spsmEntity, string YuanBM) { string str = this.CheckGoodsTax(spsmEntity); if (str != "0") { return(str); } return(this.bmkhDAL.UpdateSubNodesSJBM(spsmEntity, YuanBM)); }
public BMSPSM_Edit(string SJBM, BMSPSM Father) { this.khlogical = new BMSPSMManager(); this.spsmModel = new BMSPSMModel(); this.log = LogUtil.GetLogger <BMSPSM_Edit>(); this._bm = ""; this._sjbm = ""; this.SuggestBM = ""; this.Initialize(); this._sjbm = SJBM; this.father = Father; this.Text = "税目编码添加"; }
public BMSPSMFenLei(string SJBM, BMSPSM Father) { this.khlogical = new BMSPSMManager(); this.khModel = new BMSPSMModel(); this.bm = ""; this.yuanBM = ""; this.yuanSZ = ""; this._sjbm = ""; this.SuggestBM = ""; this.Initialize(); this._sjbm = SJBM; this.father = Father; this.Text = "客户分类编码添加"; }
public BMSPSM_Edit(string SZ, string BM, bool Isupdate) { this.khlogical = new BMSPSMManager(); this.spsmModel = new BMSPSMModel(); this.log = LogUtil.GetLogger <BMSPSM_Edit>(); this._bm = ""; this._sjbm = ""; this.SuggestBM = ""; this.Initialize(); this._bm = BM; this.yuanBM = BM; this.yuanSZ = SZ; this.isUpdate = Isupdate; this.Text = "税目编码编辑"; }
public string CheckGoodsTax(BMSPSMModel spsmEntity) { if (spsmEntity == null) { return("e11"); } if ((spsmEntity.BM == null) || (spsmEntity.BM.Length == 0)) { return("e12"); } if ((spsmEntity.MC != null) && (spsmEntity.MC.Length != 0)) { return("0"); } return("e13"); }
public BMSPSMFenLei(string SZ, string BM, bool Isupdate) { this.khlogical = new BMSPSMManager(); this.khModel = new BMSPSMModel(); this.bm = ""; this.yuanBM = ""; this.yuanSZ = ""; this._sjbm = ""; this.SuggestBM = ""; this.Initialize(); this.bm = BM; this.yuanBM = BM; this.yuanSZ = SZ; this.isUpdate = Isupdate; this.Text = "客户分类编码编辑"; }
public string AddGoodsTaxKP(BMSPSMModel spsmEntity, int Addtype) { string str = this.CheckGoodsTax(spsmEntity); if (str == "0") { if (this.bmkhDAL.ExistGoodsTax(spsmEntity)) { MessageManager.ShowMsgBox("INP-235108"); return("编码已存在"); } str = this.bmkhDAL.AddGoodsTax(spsmEntity); if ((Addtype == 1) && (str == "0")) { MessageManager.ShowMsgBox("INP-235201"); } } return(str); }
private void LoadData(string SZ, string BM) { this.spsmModel = this.khlogical.GetModel(BM, SZ); this.yuanSZ = this.spsmModel.SZ.ToString(); this.yuanBM = this.spsmModel.BM.ToString(); this.textBox_SZ.Text = this.spsmModel.SZ.ToString(); this.textBox_MC.Text = this.spsmModel.MC; this.textBox_BM.Text = this.spsmModel.BM; this.comboBox_SLV.Text = this.spsmModel.SLV.ToString(); if ("0.00" == this.spsmModel.SLV.ToString("f2")) { this.comboBox_SLV.Text = "免税"; } else { this.comboBox_SLV.Text = this.spsmModel.SLV.ToString("#%"); } this.comboBox_FHDBZ.SelectedIndex = !this.spsmModel.FHDBZ ? 0 : 1; this.comboBox_ZSL.Text = this.spsmModel.ZSL.ToString(); }
public string AddGoodsTax(BMSPSMModel spsmEntity) { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary.Add("SZ", spsmEntity.SZ); dictionary.Add("BM", spsmEntity.BM); dictionary.Add("MC", spsmEntity.MC); dictionary.Add("SLV", spsmEntity.SLV); dictionary.Add("ZSL", spsmEntity.ZSL); dictionary.Add("SLJS", spsmEntity.SLJS); dictionary.Add("JSDW", spsmEntity.JSDW); dictionary.Add("SE", spsmEntity.SE); dictionary.Add("MDXS", spsmEntity.MDXS); dictionary.Add("FHDBZ", spsmEntity.FHDBZ); if (this.baseDAO.未确认DAO方法2_疑似updateSQL("aisino.Fwkp.Bmgl.BMSPSM.SPSMAdd", dictionary) > 0) { return("0"); } return("e02"); }
public string UpdateSubNodesSJBM(BMSPSMModel spsmEntity, string YuanBM) { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary.Add("bm", YuanBM); dictionary.Add("bmLike", YuanBM + "%"); this.baseDAO.querySQLDataTable("aisino.Fwkp.Bmgl.BMSPSM.SPSMBMGetSubNode", 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("SZ", spsmEntity.SZ); item.Add("BM", spsmEntity.BM); item.Add("MC", spsmEntity.MC); item.Add("SLV", spsmEntity.SLV); item.Add("ZSL", spsmEntity.ZSL); item.Add("SLJS", spsmEntity.SLJS); item.Add("JSDW", spsmEntity.JSDW); item.Add("SE", spsmEntity.SE); item.Add("FHDBZ", spsmEntity.FHDBZ); item.Add("MDXS", spsmEntity.MDXS); list.Add("aisino.Fwkp.Bmgl.BMSPSM.SPSMBMModify"); 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 < 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" }); } BMSPSMModel model = this.spsmManager.GetModel(bM, ""); if (model != null) { return(new object[] { model }); } this.log.Info("获取商品税目失败:"); return(new object[] { "Error:获取商品税目失败" }); }
protected override object[] doService(object[] param) { if (param.Length < 8) { throw new ArgumentException("参数错误,至少有8个参数"); } string oldSZ = param[0] as string; string oldBM = param[1] as string; string str3 = (param[2] as string).Trim(); string str4 = (param[3] as string).Trim(); string str5 = (param[4] as string).Trim(); string s = (param[5] as string).Trim(); string str7 = (param[6] as string).Trim(); string str8 = (param[7] as string).Trim(); string str9 = ""; string str10 = ""; string str11 = ""; string str12 = ""; if (param.Length > 8) { str9 = (param[8] as string).Trim(); } if (param.Length > 9) { str10 = (param[9] as string).Trim(); } if (param.Length > 10) { str11 = (param[10] as string).Trim(); } if (param.Length > 11) { str12 = (param[11] as string).Trim(); } if (str3.Length == 0) { MessageBoxHelper.Show("请输入税种名称", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(new object[] { "Cancel" }); } if (str4.Length == 0) { MessageBoxHelper.Show("请输入商品税目编码", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(new object[] { "Cancel" }); } if (str5.Length == 0) { MessageBoxHelper.Show("请输入商品税目名称", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(new object[] { "Cancel" }); } if (s.Length == 0) { MessageBoxHelper.Show("请输入商品税目税率", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(new object[] { "Cancel" }); } BMSPSMModel spsmEntity = new BMSPSMModel { SZ = str3, MC = str5, BM = str4, SLV = double.Parse(s), ZSL = double.Parse(str7), SLJS = byte.Parse(str8), JSDW = str9, SE = double.Parse(str10), MDXS = double.Parse(str11), FHDBZ = bool.Parse(str12) }; string str13 = this.spsmManager.ModifyGoodsTax(spsmEntity, oldSZ, oldBM); if (str13 == "0") { str13 = "OK"; return(new object[] { str13 }); } this.log.Info("新增商品税目失败:" + str13); return(new object[] { "Error:", str13 }); }
public string AddGoodsTax(BMSPSMModel spsmEntity) { return(this.AddGoodsTaxKP(spsmEntity, 0)); }
public ImportResult ImportGoodsTax(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; BMSPSMModel spsmEntity = new BMSPSMModel { SZ = strArray2[0], BM = strArray2[1], MC = strArray2[2] }; double num3 = 0.0; if (!double.TryParse(strArray2[3], out num3)) { throw new CustomException(string.Format("第{0}行数据格式不正确", i)); } spsmEntity.SLV = num3; if (!double.TryParse(strArray2[4], out num3)) { throw new CustomException(string.Format("第{0}行数据格式不正确", i)); } spsmEntity.ZSL = num3; spsmEntity.SLJS = (strArray2[5] == "false") ? byte.Parse("0") : byte.Parse("1"); spsmEntity.JSDW = strArray2[6]; double num4 = 0.0; if (!double.TryParse(strArray2[7], out num4)) { throw new CustomException(string.Format("第{0}行数据格式不正确", i)); } spsmEntity.SE = num4; bool flag3 = false; if (!bool.TryParse(strArray2[8], out flag3)) { throw new CustomException(string.Format("第{0}行数据格式不正确", i)); } spsmEntity.FHDBZ = flag3; if (this.bmkhDAL.ExistGoodsTax(spsmEntity)) { 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.AddGoodsTax(spsmEntity) == "0") { str5 = "正确传入"; result.Correct++; none = ResultType.Correct; } else { str5 = "失败"; result.Failed++; none = ResultType.Failed; } result.DtResult.Rows.Add(new object[] { spsmEntity.BM, spsmEntity.MC, str5, str6 }); stack.Push(new lastBMJG(spsmEntity.BM, none)); } } result.ImportTable = "SPSMBM.DB"; result2 = result; } catch { throw; } return(result2); }
protected override object[] doService(object[] param) { if (param.Length < 6) { throw new ArgumentException("参数错误,至少有6个参数"); } string str = (param[0] as string).Trim(); string str2 = (param[1] as string).Trim(); string str3 = (param[2] as string).Trim(); string s = (param[3] as string).Trim(); string str5 = (param[4] as string).Trim(); string str6 = (param[5] as string).Trim(); string str7 = ""; string str8 = ""; string str9 = ""; string str10 = ""; if (param.Length > 6) { str7 = (param[6] as string).Trim(); } if (param.Length > 7) { str8 = (param[7] as string).Trim(); } if (param.Length > 8) { str9 = (param[8] as string).Trim(); } if (param.Length > 9) { str10 = (param[9] as string).Trim(); } if (str.Length == 0) { MessageBoxHelper.Show("请输入税种名称", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(new object[] { "Cancel" }); } 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" }); } if (s.Length == 0) { MessageBoxHelper.Show("请输入商品税目税率", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(new object[] { "Cancel" }); } BMSPSMModel spsmEntity = new BMSPSMModel { SZ = str, MC = str3, BM = str2, SLV = double.Parse(s), ZSL = double.Parse(str5), SLJS = byte.Parse(str6), JSDW = str7, SE = double.Parse(str8), MDXS = double.Parse(str9), FHDBZ = bool.Parse(str10) }; string str11 = this.spsmManager.AddGoodsTaxKP(spsmEntity, 1); if (str11 == "0") { str11 = "OK"; return(new object[] { str11 }); } this.log.Info("新增商品税目失败:" + str11); return(new object[] { "Error:", str11 }); }
private void LoadData(string BM) { this.khModel = this.khlogical.GetModel(BM, ""); this.textBoxBM.Text = this.khModel.BM; this.textBoxWaitMC.Text = this.khModel.MC; }