Пример #1
0
        public bool ExistExpense(BMFYXMModel feiyong)
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary.Add("bm", feiyong.BM);
            return(this.baseDAO.queryValueSQL <int>("aisino.Fwkp.Bmgl.BMFYXM.FYXMExist", dictionary) > 0);
        }
Пример #2
0
 public string ModifyExpense(BMFYXMModel feiyong, string OldBM)
 {
     try
     {
         Dictionary <string, object> dictionary = new Dictionary <string, object>();
         dictionary.Add("oldBM", OldBM);
         dictionary.Add("BM", feiyong.BM);
         dictionary.Add("MC", feiyong.MC);
         dictionary.Add("SJBM", feiyong.SJBM);
         dictionary.Add("KJM", feiyong.KJM);
         dictionary.Add("JM", feiyong.JM);
         dictionary.Add("SPFL", feiyong.SPFL);
         dictionary.Add("YHZC", feiyong.YHZC);
         dictionary.Add("SPFLMC", feiyong.SPFLMC);
         dictionary.Add("YHZCMC", feiyong.YHZCMC);
         if (this.baseDAO.未确认DAO方法2_疑似updateSQL("aisino.Fwkp.Bmgl.BMFYXM.FYXMModify", dictionary) > 0)
         {
             return("0");
         }
         return("e31");
     }
     catch (Exception exception)
     {
         if (!exception.Message.Contains("UNIQUE constraint failed"))
         {
             throw;
         }
         return("e1");
     }
 }
Пример #3
0
 private void LoadData(string BM)
 {
     this.fyxmModel          = (BMFYXMModel)this.fyxmlogical.GetModel(BM);
     this.textBoxBM.Text     = this.fyxmModel.BM;
     this.textBoxWaitMC.Text = this.fyxmModel.MC;
     this.textBoxSJBM.Text   = this.fyxmModel.SJBM;
     this.textBoxJM.Text     = this.fyxmModel.JM;
     if (Flbm.IsYM())
     {
         this.comBoxSPFL.Text            = this.fyxmModel.SPFL;
         this.SPFLMC.Text                = this.fyxmModel.SPFLMC;
         this.comboBoxYHZC.SelectedIndex = ("是" == this.fyxmModel.YHZC) ? 0 : 1;
         if (this.comboBoxYHZCMC.Enabled)
         {
             try
             {
                 this.comboBoxYHZCMC.Text = this.fyxmModel.YHZCMC.ToString();
             }
             catch
             {
                 if (!this.comboBoxYHZCMC.Items.Contains(""))
                 {
                     this.comboBoxYHZCMC.Items.Add("");
                     this.comboBoxYHZCMC.Text = "";
                 }
             }
         }
     }
 }
Пример #4
0
 private void LoadData(string BM)
 {
     this.fyxmModel          = (BMFYXMModel)this.fyxmlogical.GetModel(BM);
     this.textBoxBM.Text     = this.fyxmModel.BM;
     this.textBoxWaitMC.Text = this.fyxmModel.MC;
     this.textBoxSJBM.Text   = this.fyxmModel.SJBM;
     this.textBoxJM.Text     = this.fyxmModel.JM;
 }
Пример #5
0
        public string UpdateSubNodesSJBM(BMFYXMModel feiyong, string YuanBM)
        {
            string str = this.CheckExpense(feiyong);

            if (str != "0")
            {
                return(str);
            }
            return(this.bmfyxmDAL.UpdateSubNodesSJBM(feiyong, YuanBM));
        }
Пример #6
0
 public BMFYXMFenLei(string SJBM, BMFYXM Father)
 {
     this.fyxmlogical = new BLL.BMFYXMManager();
     this.fyxmModel   = new BMFYXMModel();
     this.bm          = "";
     this.yuanBM      = "";
     this._sjbm       = "";
     this.SuggestBM   = "";
     this.Initialize();
     this._sjbm  = SJBM;
     this.father = Father;
     this.Text   = "费用项目分类编码添加";
 }
Пример #7
0
        public string UpdateSubNodesSJBM(BMFYXMModel feiyong, 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.BMFYXM.FYXMBMGetSubNode", 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", feiyong.BM);
                item.Add("MC", feiyong.MC);
                item.Add("SJBM", feiyong.SJBM);
                item.Add("JM", feiyong.JM);
                list.Add("aisino.Fwkp.Bmgl.BMFYXM.FYXMBMModify");
                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 = feiyong.BM + str.Substring(YuanBM.Length);
                        string str4 = feiyong.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.BMFYXM.FYXMBMUpdateSJBMandBM");
                        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");
            }
        }
