Example #1
0
        public static KindergartenInfo GetKindergartenInfo()
        {
            var    Info         = new KindergartenInfo();
            var    Kindergarten = new DataTable();
            string Sql          = string.Empty;

            try
            {
                Sql          = string.Format(InitObject.GetScriptServiceInstance().GetKindergartenListById, BznsBase.KindergartenId);
                Kindergarten = MySqlHelper.GetDataSet(BznsBase.GetConnectionString, BznsBase.GetCommandType, Sql, null).Tables[0];
                if (Kindergarten.Rows.Count > 0)
                {
                    DataRow dr = Kindergarten.Rows[0];
                    Info.Id   = dr["kindergarten_id"].ToString();
                    Info.Code = dr["kindergarten_number"].ToString();
                    Info.Name = dr["kindergarten_nm"].ToString();
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally {
                Kindergarten = null;
            }

            return(Info);
        }
Example #2
0
        public static BrandInfo GetBrandInfo()
        {
            var    Info  = new BrandInfo();
            var    Brand = new DataTable();
            string Sql   = string.Empty;

            try
            {
                Sql   = string.Format(InitObject.GetScriptServiceInstance().GetBrandListById, BznsBase.BrandID);
                Brand = MySqlHelper.GetDataSet(BznsBase.GetConnectionString, BznsBase.GetCommandType, Sql, null).Tables[0];
                if (Brand.Rows.Count > 0)
                {
                    DataRow dr = Brand.Rows[0];
                    Info.Id   = dr["Brand_ID"].ToString();
                    Info.Code = dr["Brand_Code"].ToString();
                    Info.Name = dr["Brand_Name"].ToString();
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally {
                Brand = null;
            }

            return(Info);
        }
Example #3
0
        public static void Insert(SysLogInfo Info)
        {
            var sql = string.Empty;

            try
            {
                sql = string.Format(InitObject.GetScriptServiceInstance().SysLogInsert, @Info.message, (int)Info.type, Info.moduleName, BznsBase.KindergartenId);

                int QueryValue = MySqlHelper.ExecuteNonQuery(BznsBase.GetConnectionString, BznsBase.GetCommandType, sql, null);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally {
            }
        }
Example #4
0
        public static bool Export(SysLogType type)
        {
            var sql      = string.Empty;
            var FilePath = string.Empty;
            var dt       = new DataTable();
            var result   = false;

            try
            {
                switch ((int)type)
                {
                case 0:
                    FilePath = ConfigurationManager.AppSettings["InfoLogPath"];
                    break;

                case 1:
                    FilePath = ConfigurationManager.AppSettings["WarningLogPath"];
                    break;

                default:
                    FilePath = ConfigurationManager.AppSettings["ErrorLogPath"];
                    break;
                }

                sql = string.Format(InitObject.GetScriptServiceInstance().SysLogList, (int)type, BznsBase.KindergartenId);
                dt  = DBHelper.MySqlHelper.GetDataSet(BznsBase.GetConnectionString, BznsBase.GetCommandType, sql, null).Tables[0];
                ExcelHelper.ExcelHelper.DataTableToExcel(dt, string.Empty, FilePath);

                result = true;
            }
            catch (Exception ex)
            {
                SysLog.Insert(new SysLogInfo(ex.Message, SysLogType.ERROR, "System Log"));
            }
            finally {
            }

            return(result);
        }