Beispiel #1
0
        public static bool AddAreaIDToCusrTBL()
        {
            IBaseDAO baseDAOSQLite = BaseDAOFactory.GetBaseDAOSQLite();

            baseDAOSQLite.Open();
            try
            {
                IKHBM            ikhbm   = new KHBM();
                IXZQYBM          ixzqybm = new XZQYBM();
                List <KHBMModal> list    = ikhbm.SelectKHBM_WJ(1);
                if (list == null)
                {
                    return(false);
                }
                if (0 < list.Count)
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        KHBMModal modal = list[i];
                        string    sH    = modal.SH;
                        if (sH.Length >= 4)
                        {
                            if (!string.IsNullOrEmpty(sH) && (4 <= sH.Length))
                            {
                                ikhbm.UpdateKHBM_DQBM(modal.BM, sH.Substring(0, 4));
                            }
                            string             strBM = sH.Substring(0, 4);
                            List <XZQYBMModal> list2 = ixzqybm.SelectXZQYBM_BM(strBM);
                            if ((list2 != null) && (0 < list2.Count))
                            {
                                ikhbm.UpdateKHBM_DQMC(modal.BM, list2[0].MC.Trim());
                            }
                        }
                    }
                    PropertyUtil.SetValue(DingYiZhiFuChuan.A6KHMsgWrite, "已经添加地区代码到客户编码表");
                }
                else
                {
                    return(false);
                }
            }
            catch (BaseException exception)
            {
                writeLogfile("Errinfo:" + exception.Message, _Loger);
                _Loger.Error(exception.ToString());
                ExceptionHandler.HandleError(exception);
            }
            catch (Exception exception2)
            {
                writeLogfile("Errinfo:" + exception2.Message, _Loger);
                _Loger.Error(exception2.ToString());
                ExceptionHandler.HandleError(exception2);
            }
            finally
            {
                baseDAOSQLite.Commit();
                baseDAOSQLite.Close();
            }
            return(true);
        }