Пример #8
0
 public BMFYXMFenLei(string BM, bool Isupdate)
 {
     this.fyxmlogical = new BLL.BMFYXMManager();
     this.fyxmModel   = new BMFYXMModel();
     this.bm          = "";
     this.yuanBM      = "";
     this._sjbm       = "";
     this.SuggestBM   = "";
     this.Initialize();
     this.bm       = BM;
     this.yuanBM   = BM;
     this.isUpdate = Isupdate;
     this.Text     = "费用项目分类编码编辑";
 }
Пример #9
0
        public string ModifyExpense(BMFYXMModel feiyong, string OldBM)
        {
            string str = this.CheckExpense(feiyong);

            if (str != "0")
            {
                return(str);
            }
            if (TaxCardFactory.CreateTaxCard().QYLX.ISHY&& this.bmfyxmDAL.ExistCusMC(OldBM, feiyong.MC, feiyong.SJBM))
            {
                MessageManager.ShowMsgBox("INP-235136");
                return("费用项目已存在");
            }
            return(this.bmfyxmDAL.ModifyExpense(feiyong, OldBM));
        }
Пример #10
0
 public string CheckExpense(BMFYXMModel feiyong)
 {
     if (feiyong == null)
     {
         return("e11");
     }
     if ((feiyong.BM == null) || (feiyong.BM.Length == 0))
     {
         return("e12");
     }
     if ((feiyong.MC != null) && (feiyong.MC.Length != 0))
     {
         return("0");
     }
     return("e13");
 }
Пример #11
0
 public BMFYXM_Edit(string SJBM, BMFYXM Father)
 {
     this.fyxmlogical = new BLL.BMFYXMManager();
     this.fyxmModel   = new BMFYXMModel();
     this.log         = LogUtil.GetLogger <BMFYXM_Edit>();
     this._bm         = "";
     this._sjbm       = "";
     this.SuggestBM   = "";
     this.SuggestMC   = string.Empty;
     this.retCode     = string.Empty;
     this.SucDialog   = true;
     this.Initialize();
     this._sjbm  = SJBM;
     this.father = Father;
     this.Text   = "费用项目编码添加";
 }
Пример #12
0
        public BMBaseModel GetModel(string BM)
        {
            DataTable   fYXM  = this.bmfyxmDAL.GetFYXM(BM);
            BMFYXMModel model = new BMFYXMModel();

            if (fYXM.Rows.Count > 0)
            {
                DataRow row = fYXM.Rows[0];
                model.BM     = GetSafeData.ValidateValue <string>(row, "BM");
                model.MC     = GetSafeData.ValidateValue <string>(row, "MC");
                model.JM     = GetSafeData.ValidateValue <string>(row, "JM");
                model.SJBM   = GetSafeData.ValidateValue <string>(row, "SJBM");
                model.SPFL   = GetSafeData.ValidateValue <string>(row, "SPFL");
                model.YHZC   = GetSafeData.ValidateValue <string>(row, "YHZC");
                model.SPFLMC = GetSafeData.ValidateValue <string>(row, "SPFLMC");
                model.YHZCMC = GetSafeData.ValidateValue <string>(row, "YHZCMC");
            }
            return(model);
        }
Пример #13
0
        public string AddExpense(BMFYXMModel feiyong)
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary.Add("BM", feiyong.BM);
            dictionary.Add("MC", feiyong.MC);
            dictionary.Add("JM", feiyong.JM);
            dictionary.Add("SJBM", feiyong.SJBM);
            dictionary.Add("KJM", feiyong.KJM);
            dictionary.Add("WJ", feiyong.WJ);
            dictionary.Add("SPFL", feiyong.SPFL);
            dictionary.Add("YHZC", feiyong.YHZC);
            dictionary.Add("SPFLMC", feiyong.SPFLMC);
            dictionary.Add("YHZCMC", feiyong.YHZCMC);
            if (this.baseDAO.未确认DAO方法2_疑似updateSQL("aisino.Fwkp.Bmgl.BMFYXM.FYXMAdd", dictionary) > 0)
            {
                return("0");
            }
            return("e02");
        }
