public List<EntityMstList> GetSupplierList(string random, string CustomerID, string ID, string Name, string Kana)
        {
            List<EntityMstList> objList = new List<EntityMstList>();

            #region 認証処理

            string companyId = "";
            string groupId = "";
            string userId = "";
            string ipAdress = "";
            string sessionString = "";

            try
            {
                companyId = ExCast.zCStr(HttpContext.Current.Session[ExSession.COMPANY_ID]);
                groupId = ExCast.zCStr(HttpContext.Current.Session[ExSession.GROUP_ID]);
                userId = ExCast.zCStr(HttpContext.Current.Session[ExSession.USER_ID]);
                ipAdress = ExCast.zCStr(HttpContext.Current.Session[ExSession.IP_ADRESS]);
                sessionString = ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]); 

                string _message = ExSession.SessionUserUniqueCheck(random, ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]), ExCast.zCInt(HttpContext.Current.Session[ExSession.USER_ID]));
                if (_message != "")
                {
                    EntityMstList entity = new EntityMstList();
                    entity.MESSAGE = _message;
                    objList.Add(entity);
                    return objList;
                }
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".GetSupplierList(認証処理)", ex);
                EntityMstList entity = new EntityMstList();
                entity.MESSAGE = "認証処理に失敗しました。" + Environment.NewLine + ex.Message.ToString();
                objList.Add(entity);
                return objList;
            }

            #endregion

            StringBuilder sb;
            DataTable dt;
            ExMySQLData db;

            try
            {
                db = ExSession.GetSessionDb(ExCast.zCInt(HttpContext.Current.Session[ExSession.USER_ID]),
                                            ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]));

                sb = new StringBuilder();

                #region SQL

                sb.Append("SELECT SR.* " + Environment.NewLine);
                sb.Append("  FROM M_SUPPLIER AS SR" + Environment.NewLine);
                sb.Append(" WHERE SR.DELETE_FLG = 0 " + Environment.NewLine);
                sb.Append("   AND SR.DISPLAY_FLG = 1 " + Environment.NewLine);
                sb.Append("   AND SR.COMPANY_ID = " + companyId + Environment.NewLine);
                sb.Append("   AND SR.CUSTOMER_ID = " + ExEscape.zRepStr(ExCast.zNumZeroNothingFormat(CustomerID)) + Environment.NewLine);
                if (ID != "")
                {
                    sb.Append("   AND SR.ID = " + ExEscape.zRepStr(ExCast.zNumZeroNothingFormat(ID)) + Environment.NewLine);
                }
                if (Name != "")
                {
                    sb.Append("   AND SR.NAME LIKE '" + ExEscape.zRepStrNoQuota(Name) + "%'" + Environment.NewLine);
                }
                if (Kana != "")
                {
                    sb.Append("   AND SR.KANA LIKE '" + ExEscape.zRepStrNoQuota(Kana) + "%'" + Environment.NewLine);
                }
                sb.Append(" ORDER BY SR.ID2 ");
                sb.Append("         ,SR.ID" + Environment.NewLine);
                sb.Append(" LIMIT 0, 1000");

                #endregion

                dt = db.GetDataTable(sb.ToString());

                if (dt.DefaultView.Count > 0)
                {
                    for (int i = 0; i <= dt.DefaultView.Count - 1; i++)
                    {
                        objList.Add(new EntityMstList(ExCast.zCStr(dt.DefaultView[i]["ID"]),
                                                      ExCast.zCStr(dt.DefaultView[i]["CUSTOMER_ID"]),
                                                      ExCast.zCStr(dt.DefaultView[i]["NAME"])
                                                      ));
                    }
                }
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".GetSupplierList", ex);
            }
            finally
            {
                db = null;
            }
            return objList;
        }
        public List<EntityMstList> GetUserList(string random, string ID, string Name, string Kana)
        {
            List<EntityMstList> objList = new List<EntityMstList>();

            #region 認証処理

            string companyId = "";
            string groupId = "";
            string userId = "";
            string ipAdress = "";
            string sessionString = "";

            try
            {
                companyId = ExCast.zCStr(HttpContext.Current.Session[ExSession.COMPANY_ID]);
                groupId = ExCast.zCStr(HttpContext.Current.Session[ExSession.GROUP_ID]);
                userId = ExCast.zCStr(HttpContext.Current.Session[ExSession.USER_ID]);
                ipAdress = ExCast.zCStr(HttpContext.Current.Session[ExSession.IP_ADRESS]);
                sessionString = ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]);

                string _message = ExSession.SessionUserUniqueCheck(random, ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]), ExCast.zCInt(HttpContext.Current.Session[ExSession.USER_ID]));
                if (_message != "")
                {
                    EntityMstList entity = new EntityMstList();
                    entity.MESSAGE = _message;
                    objList.Add(entity);
                    return objList;
                }
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".GetGroupList(認証処理)", ex);
                EntityMstList entity = new EntityMstList();
                entity.MESSAGE = "認証処理に失敗しました。" + Environment.NewLine + ex.Message.ToString();
                objList.Add(entity);
                return objList;
            }

            #endregion

            StringBuilder sb;
            DataTable dt;

            try
            {
                sb = new StringBuilder();

                #region SQL

                sb.Append("SELECT MT.* " + Environment.NewLine);
                sb.Append("  FROM SYS_M_USER AS MT" + Environment.NewLine);
                sb.Append(" WHERE MT.DELETE_FLG = 0 " + Environment.NewLine);
                sb.Append("   AND MT.DISPLAY_FLG = 1 " + Environment.NewLine);
                if (ID != "")
                {
                    sb.Append("   AND MT.LOGIN_ID = " + ExEscape.zRepStr(ID) + Environment.NewLine);
                }
                if (Name != "")
                {
                    sb.Append("   AND MT.NAME LIKE '" + ExEscape.zRepStrNoQuota(Name) + "%'" + Environment.NewLine);
                }
                sb.Append(" ORDER BY MT.LOGIN_ID" + Environment.NewLine);
                sb.Append(" LIMIT 0, 1000");

                #endregion

                dt = CommonUtl.gMySqlDt.GetDataTable(sb.ToString());

                if (dt.DefaultView.Count > 0)
                {
                    for (int i = 0; i <= dt.DefaultView.Count - 1; i++)
                    {
                        EntityMstList mst = new EntityMstList(ExCast.zCStr(dt.DefaultView[i]["LOGIN_ID"]),
                                                              ExCast.zCStr(dt.DefaultView[i]["LOGIN_ID"]),
                                                              ExCast.zCStr(dt.DefaultView[i]["NAME"])
                                                              );
                        mst.ATTRIBUTE1 = ExCast.zCStr(dt.DefaultView[i]["ID"]);
                        objList.Add(mst);
                    }
                }
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".GetUserList", ex);
            }
            return objList;
        }
        public List<EntityMstList> GetPaymentBalanceList(string random, string ID, string Name)
        {
            List<EntityMstList> objList = new List<EntityMstList>();

            #region 認証処理

            string companyId = "";
            string groupId = "";
            string userId = "";
            string ipAdress = "";
            string sessionString = "";

            try
            {
                companyId = ExCast.zCStr(HttpContext.Current.Session[ExSession.COMPANY_ID]);
                groupId = ExCast.zCStr(HttpContext.Current.Session[ExSession.GROUP_ID]);
                userId = ExCast.zCStr(HttpContext.Current.Session[ExSession.USER_ID]);
                ipAdress = ExCast.zCStr(HttpContext.Current.Session[ExSession.IP_ADRESS]);
                sessionString = ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]);

                string _message = ExSession.SessionUserUniqueCheck(random, ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]), ExCast.zCInt(HttpContext.Current.Session[ExSession.USER_ID]));
                if (_message != "")
                {
                    EntityMstList entity = new EntityMstList();
                    entity.MESSAGE = _message;
                    objList.Add(entity);
                    return objList;
                }
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".GetSalesBalanceList(認証処理)", ex);
                EntityMstList entity = new EntityMstList();
                entity.MESSAGE = "認証処理に失敗しました。" + Environment.NewLine + ex.Message.ToString();
                objList.Add(entity);
                return objList;
            }

            #endregion

            StringBuilder sb;
            DataTable dt;
            ExMySQLData db;

            try
            {
                db = ExSession.GetSessionDb(ExCast.zCInt(HttpContext.Current.Session[ExSession.USER_ID]),
                                            ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]));
                sb = new StringBuilder();

                #region SQL

                sb.Append("SELECT MT.* " + Environment.NewLine);
                sb.Append("      ,CG.NAME " + Environment.NewLine);
                sb.Append("  FROM M_PAYMENT_CREDIT_BALANCE AS MT" + Environment.NewLine);

                // 会社グループ
                sb.Append("  LEFT JOIN SYS_M_COMPANY_GROUP AS CG" + Environment.NewLine);
                sb.Append("    ON CG.DELETE_FLG = 0 " + Environment.NewLine);
                sb.Append("   AND CG.COMPANY_ID = MT.COMPANY_ID" + Environment.NewLine);
                sb.Append("   AND CG.ID = MT.GROUP_ID" + Environment.NewLine);

                sb.Append(" WHERE MT.DELETE_FLG = 0 " + Environment.NewLine);
                sb.Append("   AND MT.DISPLAY_FLG = 1 " + Environment.NewLine);
                sb.Append("   AND MT.COMPANY_ID = " + companyId + Environment.NewLine);
                if (ID != "")
                {
                    sb.Append("   AND MT.ID = " + ExEscape.zRepStr(ExCast.zNumZeroNothingFormat(ID)) + Environment.NewLine);
                }
                //if (Name != "")
                //{
                //    sb.Append("   AND MT.NAME LIKE '" + ExEscape.zRepStrNoQuota(Name) + "%'" + Environment.NewLine);
                //}
                sb.Append(" ORDER BY CG.ID" + Environment.NewLine);

                #endregion

                dt = db.GetDataTable(sb.ToString());

                if (dt.DefaultView.Count > 0)
                {
                    for (int i = 0; i <= dt.DefaultView.Count - 1; i++)
                    {
                        objList.Add(new EntityMstList(ExCast.zCStr(dt.DefaultView[i]["NAME"]),
                                                      ExCast.zCStr(dt.DefaultView[i]["NAME"]),
                                                      String.Format("{0,12:#,##0}", ExCast.zCDbl(dt.DefaultView[i]["PAYMENT_CREDIT_PRICE"]))
                                                      ));
                    }
                }
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".GetPaymentBalanceList", ex);
            }
            return objList;
        }
        public List<EntityMstList> GetZipList(string random, string zipFrom, string zipTo)
        {
            List<EntityMstList> objList = new List<EntityMstList>();

            #region 認証処理

            string companyId = "";
            string groupId = "";
            string userId = "";
            string ipAdress = "";
            string sessionString = "";

            try
            {
                companyId = ExCast.zCStr(HttpContext.Current.Session[ExSession.COMPANY_ID]);
                groupId = ExCast.zCStr(HttpContext.Current.Session[ExSession.GROUP_ID]);
                userId = ExCast.zCStr(HttpContext.Current.Session[ExSession.USER_ID]);
                ipAdress = ExCast.zCStr(HttpContext.Current.Session[ExSession.IP_ADRESS]);
                sessionString = ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]);

                string _message = ExSession.SessionUserUniqueCheck(random, ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]), ExCast.zCInt(HttpContext.Current.Session[ExSession.USER_ID]));
                if (_message != "")
                {
                    EntityMstList entity = new EntityMstList();
                    entity.MESSAGE = _message;
                    objList.Add(entity);
                    return objList;
                }
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".GetZipList(認証処理)", ex);
                EntityMstList entity = new EntityMstList();
                entity.MESSAGE = "認証処理に失敗しました。" + Environment.NewLine + ex.Message.ToString();
                objList.Add(entity);
                return objList;
            }

            #endregion

            StringBuilder sb;
            DataTable dt;

            try
            {
                sb = new StringBuilder();

                #region SQL

                sb.Append("SELECT ZP.* " + Environment.NewLine);
                sb.Append("  FROM SYS_M_ZIP AS ZP" + Environment.NewLine);
                sb.Append(" WHERE ZP.DELETE_FLG = 0 " + Environment.NewLine);
                sb.Append("   AND ZP.DISPLAY_FLG = 1 " + Environment.NewLine);
                if (zipFrom != "" && zipTo != "")
                {
                    sb.Append("   AND ZP.ZIP = " + ExEscape.zRepStr(ExCast.zCInt(zipFrom).ToString() + zipTo) + Environment.NewLine);
                }
                else if (zipFrom != "")
                {
                    sb.Append("   AND ZP.ZIP LIKE '" + ExEscape.zRepStrNoQuota(ExCast.zCInt(zipFrom)) + "%'" + Environment.NewLine);
                }
                else if (zipTo != "")
                {
                    sb.Append("   AND ZP.ZIP LIKE '%" + ExEscape.zRepStrNoQuota(zipTo) + "'" + Environment.NewLine);
                }
                sb.Append(" ORDER BY ZIP" + Environment.NewLine);
                sb.Append(" LIMIT 0, 1000");

                #endregion

                dt = CommonUtl.gMySqlDt.GetDataTable(sb.ToString());

                if (dt.DefaultView.Count > 0)
                {
                    for (int i = 0; i <= dt.DefaultView.Count - 1; i++)
                    {
                        EntityMstList mst = new EntityMstList(ExCast.zCStr(dt.DefaultView[i]["ZIP"]),
                                                              ExCast.zCStr(dt.DefaultView[i]["ZIP"]),
                                                              ExCast.zCStr(dt.DefaultView[i]["PREDECTURE_NAME"]) +
                                                              ExCast.zCStr(dt.DefaultView[i]["CITY_NAME"]) +
                                                              ExCast.zCStr(dt.DefaultView[i]["TOWN_NAME"]));

                        mst.ATTRIBUTE1 = ExCast.zCStr(dt.DefaultView[i]["PREDECTURE_NAME"]);
                        mst.ATTRIBUTE2 = ExCast.zCStr(dt.DefaultView[i]["CITY_NAME"]);
                        mst.ATTRIBUTE3 = ExCast.zCStr(dt.DefaultView[i]["TOWN_NAME"]);

                        objList.Add(mst);
                    }
                }
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".GetZipList", ex);
            }
            return objList;
        }