コード例 #1
0
        public string AddCustomer(BMKHModel customer)
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary.Add("BM", customer.BM);
            dictionary.Add("MC", customer.MC);
            dictionary.Add("JM", customer.JM);
            dictionary.Add("KJM", customer.KJM);
            dictionary.Add("SH", customer.SH);
            dictionary.Add("DZDH", customer.DZDH);
            dictionary.Add("YHZH", customer.YHZH);
            dictionary.Add("YJDZ", customer.YJDZ);
            dictionary.Add("BZ", customer.BZ);
            dictionary.Add("YSKM", customer.YSKM);
            dictionary.Add("DQBM", customer.DQBM);
            dictionary.Add("DQMC", customer.DQMC);
            dictionary.Add("DQKM", customer.DQKM);
            dictionary.Add("SJBM", customer.SJBM);
            dictionary.Add("WJ", customer.WJ);
            dictionary.Add("SFZJY", customer.SFZJY);
            if (this.baseDAO.未确认DAO方法2_疑似updateSQL("aisino.Fwkp.Bmgl.BMKH.KHAdd", dictionary) > 0)
            {
                return("0");
            }
            return("e02");
        }
コード例 #2
0
        public BMBaseModel GetModel(string BM)
        {
            DataTable kH    = this.bmkhDAL.GetKH(BM);
            BMKHModel model = new BMKHModel();

            if (kH.Rows.Count > 0)
            {
                DataRow row = kH.Rows[0];
                model.BM    = GetSafeData.ValidateValue <string>(row, "BM");
                model.MC    = GetSafeData.ValidateValue <string>(row, "MC");
                model.JM    = GetSafeData.ValidateValue <string>(row, "JM");
                model.KJM   = GetSafeData.ValidateValue <string>(row, "KJM");
                model.SH    = GetSafeData.ValidateValue <string>(row, "SH");
                model.DZDH  = GetSafeData.ValidateValue <string>(row, "DZDH");
                model.YHZH  = GetSafeData.ValidateValue <string>(row, "YHZH");
                model.YJDZ  = GetSafeData.ValidateValue <string>(row, "YJDZ");
                model.BZ    = GetSafeData.ValidateValue <string>(row, "BZ");
                model.YSKM  = GetSafeData.ValidateValue <string>(row, "YSKM");
                model.DQBM  = GetSafeData.ValidateValue <string>(row, "DQBM");
                model.DQMC  = GetSafeData.ValidateValue <string>(row, "DQMC");
                model.DQKM  = GetSafeData.ValidateValue <string>(row, "DQKM");
                model.SJBM  = GetSafeData.ValidateValue <string>(row, "SJBM");
                model.SFZJY = GetSafeData.ValidateValue <bool>(row, "SFZJY");
            }
            return(model);
        }
コード例 #3
0
        public string ModifyCustomer(BMKHModel customer, string OldBM)
        {
            string str = this.CheckCustomer(customer);

            if (str != "0")
            {
                return(str);
            }
            if ((customer.WJ == 1) && (customer.SH.Length != 0))
            {
                string str2 = this.jyCustomer.CheckTaxCode(customer.SH, 0);
                if (str2 != "0000")
                {
                    MessageManager.ShowMsgBox(str2, new string[] { "税号" });
                    return(str2);
                }
            }
            if ((customer.BM != OldBM) && this.bmkhDAL.ExistCustomer(customer))
            {
                MessageManager.ShowMsgBox("INP-235108");
                return("编码已存在");
            }
            if (this.bmkhDAL.ExistCusMC(OldBM, customer.MC, customer.SJBM))
            {
                MessageManager.ShowMsgBox("INP-235130");
                return("客户已存在");
            }
            return(this.bmkhDAL.ModifyCustomer(customer, OldBM));
        }
コード例 #4
0
        public string AutoNodeLogic()
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary.Add("MC", "自动保存");
            dictionary.Add("SJBM", "");
            DataTable table = this.baseDAO.querySQLDataTable("aisino.Fwkp.Bmgl.BMKH.KHMCExist", dictionary);
            int       count = table.Rows.Count;

            if ((count == 0) && (this.TuiJianBM("") != "NoNode"))
            {
                string    str      = this.TuiJianBM("");
                BMKHModel customer = new BMKHModel {
                    BM   = str,
                    MC   = "自动保存",
                    SJBM = "",
                    WJ   = 0
                };
                if ("0" == this.AddCustomer(customer))
                {
                    return(customer.BM);
                }
            }
            if (1 == count)
            {
                return(table.Rows[0]["BM"].ToString());
            }
            return("");
        }
コード例 #5
0
        public string AddCustomerKP(BMKHModel customer, int Addtype)
        {
            string str = this.CheckCustomer(customer);

            if (str == "0")
            {
                if ((customer.WJ == 1) && (customer.SH.Length != 0))
                {
                    string str2 = this.jyCustomer.CheckTaxCode(customer.SH, 0);
                    if (str2 != "0000")
                    {
                        MessageManager.ShowMsgBox(str2, new string[] { "税号" });
                        return(str2);
                    }
                }
                if (this.bmkhDAL.ExistCusMC(customer.BM, customer.MC, customer.SJBM))
                {
                    MessageManager.ShowMsgBox("INP-235130");
                    return("客户已存在");
                }
                if (this.bmkhDAL.ExistCustomer(customer))
                {
                    MessageManager.ShowMsgBox("INP-235108");
                    return("编码已存在");
                }
                str = this.bmkhDAL.AddCustomer(customer);
                if ((Addtype == 1) && (str == "0"))
                {
                    MessageManager.ShowMsgBox("INP-235201");
                }
            }
            return(str);
        }
コード例 #6
0
 public BMKH_Edit()
 {
     this.khlogical      = new BMKHManager();
     this.invoiceHandler = new InvoiceHandler();
     this.khModel        = new BMKHModel();
     this.Initialize();
 }
コード例 #7
0
        public bool ExistCustomer(BMKHModel customer)
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary.Add("bm", customer.BM);
            return(this.baseDAO.queryValueSQL <int>("aisino.Fwkp.Bmgl.BMKH.KHExist", dictionary) > 0);
        }
コード例 #8
0
 public BMKH_Edit(string SJBM, BMKH Father) : base(SJBM, Father)
 {
     this.khlogical      = new BMKHManager();
     this.invoiceHandler = new InvoiceHandler();
     this.khModel        = new BMKHModel();
     this.Initialize();
     this.InitData();
 }
コード例 #9
0
 public BMKH_Edit(string BM, bool Isupdate) : base(BM, Isupdate)
 {
     this.khlogical      = new BMKHManager();
     this.invoiceHandler = new InvoiceHandler();
     this.khModel        = new BMKHModel();
     this.Initialize();
     this.InitData();
 }
コード例 #10
0
 private void LoadData(string BM)
 {
     this.khModel            = (BMKHModel)this.khlogical.GetModel(BM);
     this.textBoxBM.Text     = this.khModel.BM;
     this.textBoxWaitMC.Text = this.khModel.MC;
     this.textBoxSJBM.Text   = this.khModel.SJBM;
     this.textBoxJM.Text     = this.khModel.JM;
 }