Пример #14
0
 public BMFYXM_Edit(string BM, bool Isupdate)
 {
     this.fyxmlogical = new BLL.BMFYXMManager();
     this.fyxmModel   = new BMFYXMModel();
     this.log         = LogUtil.GetLogger <BMFYXM_Edit>();
     this._bm         = "";
     this._sjbm       = "";
     this.SuggestBM   = "";
     this.SuggestMC   = string.Empty;
     this.retCode     = string.Empty;
     this.SucDialog   = true;
     this.Initialize();
     this._bm      = BM;
     this.yuanBM   = BM;
     this.isUpdate = Isupdate;
     if (this.isUpdate)
     {
         this.Text = "费用项目编码编辑";
     }
     else
     {
         this.Text = "费用项目编码添加";
     }
 }
Пример #15
0
        public string AddExpenseKP(BMFYXMModel feiyong, int Addtype)
        {
            string str = this.CheckExpense(feiyong);

            if (str == "0")
            {
                if (TaxCardFactory.CreateTaxCard().QYLX.ISHY&& this.bmfyxmDAL.ExistCusMC(feiyong.BM, feiyong.MC, feiyong.SJBM))
                {
                    MessageManager.ShowMsgBox("INP-235136");
                    return("费用项目已存在");
                }
                if (this.bmfyxmDAL.ExistExpense(feiyong))
                {
                    MessageManager.ShowMsgBox("INP-235108");
                    return("编码已存在");
                }
                str = this.bmfyxmDAL.AddExpense(feiyong);
                if ((Addtype == 1) && (str == "0"))
                {
                    MessageManager.ShowMsgBox("INP-235201");
                }
            }
            return(str);
        }
Пример #16
0
 public string AddExpense(BMFYXMModel feiyong)
 {
     return(this.AddExpenseKP(feiyong, 0));
 }
Пример #17
0
        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++)
                {
                    BMFYXMModel 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 BMFYXMModel {
                        BM = strArray2[0],
                        MC = strArray2[1],
                        JM = strArray2[2],
                    };
                    model.KJM = CommonFunc.GenerateKJM(model.MC);
                    string     str7 = "";
                    string     str8 = "";
                    ResultType none = ResultType.None;
                    while (true)
                    {
                        if (stack.Count <= 0)
                        {
                            break;
                        }
                        flag2 = false;
                        if (model.BM.Length > stack.Peek().BM.Length)
                        {
                            if (!model.BM.StartsWith(stack.Peek().BM))
                            {
                                goto Label_02B0;
                            }
                            model.SJBM = stack.Peek().BM;
                            model.WJ   = 1;
                            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_02B0;
                                }
                                str5 = this.TuiJianBM(stack.Peek().BM);
                                if (model.BM.Length == str5.Length)
                                {
                                    goto Label_02B0;
                                }
                                str7 = "无效";
                                str8 = "编码长度必须与原有同级编码长度一致";
                                result.Invalid++;
                                none = ResultType.Invalid;
                            }
                            goto Label_03B0;
                        }
                        stack.Pop();
                    }
                    flag2 = true;
Label_02B0:
                    if ((flag2 && (str4 != "001")) && (model.BM.Length != str4.Length))
                    {
                        str7 = "无效";
                        str8 = "编码长度必须与原有同级编码长度一致";
                        result.Invalid++;
                        none = ResultType.Invalid;
                    }
                    else if (this.bmfyxmDAL.ExistExpense(model))
                    {
                        if (str7.Length == 0)
                        {
                            str7 = "重复";
                            result.Duplicated++;
                        }
                        if (str8.Length == 0)
                        {
                            str8 = "编码重复";
                            none = ResultType.Duplicated;
                        }
                        else
                        {
                            str8 = str8 + "且编码重复";
                            none = ResultType.Invalid;
                        }
                    }
                    else
                    {
                        StringUtils.GetSpellCode(model.MC);
                        if (this.bmfyxmDAL.AddExpense(model) == "0")
                        {
                            str7 = "正确传入";
                            result.Correct++;
                            none = ResultType.Correct;
                        }
                        else
                        {
                            str7 = "失败";
                            result.Failed++;
                            none = ResultType.Failed;
                        }
                    }
                    Label_03B0 :;
                    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);
        }
Пример #18
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)
            {
            }
        }
Пример #19
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)
            {
            }
        }