コード例 #11
0
        protected override object[] doService(object[] param)
        {
            BMKHModel model;

            if (!CheckPermission.Check("KH"))
            {
                return(null);
            }
            if (param.Length < 4)
            {
                throw new ArgumentException("参数错误,至少有4个参数");
            }
            string str  = (param[0] as string).Trim();
            string str2 = (param[1] as string).Trim();

            if (str.Length == 0)
            {
                return(new object[] { "Cancel" });
            }
            string sJBM = "";

            sJBM  = this.khmanager.AutoNodeLogic();
            model = new BMKHModel {
                SJBM = sJBM,
                MC   = str,
                SH   = str2,
                DZDH = param[2] as string,
                YHZH = param[3] as string,
            };
            model.BM = this.khmanager.TuiJianBM(model.SJBM);
            if (model.SJBM == "NoNode")
            {
                this.log.Info("自动新增客户失败,“自动保存”上级编码已满");
                MessageBoxHelper.Show("自动保存上级编码已满,请增位后再添加!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(new object[] { "FAIL" });
            }
            if (model.BM.Length > 0x10)
            {
                this.log.Info("自动新增客户失败,“自动保存”节点下空位不足");
                return(new object[] { "FAIL" });
            }
            if (model.BM == "NoNode")
            {
                this.log.Info("自动新增客户失败,“自动保存”该级编码已满");
                MessageBoxHelper.Show("自动保存该级编码已满,请增位后再添加!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(new object[] { "FAIL" });
            }
            model.KJM = CommonFunc.GenerateKJM(model.MC);
            model.WJ  = 1;
            if (this.khmanager.AddCustomerToAuto(model, sJBM))
            {
                return(new object[] { "OK" });
            }
            this.log.Info("自动新增客户失败");
            return(new object[] { "FAIL" });
        }
コード例 #12
0
        public string UpdateSubNodesSJBM(BMKHModel customer, string YuanBM)
        {
            string str = this.CheckCustomer(customer);

            if (str != "0")
            {
                return(str);
            }
            return(this.bmkhDAL.UpdateSubNodesSJBM(customer, YuanBM));
        }
コード例 #13
0
 public BMKHFenLei(string SJBM, BMKH Father)
 {
     this.khlogical = new BLL.BMKHManager();
     this.khModel   = new BMKHModel();
     this.bm        = "";
     this.yuanBM    = "";
     this._sjbm     = "";
     this.SuggestBM = "";
     this.Initialize();
     this._sjbm  = SJBM;
     this.father = Father;
     this.Text   = "客户分类编码添加";
 }
コード例 #14
0
 public BMKHFenLei(string BM, bool Isupdate)
 {
     this.khlogical = new BLL.BMKHManager();
     this.khModel   = new BMKHModel();
     this.bm        = "";
     this.yuanBM    = "";
     this._sjbm     = "";
     this.SuggestBM = "";
     this.Initialize();
     this.bm       = BM;
     this.yuanBM   = BM;
     this.isUpdate = Isupdate;
     this.Text     = "客户分类编码编辑";
 }
コード例 #15
0
 public string CheckCustomer(BMKHModel customer)
 {
     if (customer == null)
     {
         return("e11");
     }
     if ((customer.BM == null) || (customer.BM.Length == 0))
     {
         return("e12");
     }
     if ((customer.MC != null) && (customer.MC.Length != 0))
     {
         return("0");
     }
     return("e13");
 }
コード例 #16
0
 protected override void LoadData(string BM)
 {
     base.LoadData(BM);
     this.khModel                   = (BMKHModel)base.baseModel;
     this.textBoxBZ.Text            = this.khModel.BZ;
     this.textBoxDQMC.Text          = this.khModel.DQMC;
     this.textBoxDZDH.Text          = this.khModel.DZDH;
     this.textBoxSH.Text            = this.khModel.SH;
     this.textBoxYHZH.Text          = this.khModel.YHZH;
     this.textBoxDQBM.Text          = this.khModel.DQBM;
     this.textBoxDQKM.Text          = this.khModel.DQKM;
     this.textBoxYJDZ.Text          = this.khModel.YJDZ;
     this.textBoxYSKM.Text          = this.khModel.YSKM;
     this.comboBoxID.SelectedIndex  = this.khModel.SFZJY ? 0 : 1;
     this.comboBoxKJM.DropDownStyle = ComboBoxStyle.Simple;
     this.comboBoxKJM.Text          = this.khModel.KJM;
 }
コード例 #17
0
 public bool AddCustomerToAuto(BMKHModel customer, string SJBM)
 {
     try
     {
         if (this.bmkhDAL.QueryByMCSH(customer.MC, customer.SH).Rows.Count > 0)
         {
             return(false);
         }
         if (customer.SH.Length != 0)
         {
             DataTable table2 = this.bmkhDAL.QueryBySHAndSJBM(customer.SH, SJBM);
             if ((table2.Rows.Count > 0) && (customer.MC.Trim() == table2.Rows[0]["MC"].ToString().Trim()))
             {
                 customer.BM = table2.Rows[0]["BM"].ToString();
                 this.bmkhDAL.ModifyCustomer(customer, table2.Rows[0]["BM"].ToString());
                 return(true);
             }
         }
         else
         {
             DataTable table3 = this.bmkhDAL.QueryByMCAndSJBMAndSHEmpty(customer.MC, SJBM);
             if (table3.Rows.Count > 0)
             {
                 customer.BM = table3.Rows[0]["BM"].ToString();
                 this.bmkhDAL.ModifyCustomer(customer, table3.Rows[0]["BM"].ToString());
                 return(true);
             }
         }
         this.bmkhDAL.AddCustomer(customer);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
コード例 #18
0
 public string ModifyCustomer(BMKHModel customer, string OldBM)
 {
     try
     {
         Dictionary <string, object> dictionary = new Dictionary <string, object>();
         dictionary.Add("oldBM", OldBM);
         dictionary.Add("BM", customer.BM);
         dictionary.Add("MC", customer.MC);
         dictionary.Add("JM", customer.JM);
         dictionary.Add("KJM", customer.KJM);
         dictionary.Add("SH", customer.SH);
         dictionary.Add("DZDH", customer.DZDH);
         dictionary.Add("YHZH", customer.YHZH);
         dictionary.Add("YJDZ", customer.YJDZ);
         dictionary.Add("BZ", customer.BZ);
         dictionary.Add("YSKM", customer.YSKM);
         dictionary.Add("DQBM", customer.DQBM);
         dictionary.Add("DQMC", customer.DQMC);
         dictionary.Add("DQKM", customer.DQKM);
         dictionary.Add("SJBM", customer.SJBM);
         dictionary.Add("SFZJY", customer.SFZJY);
         if (this.baseDAO.未确认DAO方法2_疑似updateSQL("aisino.Fwkp.Bmgl.BMKH.KHModify", dictionary) > 0)
         {
             return("0");
         }
         return("e31");
     }
     catch (Exception exception)
     {
         if (!exception.Message.Contains("UNIQUE constraint failed"))
         {
             throw;
         }
         return("e1");
     }
 }
コード例 #19
0
 public string AddCustomer(BMKHModel customer)
 {
     return(this.AddCustomerKP(customer, 0));
 }
コード例 #20
0
        public ImportResult ImportData(string codeFile)
        {
            ImportResult result2;

            try
            {
                string[] array = File.ReadAllLines(codeFile, ToolUtil.GetEncoding());
                if (array.Length == 0)
                {
                    throw new CustomException("此文件没有内容");
                }
                string str   = "";
                int    index = 0;
                bool   flag  = true;
                while (flag)
                {
                    if (array[index].StartsWith("{客户编码}"))
                    {
                        string str2 = array[index];
                        if (!str2.Contains("\""))
                        {
                            throw new CustomException("此文件首行客户编码没有指定分隔符,分隔符使用双引号标注");
                        }
                        str  = str2.Substring(str2.IndexOf("\"")).Trim().Trim(new char[] { '"' });
                        flag = false;
                        index++;
                    }
                    else
                    {
                        index++;
                        if (index == array.Length)
                        {
                            throw new CustomException("此文件不符合客户编码文本格式");
                        }
                    }
                }
                if (TaxCardFactory.CreateTaxCard().SoftVersion == "FWKP_V2.0_Svr_Client")
                {
                    Array.Sort <string>(array, index, array.Length - index);
                }
                ImportResult     result = new ImportResult();
                Stack <lastBMJG> stack  = new Stack <lastBMJG>();
                string           str4   = this.TuiJianBM("");
                string           str5   = "";
                bool             flag2  = false;
                for (int i = index; i < array.Length; i++)
                {
                    string lineText = array[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格式不正确等原因导致不能导入此文件!");
                    }
                    BMKHModel customer = new BMKHModel {
                        BM = strArray2[0],
                        MC = strArray2[1],
                        JM = strArray2[2]
                    };
                    string     str7 = "";
                    string     str8 = "";
                    ResultType none = ResultType.None;
                    customer.KJM = CommonFunc.GenerateKJM(customer.MC);
                    if (strArray2.Length > 3)
                    {
                        if (strArray2.Length < 7)
                        {
                            continue;
                        }
                        customer.SH = strArray2[3].ToUpper();
                        customer.WJ = 1;
                        string str9 = "";
                        if (str == "~~")
                        {
                            str9 = strArray2[4].Replace(",", "\r\n").Replace("#|#", "\r\n");
                        }
                        else if (str == " ")
                        {
                            str9 = strArray2[4].Replace("#|#", "\r\n");
                        }
                        else
                        {
                            str9 = strArray2[4];
                        }
                        customer.DZDH = str9;
                        string str10 = "";
                        if (str == "~~")
                        {
                            str10 = strArray2[5].Replace(",", "\r\n").Replace("#|#", "\r\n");
                        }
                        else if (str == " ")
                        {
                            str10 = strArray2[5].Replace("#|#", "\r\n");
                        }
                        else
                        {
                            str10 = strArray2[5];
                        }
                        customer.YHZH = str10;
                        customer.YJDZ = strArray2[6];
                        customer.BZ   = strArray2[7];
                    }
                    while (stack.Count > 0)
                    {
                        flag2 = false;
                        if (customer.BM.Length > stack.Peek().BM.Length)
                        {
                            if (!customer.BM.StartsWith(stack.Peek().BM))
                            {
                                goto Label_03EA;
                            }
                            customer.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_03EA;
                                }
                                str5 = this.TuiJianBM(stack.Peek().BM);
                                if (customer.BM.Length == str5.Length)
                                {
                                    goto Label_03EA;
                                }
                                str7 = "无效";
                                str8 = "编码长度必须与原有同级编码长度一致";
                                result.Invalid++;
                                none = ResultType.Invalid;
                            }
                            goto Label_068B;
                        }
                        stack.Pop();
                    }
                    flag2 = true;
Label_03EA:
                    if ((flag2 && (str4 != "001")) && (customer.BM.Length != str4.Length))
                    {
                        str7 = "无效";
                        str8 = "编码长度必须与原有同级编码长度一致";
                        result.Invalid++;
                        none = ResultType.Invalid;
                    }
                    else if ("0" != this.CheckCustomer(customer))
                    {
                        str7 = "无效";
                        str8 = "编码或名称为空";
                        result.Invalid++;
                        none = ResultType.Invalid;
                    }
                    else if (!Regex.IsMatch(customer.BM, "^[0-9a-z]{1,16}$"))
                    {
                        str7 = "无效";
                        str8 = "编码需小于16位,且仅由数字和小写字母组成";
                        result.Invalid++;
                        none = ResultType.Invalid;
                    }
                    else if (this.bmkhDAL.ExistCustomer(customer))
                    {
                        if (str7.Length == 0)
                        {
                            str7 = "重复";
                            result.Duplicated++;
                        }
                        if (str8.Length == 0)
                        {
                            str8 = "编码重复";
                            none = ResultType.Duplicated;
                        }
                        else
                        {
                            str8 = str8 + "且编码重复";
                            none = ResultType.Invalid;
                        }
                    }
                    else if (((customer.SH != null) && (customer.SH.Length != 0)) && (((customer.SH.Length < 6) || (customer.SH.Length > 20)) || (((customer.WJ == 1) && (customer.SH.Length != 0)) && ("0000" != this.jyCustomer.CheckTaxCode(customer.SH, 0)))))
                    {
                        str7 = "失败";
                        str8 = "客户税号错误" + customer.SH;
                        result.Failed++;
                        none = ResultType.Failed;
                    }
                    else if (this.bmkhDAL.ExistCusMC(customer.BM, customer.MC, customer.SJBM))
                    {
                        str7 = "失败";
                        str8 = "客户名称与其同级单位名称重复" + customer.SH;
                        result.Failed++;
                        none = ResultType.Failed;
                    }
                    else
                    {
                        foreach (string str11 in StringUtils.GetSpellCode(customer.MC))
                        {
                            customer.KJM = customer.KJM + str11;
                        }
                        if (this.bmkhDAL.AddCustomer(customer) == "0")
                        {
                            str7 = "正确传入";
                            result.Correct++;
                            none = ResultType.Correct;
                        }
                        else
                        {
                            str7 = "失败";
                            result.Failed++;
                            none = ResultType.Failed;
                        }
                    }
                    Label_068B :;
                    result.DtResult.Rows.Add(new object[] { customer.BM, customer.MC, str7, str8 });
                    stack.Push(new lastBMJG(customer.BM, none));
                }
                result.ImportTable = "客户编码.DB";
                result2            = result;
            }
            catch
            {
                throw;
            }
            return(result2);
        }
コード例 #21
0
        private void ReFirstNodes(string tableName, DataTable topNodeTable, int maxLenOfTopNodes, bool padFlag)
        {
            try
            {
                int num3;
                int num    = 0;
                int result = 0;
                switch (tableName)
                {
                case "BM_KH":
                    num    = 0;
                    result = 0;
                    foreach (DataRow row in topNodeTable.Rows)
                    {
                        BMKHModel   customer = new BMKHModel();
                        BMKHManager manager  = new BMKHManager();
                        customer.SJBM = GetSafeData.ValidateValue <string>(row, "SJBM");
                        string s = GetSafeData.ValidateValue <string>(row, "BM");
                        if (padFlag)
                        {
                            customer.BM = s.PadLeft(maxLenOfTopNodes, '0');
                        }
                        else
                        {
                            int num4 = num + 1;
                            customer.BM = customer.SJBM + num4.ToString().PadLeft(topNodeTable.Rows.Count.ToString().Length + 2, '0');
                        }
                        customer.MC    = GetSafeData.ValidateValue <string>(row, "MC");
                        customer.JM    = GetSafeData.ValidateValue <string>(row, "JM");
                        customer.KJM   = GetSafeData.ValidateValue <string>(row, "KJM");
                        customer.SH    = GetSafeData.ValidateValue <string>(row, "SH");
                        customer.DZDH  = GetSafeData.ValidateValue <string>(row, "DZDH");
                        customer.YHZH  = GetSafeData.ValidateValue <string>(row, "YHZH");
                        customer.YJDZ  = GetSafeData.ValidateValue <string>(row, "YJDZ");
                        customer.BZ    = GetSafeData.ValidateValue <string>(row, "BZ");
                        customer.YSKM  = GetSafeData.ValidateValue <string>(row, "YSKM");
                        customer.DQBM  = GetSafeData.ValidateValue <string>(row, "DQBM");
                        customer.DQMC  = GetSafeData.ValidateValue <string>(row, "DQMC");
                        customer.DQKM  = GetSafeData.ValidateValue <string>(row, "DQKM");
                        customer.SFZJY = GetSafeData.ValidateValue <bool>(row, "SFZJY");
                        customer.WJ    = GetSafeData.ValidateValue <int>(row, "WJ");
                        if (!int.TryParse(s, out result))
                        {
                            result++;
                        }
                        for (string str2 = manager.UpdateSubNodesSJBM(customer, s); "e1" == str2; str2 = manager.UpdateSubNodesSJBM(customer, s))
                        {
                            if (padFlag)
                            {
                                result++;
                                customer.BM = result.ToString().PadLeft(maxLenOfTopNodes, '0');
                            }
                            else
                            {
                                num++;
                                int num6 = num + 1;
                                customer.BM = customer.SJBM + num6.ToString().PadLeft(topNodeTable.Rows.Count.ToString().Length + 2, '0');
                            }
                        }
                        num++;
                    }
                    return;

                case "BM_SP":
                    num    = 0;
                    result = 0;
                    foreach (DataRow row2 in topNodeTable.Rows)
                    {
                        BMSPModel   merchandise = new BMSPModel();
                        BMSPManager manager2    = new BMSPManager();
                        merchandise.SJBM = GetSafeData.ValidateValue <string>(row2, "SJBM");
                        string str3 = GetSafeData.ValidateValue <string>(row2, "BM");
                        if (padFlag)
                        {
                            merchandise.BM = str3.PadLeft(maxLenOfTopNodes, '0');
                        }
                        else
                        {
                            int num8 = num + 1;
                            merchandise.BM = merchandise.SJBM + num8.ToString().PadLeft(topNodeTable.Rows.Count.ToString().Length + 2, '0');
                        }
                        merchandise.MC      = GetSafeData.ValidateValue <string>(row2, "MC");
                        merchandise.JM      = GetSafeData.ValidateValue <string>(row2, "JM");
                        merchandise.KJM     = GetSafeData.ValidateValue <string>(row2, "KJM");
                        merchandise.SLV     = GetSafeData.ValidateValue <double>(row2, "SLV");
                        merchandise.SPSM    = GetSafeData.ValidateValue <string>(row2, "SPSM");
                        merchandise.GGXH    = GetSafeData.ValidateValue <string>(row2, "GGXH");
                        merchandise.JLDW    = GetSafeData.ValidateValue <string>(row2, "JLDW");
                        merchandise.DJ      = GetSafeData.ValidateValue <double>(row2, "DJ");
                        merchandise.HSJBZ   = GetSafeData.ValidateValue <bool>(row2, "HSJBZ");
                        merchandise.XSSRKM  = GetSafeData.ValidateValue <string>(row2, "XSSRKM");
                        merchandise.YJZZSKM = GetSafeData.ValidateValue <string>(row2, "YJZZSKM");
                        merchandise.XSTHKM  = GetSafeData.ValidateValue <string>(row2, "XSTHKM");
                        merchandise.HYSY    = GetSafeData.ValidateValue <bool>(row2, "HYSY");
                        merchandise.XTHASH  = GetSafeData.ValidateValue <string>(row2, "XTHASH");
                        merchandise.XTCODE  = GetSafeData.ValidateValue <string>(row2, "XTCODE");
                        merchandise.ISHIDE  = GetSafeData.ValidateValue <string>(row2, "ISHIDE");
                        merchandise.WJ      = GetSafeData.ValidateValue <int>(row2, "WJ");
                        if (!int.TryParse(str3, out result))
                        {
                            result++;
                        }
                        for (string str4 = manager2.UpdateSubNodesSJBM(merchandise, str3); "e1" == str4; str4 = manager2.UpdateSubNodesSJBM(merchandise, str3))
                        {
                            if (padFlag)
                            {
                                result++;
                                merchandise.BM = result.ToString().PadLeft(maxLenOfTopNodes, '0');
                            }
                            else
                            {
                                num++;
                                int num10 = num + 1;
                                merchandise.BM = merchandise.SJBM + num10.ToString().PadLeft(topNodeTable.Rows.Count.ToString().Length + 2, '0');
                            }
                        }
                        num++;
                    }
                    return;

                case "BM_SFHR":
                    num    = 0;
                    result = 0;
                    foreach (DataRow row3 in topNodeTable.Rows)
                    {
                        BMSFHRModel   model3   = new BMSFHRModel();
                        BMSFHRManager manager3 = new BMSFHRManager();
                        model3.SJBM = GetSafeData.ValidateValue <string>(row3, "SJBM");
                        string str5 = GetSafeData.ValidateValue <string>(row3, "BM");
                        if (padFlag)
                        {
                            model3.BM = str5.PadLeft(maxLenOfTopNodes, '0');
                        }
                        else
                        {
                            int num12 = num + 1;
                            model3.BM = model3.SJBM + num12.ToString().PadLeft(topNodeTable.Rows.Count.ToString().Length + 2, '0');
                        }
                        model3.MC   = GetSafeData.ValidateValue <string>(row3, "MC");
                        model3.JM   = GetSafeData.ValidateValue <string>(row3, "JM");
                        model3.SH   = GetSafeData.ValidateValue <string>(row3, "SH");
                        model3.DZDH = GetSafeData.ValidateValue <string>(row3, "DZDH");
                        model3.YHZH = GetSafeData.ValidateValue <string>(row3, "YHZH");
                        model3.YZBM = GetSafeData.ValidateValue <string>(row3, "YZBM");
                        model3.WJ   = GetSafeData.ValidateValue <int>(row3, "WJ");
                        if (!int.TryParse(str5, out result))
                        {
                            result++;
                        }
                        for (string str6 = manager3.UpdateSubNodesSJBM(model3, str5); "e1" == str6; str6 = manager3.UpdateSubNodesSJBM(model3, str5))
                        {
                            if (padFlag)
                            {
                                result++;
                                model3.BM = result.ToString().PadLeft(maxLenOfTopNodes, '0');
                            }
                            else
                            {
                                num++;
                                int num14 = num + 1;
                                model3.BM = model3.SJBM + num14.ToString().PadLeft(topNodeTable.Rows.Count.ToString().Length + 2, '0');
                            }
                        }
                        num++;
                    }
                    return;

                case "BM_FYXM":
                    num    = 0;
                    result = 0;
                    foreach (DataRow row4 in topNodeTable.Rows)
                    {
                        BMFYXMModel   feiyong  = new BMFYXMModel();
                        BMFYXMManager manager4 = new BMFYXMManager();
                        feiyong.SJBM = GetSafeData.ValidateValue <string>(row4, "SJBM");
                        string str7 = GetSafeData.ValidateValue <string>(row4, "BM");
                        if (padFlag)
                        {
                            feiyong.BM = str7.PadLeft(maxLenOfTopNodes, '0');
                        }
                        else
                        {
                            int num16 = num + 1;
                            feiyong.BM = feiyong.SJBM + num16.ToString().PadLeft(topNodeTable.Rows.Count.ToString().Length + 2, '0');
                        }
                        feiyong.MC = GetSafeData.ValidateValue <string>(row4, "MC");
                        feiyong.JM = GetSafeData.ValidateValue <string>(row4, "JM");
                        feiyong.WJ = GetSafeData.ValidateValue <int>(row4, "WJ");
                        if (!int.TryParse(str7, out result))
                        {
                            result++;
                        }
                        for (string str8 = manager4.UpdateSubNodesSJBM(feiyong, str7); "e1" == str8; str8 = manager4.UpdateSubNodesSJBM(feiyong, str7))
                        {
                            if (padFlag)
                            {
                                result++;
                                feiyong.BM = result.ToString().PadLeft(maxLenOfTopNodes, '0');
                            }
                            else
                            {
                                num++;
                                int num18 = num + 1;
                                feiyong.BM = feiyong.SJBM + num18.ToString().PadLeft(topNodeTable.Rows.Count.ToString().Length + 2, '0');
                            }
                        }
                        num++;
                    }
                    return;

                case "BM_GHDW":
                    num    = 0;
                    result = 0;
                    foreach (DataRow row5 in topNodeTable.Rows)
                    {
                        BMGHDWModel   purchase = new BMGHDWModel();
                        BMGHDWManager manager5 = new BMGHDWManager();
                        purchase.SJBM = GetSafeData.ValidateValue <string>(row5, "SJBM");
                        string str9 = GetSafeData.ValidateValue <string>(row5, "BM");
                        if (padFlag)
                        {
                            purchase.BM = str9.PadLeft(maxLenOfTopNodes, '0');
                        }
                        else
                        {
                            num3        = num + 1;
                            purchase.BM = purchase.SJBM + num3.ToString().PadLeft(topNodeTable.Rows.Count.ToString().Length + 2, '0');
                        }
                        purchase.MC    = GetSafeData.ValidateValue <string>(row5, "MC");
                        purchase.JM    = GetSafeData.ValidateValue <string>(row5, "JM");
                        purchase.SH    = GetSafeData.ValidateValue <string>(row5, "SH");
                        purchase.DZDH  = GetSafeData.ValidateValue <string>(row5, "DZDH");
                        purchase.YHZH  = GetSafeData.ValidateValue <string>(row5, "YHZH");
                        purchase.IDCOC = GetSafeData.ValidateValue <string>(row5, "IDCOC");
                        purchase.WJ    = GetSafeData.ValidateValue <int>(row5, "WJ");
                        if (!int.TryParse(str9, out result))
                        {
                            result++;
                        }
                        for (string str10 = manager5.UpdateSubNodesSJBM(purchase, str9); "e1" == str10; str10 = manager5.UpdateSubNodesSJBM(purchase, str9))
                        {
                            if (padFlag)
                            {
                                result++;
                                purchase.BM = result.ToString().PadLeft(maxLenOfTopNodes, '0');
                            }
                            else
                            {
                                num++;
                                num3        = num + 1;
                                purchase.BM = purchase.SJBM + num3.ToString().PadLeft(topNodeTable.Rows.Count.ToString().Length + 2, '0');
                            }
                        }
                        num++;
                    }
                    return;

                case "BM_CL":
                    num    = 0;
                    result = 0;
                    foreach (DataRow row6 in topNodeTable.Rows)
                    {
                        BMCLModel   car      = new BMCLModel();
                        BMCLManager manager6 = new BMCLManager();
                        car.SJBM = GetSafeData.ValidateValue <string>(row6, "SJBM");
                        string str11 = GetSafeData.ValidateValue <string>(row6, "BM");
                        if (padFlag)
                        {
                            car.BM = str11.PadLeft(maxLenOfTopNodes, '0');
                        }
                        else
                        {
                            num3   = num + 1;
                            car.BM = car.SJBM + num3.ToString().PadLeft(topNodeTable.Rows.Count.ToString().Length + 2, '0');
                        }
                        car.MC     = GetSafeData.ValidateValue <string>(row6, "MC");
                        car.JM     = GetSafeData.ValidateValue <string>(row6, "JM");
                        car.CPXH   = GetSafeData.ValidateValue <string>(row6, "CPXH");
                        car.CD     = GetSafeData.ValidateValue <string>(row6, "CD");
                        car.SCCJMC = GetSafeData.ValidateValue <string>(row6, "SCCJMC");
                        car.WJ     = GetSafeData.ValidateValue <int>(row6, "WJ");
                        if (!int.TryParse(str11, out result))
                        {
                            result++;
                        }
                        for (string str12 = manager6.UpdateSubNodesSJBM(car, str11); "e1" == str12; str12 = manager6.UpdateSubNodesSJBM(car, str11))
                        {
                            if (padFlag)
                            {
                                result++;
                                car.BM = result.ToString().PadLeft(maxLenOfTopNodes, '0');
                            }
                            else
                            {
                                num++;
                                num3   = num + 1;
                                car.BM = car.SJBM + num3.ToString().PadLeft(topNodeTable.Rows.Count.ToString().Length + 2, '0');
                            }
                        }
                        num++;
                    }
                    return;

                case "BM_XHDW":
                    break;

                default:
                    return;
                }
                num    = 0;
                result = 0;
                foreach (DataRow row7 in topNodeTable.Rows)
                {
                    BMXHDWModel   model7   = new BMXHDWModel();
                    BMXHDWManager manager7 = new BMXHDWManager();
                    model7.SJBM = GetSafeData.ValidateValue <string>(row7, "SJBM");
                    string str13 = GetSafeData.ValidateValue <string>(row7, "BM");
                    if (padFlag)
                    {
                        model7.BM = str13.PadLeft(maxLenOfTopNodes, '0');
                    }
                    else
                    {
                        num3      = num + 1;
                        model7.BM = model7.SJBM + num3.ToString().PadLeft(topNodeTable.Rows.Count.ToString().Length + 2, '0');
                    }
                    model7.MC   = GetSafeData.ValidateValue <string>(row7, "MC");
                    model7.JM   = GetSafeData.ValidateValue <string>(row7, "JM");
                    model7.SH   = GetSafeData.ValidateValue <string>(row7, "SH");
                    model7.DZDH = GetSafeData.ValidateValue <string>(row7, "DZDH");
                    model7.YHZH = GetSafeData.ValidateValue <string>(row7, "YHZH");
                    model7.YZBM = GetSafeData.ValidateValue <string>(row7, "YZBM");
                    model7.WJ   = GetSafeData.ValidateValue <int>(row7, "WJ");
                    if (!int.TryParse(str13, out result))
                    {
                        result++;
                    }
                    for (string str14 = manager7.UpdateSubNodesSJBM(model7, str13); "e1" == str14; str14 = manager7.UpdateSubNodesSJBM(model7, str13))
                    {
                        if (padFlag)
                        {
                            result++;
                            model7.BM = result.ToString().PadLeft(maxLenOfTopNodes, '0');
                        }
                        else
                        {
                            num++;
                            num3      = num + 1;
                            model7.BM = model7.SJBM + num3.ToString().PadLeft(topNodeTable.Rows.Count.ToString().Length + 2, '0');
                        }
                    }
                    num++;
                }
            }
            catch (Exception)
            {
            }
        }
コード例 #22
0
        private void ReNode(string tableName, string SJBM)
        {
            try
            {
                int       num;
                DataRow   row2;
                DataRow   row3;
                DataRow   row4;
                DataRow   row5;
                DataRow   row6;
                DataRow   row7;
                DataRow   row8;
                DataRow[] rowArray = this.baseDAO.querySQLDataTable("SELECT * FROM " + tableName).Select("SJBM = '" + SJBM + "'");
                bool      flag     = false;
                foreach (DataRow row in rowArray)
                {
                    if (GetSafeData.ValidateValue <string>(row, "BM").Length > 0x10)
                    {
                        flag = true;
                        break;
                    }
                }
                if (!flag)
                {
                    goto Label_0CE4;
                }
                switch (tableName)
                {
                case "BM_KH":
                    num = 0;
                    num = 0;
                    goto Label_0322;

                case "BM_SP":
                    num = 0;
                    num = 0;
                    goto Label_056E;

                case "BM_SFHR":
                    num = 0;
                    num = 0;
                    goto Label_06FC;

                case "BM_FYXM":
                    num = 0;
                    num = 0;
                    goto Label_083E;

                case "BM_GHDW":
                    num = 0;
                    num = 0;
                    goto Label_09CC;

                case "BM_CL":
                    num = 0;
                    num = 0;
                    goto Label_0B47;

                case "BM_XHDW":
                    num = 0;
                    num = 0;
                    goto Label_0CD5;

                default:
                    return;
                }
Label_0129:
                row2 = rowArray[num];
                BMKHModel   customer = new BMKHModel();
                BMKHManager manager  = new BMKHManager();
                string      yuanBM   = GetSafeData.ValidateValue <string>(row2, "BM");
                int         num4     = num + 1;
                int         length   = rowArray.Length;
                customer.BM    = SJBM + num4.ToString().PadLeft(length.ToString().Length + 1, '0');
                customer.MC    = GetSafeData.ValidateValue <string>(row2, "MC");
                customer.JM    = GetSafeData.ValidateValue <string>(row2, "JM");
                customer.KJM   = GetSafeData.ValidateValue <string>(row2, "KJM");
                customer.SH    = GetSafeData.ValidateValue <string>(row2, "SH");
                customer.DZDH  = GetSafeData.ValidateValue <string>(row2, "DZDH");
                customer.YHZH  = GetSafeData.ValidateValue <string>(row2, "YHZH");
                customer.YJDZ  = GetSafeData.ValidateValue <string>(row2, "YJDZ");
                customer.BZ    = GetSafeData.ValidateValue <string>(row2, "BZ");
                customer.YSKM  = GetSafeData.ValidateValue <string>(row2, "YSKM");
                customer.DQBM  = GetSafeData.ValidateValue <string>(row2, "DQBM");
                customer.DQMC  = GetSafeData.ValidateValue <string>(row2, "DQMC");
                customer.DQKM  = GetSafeData.ValidateValue <string>(row2, "DQKM");
                customer.SJBM  = GetSafeData.ValidateValue <string>(row2, "SJBM");
                customer.SFZJY = GetSafeData.ValidateValue <bool>(row2, "SFZJY");
                customer.WJ    = GetSafeData.ValidateValue <int>(row2, "WJ");
                string str3 = manager.UpdateSubNodesSJBM(customer, yuanBM);
                while ("e1" == str3)
                {
                    num++;
                    int num6 = num + 1;
                    int num7 = rowArray.Length;
                    customer.BM = SJBM + num6.ToString().PadLeft(num7.ToString().Length + 1, '0');
                    str3        = manager.UpdateSubNodesSJBM(customer, yuanBM);
                }
                if ("0" == str3)
                {
                    this.ReNode(tableName, customer.BM);
                }
                num++;
Label_0322:
                if (num < rowArray.Length)
                {
                    goto Label_0129;
                }
                return;

Label_033C:
                row3 = rowArray[num];
                BMSPModel   merchandise = new BMSPModel();
                BMSPManager manager2    = new BMSPManager();
                string      str4        = GetSafeData.ValidateValue <string>(row3, "BM");
                int         num8        = num + 1;
                int         num9        = rowArray.Length;
                merchandise.BM      = SJBM + num8.ToString().PadLeft(num9.ToString().Length + 1, '0');
                merchandise.MC      = GetSafeData.ValidateValue <string>(row3, "MC");
                merchandise.JM      = GetSafeData.ValidateValue <string>(row3, "JM");
                merchandise.KJM     = GetSafeData.ValidateValue <string>(row3, "KJM");
                merchandise.SJBM    = GetSafeData.ValidateValue <string>(row3, "SJBM");
                merchandise.SLV     = GetSafeData.ValidateValue <double>(row3, "SLV");
                merchandise.SPSM    = GetSafeData.ValidateValue <string>(row3, "SPSM");
                merchandise.GGXH    = GetSafeData.ValidateValue <string>(row3, "GGXH");
                merchandise.JLDW    = GetSafeData.ValidateValue <string>(row3, "JLDW");
                merchandise.DJ      = GetSafeData.ValidateValue <double>(row3, "DJ");
                merchandise.HSJBZ   = GetSafeData.ValidateValue <bool>(row3, "HSJBZ");
                merchandise.XSSRKM  = GetSafeData.ValidateValue <string>(row3, "XSSRKM");
                merchandise.YJZZSKM = GetSafeData.ValidateValue <string>(row3, "YJZZSKM");
                merchandise.XSTHKM  = GetSafeData.ValidateValue <string>(row3, "XSTHKM");
                merchandise.HYSY    = GetSafeData.ValidateValue <bool>(row3, "HYSY");
                merchandise.XTHASH  = GetSafeData.ValidateValue <string>(row3, "XTHASH");
                merchandise.XTCODE  = GetSafeData.ValidateValue <string>(row3, "XTCODE");
                merchandise.ISHIDE  = GetSafeData.ValidateValue <string>(row3, "ISHIDE");
                merchandise.WJ      = GetSafeData.ValidateValue <int>(row3, "WJ");
                string str5 = manager2.UpdateSubNodesSJBM(merchandise, str4);
                while ("e1" == str5)
                {
                    num++;
                    int num10 = num + 1;
                    int num11 = rowArray.Length;
                    merchandise.BM = SJBM + num10.ToString().PadLeft(num11.ToString().Length + 1, '0');
                    str5           = manager2.UpdateSubNodesSJBM(merchandise, str4);
                }
                if ("0" == str5)
                {
                    this.ReNode(tableName, merchandise.BM);
                }
                num++;
Label_056E:
                if (num < rowArray.Length)
                {
                    goto Label_033C;
                }
                return;

Label_0588:
                row4 = rowArray[num];
                BMSFHRModel   model3   = new BMSFHRModel();
                BMSFHRManager manager3 = new BMSFHRManager();
                string        str6     = GetSafeData.ValidateValue <string>(row4, "BM");
                int           num12    = num + 1;
                int           num13    = rowArray.Length;
                model3.BM   = SJBM + num12.ToString().PadLeft(num13.ToString().Length + 1, '0');
                model3.MC   = GetSafeData.ValidateValue <string>(row4, "MC");
                model3.JM   = GetSafeData.ValidateValue <string>(row4, "JM");
                model3.SJBM = GetSafeData.ValidateValue <string>(row4, "SJBM");
                model3.SH   = GetSafeData.ValidateValue <string>(row4, "SH");
                model3.DZDH = GetSafeData.ValidateValue <string>(row4, "DZDH");
                model3.YHZH = GetSafeData.ValidateValue <string>(row4, "YHZH");
                model3.YZBM = GetSafeData.ValidateValue <string>(row4, "YZBM");
                model3.WJ   = GetSafeData.ValidateValue <int>(row4, "WJ");
                string str7 = manager3.UpdateSubNodesSJBM(model3, str6);
                while ("e1" == str7)
                {
                    num++;
                    int num14 = num + 1;
                    int num15 = rowArray.Length;
                    model3.BM = SJBM + num14.ToString().PadLeft(num15.ToString().Length + 1, '0');
                    str7      = manager3.UpdateSubNodesSJBM(model3, str6);
                }
                if ("0" == str7)
                {
                    this.ReNode(tableName, model3.BM);
                }
                num++;
Label_06FC:
                if (num < rowArray.Length)
                {
                    goto Label_0588;
                }
                return;

Label_0716:
                row5 = rowArray[num];
                BMFYXMModel   feiyong  = new BMFYXMModel();
                BMFYXMManager manager4 = new BMFYXMManager();
                string        str8     = GetSafeData.ValidateValue <string>(row5, "BM");
                int           num16    = num + 1;
                int           num3     = rowArray.Length;
                feiyong.BM   = SJBM + num16.ToString().PadLeft(num3.ToString().Length + 1, '0');
                feiyong.MC   = GetSafeData.ValidateValue <string>(row5, "MC");
                feiyong.JM   = GetSafeData.ValidateValue <string>(row5, "JM");
                feiyong.SJBM = GetSafeData.ValidateValue <string>(row5, "SJBM");
                feiyong.WJ   = GetSafeData.ValidateValue <int>(row5, "WJ");
                string str9 = manager4.UpdateSubNodesSJBM(feiyong, str8);
                while ("e1" == str9)
                {
                    num++;
                    num3 = num + 1;
                    num3 = rowArray.Length;
                    string introduced65 = num3.ToString();
                    feiyong.BM = SJBM + introduced65.PadLeft(num3.ToString().Length + 1, '0');
                    str9       = manager4.UpdateSubNodesSJBM(feiyong, str8);
                }
                if ("0" == str9)
                {
                    this.ReNode(tableName, feiyong.BM);
                }
                num++;
Label_083E:
                if (num < rowArray.Length)
                {
                    goto Label_0716;
                }
                return;

Label_0858:
                row6 = rowArray[num];
                BMGHDWModel   purchase = new BMGHDWModel();
                BMGHDWManager manager5 = new BMGHDWManager();
                string        str10    = GetSafeData.ValidateValue <string>(row6, "BM");
                num3 = num + 1;
                num3 = rowArray.Length;
                string introduced66 = num3.ToString();
                purchase.BM    = SJBM + introduced66.PadLeft(num3.ToString().Length + 1, '0');
                purchase.MC    = GetSafeData.ValidateValue <string>(row6, "MC");
                purchase.JM    = GetSafeData.ValidateValue <string>(row6, "JM");
                purchase.SH    = GetSafeData.ValidateValue <string>(row6, "SH");
                purchase.DZDH  = GetSafeData.ValidateValue <string>(row6, "DZDH");
                purchase.YHZH  = GetSafeData.ValidateValue <string>(row6, "YHZH");
                purchase.IDCOC = GetSafeData.ValidateValue <string>(row6, "IDCOC");
                purchase.SJBM  = GetSafeData.ValidateValue <string>(row6, "SJBM");
                purchase.WJ    = GetSafeData.ValidateValue <int>(row6, "WJ");
                string str11 = manager5.UpdateSubNodesSJBM(purchase, str10);
                while ("e1" == str11)
                {
                    num++;
                    num3 = num + 1;
                    num3 = rowArray.Length;
                    string introduced67 = num3.ToString();
                    purchase.BM = SJBM + introduced67.PadLeft(num3.ToString().Length + 1, '0');
                    str11       = manager5.UpdateSubNodesSJBM(purchase, str10);
                }
                if ("0" == str11)
                {
                    this.ReNode(tableName, purchase.BM);
                }
                num++;
Label_09CC:
                if (num < rowArray.Length)
                {
                    goto Label_0858;
                }
                return;

Label_09E6:
                row7 = rowArray[num];
                BMCLModel   car      = new BMCLModel();
                BMCLManager manager6 = new BMCLManager();
                string      str12    = GetSafeData.ValidateValue <string>(row7, "BM");
                num3 = num + 1;
                num3 = rowArray.Length;
                string introduced68 = num3.ToString();
                car.BM     = SJBM + introduced68.PadLeft(num3.ToString().Length + 1, '0');
                car.MC     = GetSafeData.ValidateValue <string>(row7, "MC");
                car.JM     = GetSafeData.ValidateValue <string>(row7, "JM");
                car.SJBM   = GetSafeData.ValidateValue <string>(row7, "SJBM");
                car.CPXH   = GetSafeData.ValidateValue <string>(row7, "CPXH");
                car.CD     = GetSafeData.ValidateValue <string>(row7, "CD");
                car.SCCJMC = GetSafeData.ValidateValue <string>(row7, "SCCJMC");
                car.WJ     = GetSafeData.ValidateValue <int>(row7, "WJ");
                string str13 = manager6.UpdateSubNodesSJBM(car, str12);
                while ("e1" == str13)
                {
                    num++;
                    num3 = num + 1;
                    num3 = rowArray.Length;
                    string introduced69 = num3.ToString();
                    car.BM = SJBM + introduced69.PadLeft(num3.ToString().Length + 1, '0');
                    str13  = manager6.UpdateSubNodesSJBM(car, str12);
                }
                if ("0" == str13)
                {
                    this.ReNode(tableName, car.BM);
                }
                num++;
Label_0B47:
                if (num < rowArray.Length)
                {
                    goto Label_09E6;
                }
                return;

Label_0B61:
                row8 = rowArray[num];
                BMXHDWModel   model7   = new BMXHDWModel();
                BMXHDWManager manager7 = new BMXHDWManager();
                string        str14    = GetSafeData.ValidateValue <string>(row8, "BM");
                num3 = num + 1;
                num3 = rowArray.Length;
                string introduced70 = num3.ToString();
                model7.BM   = SJBM + introduced70.PadLeft(num3.ToString().Length + 1, '0');
                model7.MC   = GetSafeData.ValidateValue <string>(row8, "MC");
                model7.JM   = GetSafeData.ValidateValue <string>(row8, "JM");
                model7.SJBM = GetSafeData.ValidateValue <string>(row8, "SJBM");
                model7.SH   = GetSafeData.ValidateValue <string>(row8, "SH");
                model7.DZDH = GetSafeData.ValidateValue <string>(row8, "DZDH");
                model7.YHZH = GetSafeData.ValidateValue <string>(row8, "YHZH");
                model7.YZBM = GetSafeData.ValidateValue <string>(row8, "YZBM");
                model7.WJ   = GetSafeData.ValidateValue <int>(row8, "WJ");
                string str15 = manager7.UpdateSubNodesSJBM(model7, str14);
                while ("e1" == str15)
                {
                    num++;
                    num3 = num + 1;
                    num3 = rowArray.Length;
                    string introduced71 = num3.ToString();
                    model7.BM = SJBM + introduced71.PadLeft(num3.ToString().Length + 1, '0');
                    str15     = manager7.UpdateSubNodesSJBM(model7, str14);
                }
                if ("0" == str15)
                {
                    this.ReNode(tableName, model7.BM);
                }
                num++;
Label_0CD5:
                if (num < rowArray.Length)
                {
                    goto Label_0B61;
                }
                return;

                Label_0CE4 :;
                foreach (DataRow row9 in this.baseDAO.querySQLDataTable("SELECT * FROM " + tableName + " WHERE SJBM ='" + SJBM + "'").Rows)
                {
                    string sJBM = GetSafeData.ValidateValue <string>(row9, "BM");
                    this.ReNode(tableName, sJBM);
                }
            }
            catch (Exception)
            {
            }
        }
コード例 #23
0
ファイル: AddKH.cs プロジェクト: hkloudou/HX-Base
        protected override object[] doService(object[] param)
        {
            BMKHModel model;

            if (!CheckPermission.Check("KH"))
            {
                return(null);
            }
            if (param.Length < 4)
            {
                throw new ArgumentException("参数错误,至少有4个参数");
            }
            string mC   = (param[0] as string).Trim();
            string str2 = (param[1] as string).Trim();

            if (mC.Length == 0)
            {
                MessageBoxHelper.Show("请输入客户名称", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(new object[] { "Cancel" });
            }
            string str3 = "";
            string sJBM = "";

            switch (MessageBoxHelper.Show("是否有上级单位?", "输入确认", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question))
            {
            case DialogResult.Cancel:
                return(new object[] { "Cancel" });

            case DialogResult.Yes:
            {
                BMKHSelect select = new BMKHSelect();
                if (select.ShowDialog() != DialogResult.OK)
                {
                    return(new object[] { str3 });
                }
                sJBM = select.SelectedSJBM;
                break;
            }
            }
            if (this.khmanager.QueryByMCAndSJBM(mC, sJBM).Rows.Count > 0)
            {
                MessageBoxHelper.Show("新增客户名称与其同级单位名称重复!", "输入错误", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return(new object[] { "Error" });
            }
            model = new BMKHModel {
                SJBM = sJBM,
                MC   = mC,
                SH   = str2,
                DZDH = param[2] as string,
                YHZH = param[3] as string,
            };
            model.BM = this.khmanager.TuiJianBM(model.SJBM);
            if (model.BM == "NoNode")
            {
                this.log.Info("新增客户失败,该级编码已满");
                MessageBoxHelper.Show("该级编码已满,请增位后再添加!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(new object[] { "FAIL" });
            }
            string[] spellCode = StringUtils.GetSpellCode(model.MC);
            if (spellCode.Length > 1)
            {
                StringBuilder builder = new StringBuilder();
                for (int i = 0; i < spellCode.Length; i++)
                {
                    builder.Append(spellCode[i]);
                }
                model.KJM = builder.ToString();
            }
            else
            {
                model.KJM = spellCode[0];
            }
            model.WJ = 1;
            str3     = this.khmanager.AddCustomerKP(model, 1);
            if (str3 == "0")
            {
                str3 = "OK";
                return(new object[] { str3 });
            }
            this.log.Info("新增客户失败:" + str3);
            return(new object[] { "Error:", str3 });
        }
コード例 #24
0
        public string UpdateSubNodesSJBM(BMKHModel customer, string YuanBM)
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary.Add("bm", YuanBM);
            dictionary.Add("bmLike", YuanBM + "%");
            DataTable     table = this.baseDAO.querySQLDataTable("aisino.Fwkp.Bmgl.BMKH.KHBMGetSubNode", 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", customer.BM);
                item.Add("MC", customer.MC);
                item.Add("JM", customer.JM);
                item.Add("KJM", customer.KJM);
                item.Add("SH", customer.SH);
                item.Add("DZDH", customer.DZDH);
                item.Add("YHZH", customer.YHZH);
                item.Add("YJDZ", customer.YJDZ);
                item.Add("BZ", customer.BZ);
                item.Add("YSKM", customer.YSKM);
                item.Add("DQBM", customer.DQBM);
                item.Add("DQMC", customer.DQMC);
                item.Add("DQKM", customer.DQKM);
                item.Add("SJBM", customer.SJBM);
                item.Add("SFZJY", customer.SFZJY);
                list.Add("aisino.Fwkp.Bmgl.BMKH.KHBMModify");
                list2.Add(item);
                if (table.Rows.Count > 0)
                {
                    for (int i = 0; i < table.Rows.Count; i++)
                    {
                        string str  = table.Rows[i]["BM"].ToString();
                        string str2 = table.Rows[i]["SJBM"].ToString();
                        string str3 = customer.BM + str.Substring(YuanBM.Length);
                        string str4 = customer.BM + str2.Substring(YuanBM.Length);
                        Dictionary <string, object> dictionary3 = new Dictionary <string, object>();
                        dictionary3.Add("bm", str);
                        dictionary3.Add("newBM", str3);
                        dictionary3.Add("newSJBM", str4);
                        list.Add("aisino.Fwkp.Bmgl.BMKH.KHBMUpdateSJBMandBM");
                        list2.Add(dictionary3);
                    }
                }
                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");
            }
        }